script/lib/iri_tweet/models.py
changeset 250 6334869ab06d
parent 122 4c3a15877f80
child 253 e9335ee3cf71
--- a/script/lib/iri_tweet/models.py	Wed Jul 27 12:29:02 2011 +0200
+++ b/script/lib/iri_tweet/models.py	Wed Jul 27 17:23:16 2011 +0200
@@ -124,7 +124,7 @@
     profile_text_color= Column(String)
     profile_use_background_image= Column(Boolean)
     protected= Column(Boolean)
-    screen_name= Column(String)
+    screen_name= Column(String, index=True, unique=True)
     show_all_inline_media= Column(Boolean)
     statuses_count = Column(Integer)
     time_zone= Column(String)
@@ -143,7 +143,7 @@
 class Hashtag(Base):
     __tablename__ = "tweet_hashtag"
     id = Column(Integer, primary_key=True)
-    text = Column(String, unique = True)
+    text = Column(String, unique = True, index = True)
     def __init__(self, **kwargs):
         for key, value in kwargs.items():
             if hasattr(self,key):
@@ -204,7 +204,7 @@
                 
 def setup_database(*args, **kwargs):
         
-    create_all = True        
+    create_all = True
     if "create_all" in kwargs:
         create_all = kwargs["create_all"]
         del(kwargs["create_all"])