app/soc/models/seed_db.py
changeset 1794 6ffd25bedef9
parent 1793 fd77432057b0
child 1798 ba4c00bc0c39
equal deleted inserted replaced
1793:fd77432057b0 1794:6ffd25bedef9
    39 from soc.models.notification import Notification
    39 from soc.models.notification import Notification
    40 from soc.models.org_admin import OrgAdmin
    40 from soc.models.org_admin import OrgAdmin
    41 from soc.models.organization import Organization
    41 from soc.models.organization import Organization
    42 from soc.models.org_app import OrgApplication
    42 from soc.models.org_app import OrgApplication
    43 from soc.models.program import Program
    43 from soc.models.program import Program
       
    44 from soc.models.ranker_root import RankerRoot
    44 from soc.models.site import Site
    45 from soc.models.site import Site
    45 from soc.models.sponsor import Sponsor
    46 from soc.models.sponsor import Sponsor
    46 from soc.models.timeline import Timeline
    47 from soc.models.timeline import Timeline
    47 from soc.models.user import User
    48 from soc.models.user import User
    48 
    49 
   387 
   388 
   388 def clear(*args, **kwargs):
   389 def clear(*args, **kwargs):
   389   """Removes all entities from the datastore.
   390   """Removes all entities from the datastore.
   390   """
   391   """
   391 
   392 
       
   393   # there no explicit ranker model anywhere, so make one for
       
   394   # our own convenience to delete all rankers
       
   395   class ranker(db.Model):
       
   396     pass
       
   397 
   392   entities = itertools.chain(*[
   398   entities = itertools.chain(*[
   393       Notification.all(),
   399       Notification.all(),
   394       Mentor.all(),
   400       Mentor.all(),
   395       OrgAdmin.all(),
   401       OrgAdmin.all(),
       
   402       ranker.all(),
       
   403       RankerRoot.all(),
   396       Organization.all(),
   404       Organization.all(),
   397       OrgApplication.all(),
   405       OrgApplication.all(),
   398       Timeline.all(),
   406       Timeline.all(),
   399       Program.all(),
   407       Program.all(),
   400       Host.all(),
   408       Host.all(),