Xataface seems to return the key itself in a valuelist lookup, if the key is not defined in the valuelist. How can I suppress this output und have just an empty string instead?
I have a valuelist based on an SQL query: Person-IDs (key) are looked up in a table holding contract numbers (value). Not every person has a contract, but every person has an ID. So Xataface shows me the Person-ID in the column contract number, if the SQL query on the contract table fails to find a contract for the person queried. I would like Xataface to show me nothing instead of the ID in this case.
My code is:
table/person/valuelists.ini:
[contract_number]
__sql__ = "SELECT p.id, c.number FROM contract AS c JOIN person AS p ON c.person_id = p.id"
table/person/fields.ini:
[id]
widget:label = "Vertragsnummer"
widget:type = text
vocabulary = "contract_number"
Note: This is a bit unusual, because I do not have any information of contracts in the table "person", so I have to use the column "id" of "person" to show contract information. The table "contract" holds the person's id in the field "person_id".
Thank you for your help.