It did the trick, thanks Anthony!
By the way the difficult part for me was building the list containing all
ids from multiple tables.
Assuming ids are unique across tables (which was my case), this function
can help build the IS_IN_SET validator :
def mix(list_long, list_short):
i,j =
How would you know whether the field stores an id of the melon table or the
watermelon table?
On Friday, May 23, 2014 4:52:58 PM UTC-4, Louis Amon wrote:
Due to external constraints, I need to define two tables that are actually
siblings and a third table's field that can choose from any of
Well in this particular case I needn't know wether I'm storing a melon or a
watermelon's id.
I know it's kind of idiotic but I just need a 'fruit' id.
Think of it as a subclassing matter : the API I'm connecting to is doing
something along the lines of subclassing anyway, and I need to store
I suppose you could just make it type='integer'. Then you could use the
IS_IN_SET validator and construct a list of id's from the two tables
(keeping in mind you should de-dup the list, as both tables will have many
of the same id's). Of course, if you end up storing a value of say, 5, you
4 matches
Mail list logo