Advertisement
SparrowG

Untitled

Jun 9th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. ==MongoDB==
  2.  
  3. Targets = {
  4.     Age:23
  5.     Sex:'M'
  6.     Location:(10,30)
  7.     Videos: [{V_id:Object_id(....),Score:1200},{V_id:Object_id(...),Score1110}]
  8. }
  9.  
  10. ==Django==
  11.  
  12. class Content(Document):
  13.     ContentProvider = ReferenceField(ContentProvider)
  14.     Title = StringField('Title',required = True)
  15.     Description = StringField('Description')
  16.     Link = StringField('Link')
  17.  
  18. class Target(Document):
  19.     Age = IntField('Age')
  20.     Gender = BooleanField('Gender',choices={'M','F'})
  21.     Videos = SortedListField(ReferenceField(Content))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement