On Friday, June 7, 2013 12:49:46 PM UTC-7, Charlie Clark wrote:
>
> Am 07.06.2013, 01:13 Uhr, schrieb Andy <aml...@gmail.com <javascript:>>: 
>
> > I may be misunderstanding the question, but the reason that having a 
> > favorite is optional is because I'm using mysql and mysql doesn't   
> > supported deferred constraints. 
>
> Oh, I feel your pain! But you are using an engine that at leasts pretends 
>   
> to support foreign key constraints. If not, book yourself in at the next   
> asylum! 
>
> > So if favorite were "NOT NULL", then there would  be 
> > no way to create the thing. 
>
> Which is why it should be a relation all of its own. I've a sneaking   
> suspicion that I'm being incredibly dense and missing something obvious. 
>
>
I could do that, but I'd change the foreign key in favorites to point at 
group_things, since your favorite group must be a group that you're in.  
Then I'd drop the other foreign key constraint as unnecessary, since it's 
implied by the new one, and then I'd be back at square one (needing to 
convince the ORM to understand a relation with no real foreign key).

Also, SERIAL?  You must be using a real database engine :)

--Andy

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to