Monday, April 22, 2013

Re: How to link different kinds of objects?

Sorry I am late to this thread I started typing up a response yesterday but never got around to sending it. Let me first reviews Problem scope.
1. You have a Feed, which is an object.
2. A feed can be created by any user.
3. A user can create an object. Is this object premade and they are just saving it with values, or are you actually talking about custom enduser objects.

My mind in these problems always seems to jump to json serialization at the db layer. 

Two Models: Feed and FeedObject

Feed is related m2m to FeedObject

FeedObject has a field of type Text that contains a JSON serialized string of the created object. in the proper format for a feed to take it in.
FeedObject also has any fields necessary to identify what might be in the JSON text, so that you can do quick searches and sorts.

This is the methodology i used when i was building out Recent Activity Streams

You should come up with a good schema for a feedobject  like http://activitystrea.ms/


On Monday, April 22, 2013 6:48:33 AM UTC-4, אברהם סרור wrote:
So it looks like the m2m should be in the object Model. one more thing, maybe it would be worth it to inline the object admin in the feed admin


On Mon, Apr 22, 2013 at 12:22 PM, Bastian <bastien....@gmail.com> wrote:
Thanks for your answer. About the constraints: a feed can be empty or contain one or more objects. And an object must belong to at least one feed. I have run some tests and the m2m field works perfectly for that.

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



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

No comments:

Post a Comment