Re: [sqlalchemy] Creating a feed related to different object type

2012-12-05 Thread Eric Ongerth
Hi Brice, I think something strange happened in the discussion group web page because it did not show me the existence of the message in which you linked to your solution. If I had seen that I would have known that you already found the way. Cheers, Eric On Sunday, December 2, 2012 8:00:05

Re: [sqlalchemy] Creating a feed related to different object type

2012-12-02 Thread Brice Leroy
Hi Eric, Thank you, I actually used this documentation (even though they are only many-to-many) and some other blog post to come up with this solution. Using 0.7 I don't have event on Mixin so I had to find an alternative to event attachment. BTW I'm pretty surprised by the speed of the event

Re: [sqlalchemy] Creating a feed related to different object type

2012-12-01 Thread Eric Ongerth
Hi Brice, Yours is another good case of the 'Generic Associations' or 'Polymorphic Association' pattern which comes up quite often. Here's a link to some docs that will get you going on a good solution that keeps the database normalized.

Re: [sqlalchemy] Creating a feed related to different object type

2012-11-28 Thread Brice Leroy
So here is my solution, https://gist.github.com/4164619 Hope it helps others to get an insight on generic relation in SQLAlchemy. On Tue, Nov 27, 2012 at 7:41 AM, Brice Leroy bbrriic...@gmail.com wrote: Thank you for the advice Robert. As I'm using flask I'm not sure how adaptable the ZCA

[sqlalchemy] Creating a feed related to different object type

2012-11-27 Thread Brice Leroy
Hello everybody, It's about brainstorming on an elegant solution. I previously posted this question on the Flask mailing list, and I got advised to post it on SQLAlchemy list... which make more sense I admit. So here is my issue: I have N different classes: class Comment(Models): author_id =

Re: [sqlalchemy] Creating a feed related to different object type

2012-11-27 Thread Robert Forkel
hi, i used to do something like this, i.e. adding information about urls, views, etc. to sqlalchemy models, but found this to be inflexibel. Now I keep URL-related information in the web app's routing component, and to solve problems like the one you pose, I use zca adapters [1] (which is easier

Re: [sqlalchemy] Creating a feed related to different object type

2012-11-27 Thread Brice Leroy
Thank you for the advice Robert. As I'm using flask I'm not sure how adaptable the ZCA would be. I'll try to understand the logic behind it and see if I can replicate it within my models. On Tue, Nov 27, 2012 at 7:12 AM, Robert Forkel xrotw...@googlemail.comwrote: hi, i used to do something