Test suite runs and passes!
[zzz-floof.git] / floof / model / users.py
index f2a6a75..6643702 100644 (file)
@@ -11,8 +11,8 @@ from elixir import *
 from search import GalleryWidget
 
 class User(Entity):
-    name = Field(Unicode(20), unique=True)
-    display_name = Field(Unicode(20))
+    name = Field(Unicode(20), unique=True, required=True)
+    display_name = Field(Unicode(20), required=True)
     uploads = OneToMany('Art')
     has_many('identity_urls', of_kind='IdentityURL')
     searches = OneToMany('SavedSearch')
@@ -51,13 +51,13 @@ class User(Entity):
         prepositions = ['by','for','of']
         for preposition in prepositions:
             GalleryWidget(page=self.primary_page, string=preposition+":me", owner=self)
-        
+
         #UserPage.clone_primary_template(self)
 
 
 class IdentityURL(Entity):
-    url = Field(Unicode(255))
-    belongs_to('user', of_kind='User')
+    url = Field(Unicode(255), required=True)
+    user = ManyToOne('User', required=True)
 
 
 from copy import copy
@@ -119,7 +119,7 @@ class UserRelationship(Entity):
     to users.
     """
 
-    user = ManyToOne('User')
-    target_user = ManyToOne('User')
+    user = ManyToOne('User', required=True)
+    target_user = ManyToOne('User', required=True)
     type = Field(Integer)  # UserRelationshipTypes above