Changeset a03cb61
- Timestamp:
- Apr 6, 2012, 1:28:28 AM (14 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- 2c86ed1
- Parents:
- 0ac15a1
- git-author:
- Alex Dehnert <adehnert@…> (04/06/12 01:28:28)
- git-committer:
- ASA Group Database <asa-db@…> (04/06/12 01:28:28)
- Location:
- asadb
- Files:
-
- 3 added
- 3 edited
-
forms/migrations/0011_add_indices.py (added)
-
forms/models.py (modified) (5 diffs)
-
groups/migrations/0024_add_indices.py (added)
-
groups/models.py (modified) (6 diffs)
-
space/migrations/0002_add_indices.py (added)
-
space/models.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/forms/models.py
rc297267 ra03cb61 10 10 11 11 class FYSM(models.Model): 12 group = models.ForeignKey(groups.models.Group )12 group = models.ForeignKey(groups.models.Group, db_index=True, ) 13 13 display_name = models.CharField(max_length=50) 14 year = models.IntegerField( )14 year = models.IntegerField(db_index=True, ) 15 15 website = models.URLField() 16 16 join_url = models.URLField(verbose_name="recruiting URL", help_text="""<p>If you have a specific web page for recruiting new members of your group, you can link to it here. It will be used as the destination for most links about your group (join link on the main listing page and when clicking on the slide, but not the "website" link on the slide page). If you do not have such a page, use your main website's URL.</p>""") … … 39 39 class FYSMCategory(models.Model): 40 40 name = models.CharField(max_length=25) 41 slug = models.SlugField( )41 slug = models.SlugField(unique=True, ) 42 42 blurb = models.TextField() 43 43 … … 139 139 class GroupConfirmationCycle(models.Model): 140 140 name = models.CharField(max_length=30) 141 slug = models.SlugField( )141 slug = models.SlugField(unique=True, ) 142 142 create_date = models.DateTimeField(default=datetime.datetime.now) 143 143 … … 155 155 updater_title = models.CharField(max_length=30, help_text="You need not hold any particular title in the group, but we like to know who is completing the form.") 156 156 157 group = models.ForeignKey(groups.models.Group, help_text="If your group does not appear in the list above, then please email asa-exec@mit.edu." )157 group = models.ForeignKey(groups.models.Group, help_text="If your group does not appear in the list above, then please email asa-exec@mit.edu.", db_index=True, ) 158 158 group_email = models.EmailField(help_text="The text of the law will be automatically distributed to your members via this list, in order to comply with the law.") 159 159 officer_email = models.EmailField() … … 196 196 update_time = models.DateTimeField(default=datetime.datetime.utcfromtimestamp(0)) 197 197 username = models.CharField(max_length=30) 198 cycle = models.ForeignKey(GroupConfirmationCycle )198 cycle = models.ForeignKey(GroupConfirmationCycle, db_index=True, ) 199 199 deleted = models.DateTimeField(default=None, null=True, blank=True, ) 200 200 valid = models.IntegerField(choices=VALID_CHOICES, default=VALID_UNSET) -
asadb/groups/models.py
r4325823 ra03cb61 23 23 24 24 class Group(models.Model): 25 name = models.CharField(max_length=100 )26 abbreviation = models.CharField(max_length=10, blank=True )25 name = models.CharField(max_length=100, db_index=True, ) 26 abbreviation = models.CharField(max_length=10, blank=True, db_index=True, ) 27 27 description = models.TextField() 28 activity_category = models.ForeignKey('ActivityCategory', null=True, blank=True, )29 group_class = models.ForeignKey('GroupClass' )30 group_status = models.ForeignKey('GroupStatus' )31 group_funding = models.ForeignKey('GroupFunding', null=True, blank=True, )28 activity_category = models.ForeignKey('ActivityCategory', null=True, blank=True, db_index=True, ) 29 group_class = models.ForeignKey('GroupClass', db_index=True, ) 30 group_status = models.ForeignKey('GroupStatus', db_index=True, ) 31 group_funding = models.ForeignKey('GroupFunding', null=True, blank=True, db_index=True, ) 32 32 website_url = models.URLField() 33 33 constitution_url = models.CharField(max_length=200, blank=True) … … 225 225 226 226 class GroupStartup(models.Model): 227 group = models.ForeignKey(Group )227 group = models.ForeignKey(Group, unique=True, ) 228 228 stage = models.IntegerField(choices=GROUP_STARTUP_STAGE) 229 229 submitter = models.CharField(max_length=30, editable=False, ) … … 239 239 240 240 class GroupNote(models.Model): 241 author = models.CharField(max_length=30, ) # match Django username field241 author = models.CharField(max_length=30, db_index=True, ) # match Django username field 242 242 timestamp = models.DateTimeField(default=datetime.datetime.now, editable=False, ) 243 243 body = models.TextField() 244 244 acl_read_group = models.BooleanField(default=True, help_text='Can the group read this note') 245 245 acl_read_offices = models.BooleanField(default=True, help_text='Can "offices" that interact with groups (SAO, CAC, and funding boards) read this note') 246 group = models.ForeignKey(Group )246 group = models.ForeignKey(Group, db_index=True, ) 247 247 248 248 def __str__(self, ): … … 274 274 275 275 display_name = models.CharField(max_length=50) 276 slug = models.SlugField( )276 slug = models.SlugField(unique=True, ) 277 277 description = models.TextField() 278 278 max_count = models.IntegerField(default=UNLIMITED, help_text='Maximum number of holders of this role. Use %d for no limit.' % UNLIMITED) … … 314 314 END_NEVER = datetime.datetime.max 315 315 316 person = models.CharField(max_length=30 )317 role = models.ForeignKey('OfficerRole' )318 group = models.ForeignKey('Group' )319 start_time = models.DateTimeField(default=datetime.datetime.now )320 end_time = models.DateTimeField(default=datetime.datetime.max )316 person = models.CharField(max_length=30, db_index=True, ) 317 role = models.ForeignKey('OfficerRole', db_index=True, ) 318 group = models.ForeignKey('Group', db_index=True, ) 319 start_time = models.DateTimeField(default=datetime.datetime.now, db_index=True, ) 320 end_time = models.DateTimeField(default=datetime.datetime.max, db_index=True, ) 321 321 322 322 objects = models.Manager() … … 433 433 434 434 class AthenaMoiraAccount(models.Model): 435 username = models.CharField(max_length=8 )435 username = models.CharField(max_length=8, unique=True, ) 436 436 mit_id = models.CharField(max_length=15) 437 437 first_name = models.CharField(max_length=45) -
asadb/space/models.py
r5680065 ra03cb61 98 98 END_NEVER = datetime.datetime.max 99 99 100 group = models.ForeignKey(groups.models.Group )101 space = models.ForeignKey(Space )102 start = models.DateField(default=datetime.datetime.now )103 end = models.DateField(default=END_NEVER )100 group = models.ForeignKey(groups.models.Group, db_index=True, ) 101 space = models.ForeignKey(Space, db_index=True, ) 102 start = models.DateField(default=datetime.datetime.now, db_index=True, ) 103 end = models.DateField(default=END_NEVER, db_index=True, ) 104 104 105 105 notes = models.TextField(blank=True, ) … … 139 139 END_NEVER = datetime.datetime.max 140 140 141 group = models.ForeignKey(groups.models.Group )142 space = models.ForeignKey(Space )143 start = models.DateTimeField(default=now_offset )144 end = models.DateTimeField(default=END_NEVER )141 group = models.ForeignKey(groups.models.Group, db_index=True, ) 142 space = models.ForeignKey(Space, db_index=True, ) 143 start = models.DateTimeField(default=now_offset, db_index=True, ) 144 end = models.DateTimeField(default=END_NEVER, db_index=True, ) 145 145 146 146 name = models.CharField(max_length=50)
Note: See TracChangeset
for help on using the changeset viewer.