Changeset 30256e2 for asadb/space
- Timestamp:
- Jun 4, 2013, 3:01:31 AM (12 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- cd47318
- Parents:
- 210d042
- git-author:
- Alex Dehnert <adehnert@…> (06/04/13 03:01:31)
- git-committer:
- Alex Dehnert <adehnert@…> (06/04/13 03:01:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asadb/space/migrations/0006_lock_types_setup.py
r9358747 r30256e2 29 29 ('50-024', 'cac-combo', ), 30 30 ('50-028', 'cac-combo', ), 31 ('50-030', 'cac-combo', ), # guess --- matches 50-028, which seems to be same room32 31 ('50-301', 'group', ), 33 32 ('50-302', 'cac-combo', ), … … 61 60 ('50-025/A', 'cac-key', ), # set shop 62 61 ('50-045', 'cac-key', ), # set shop 62 63 # 50-032: See http://asa.scripts.mit.edu/trac/ticket/96#comment:4. 64 # The outer door has a keyhole, but all the groups are also in 50-028 and 65 # apparently just use the connecting door. The room was originally listed 66 # as 50-030, so that also needs to be fixed. 67 ('50-032', 'inner', ), 63 68 ) 64 69 … … 67 72 def forwards(self, orm): 68 73 "Write your forwards methods here." 74 75 spaces = orm['space.Space'].objects 76 77 # Fix 50-032 (see http://asa.scripts.mit.edu/trac/ticket/96#comment:4) 78 try: 79 W030 = spaces.get(number='50-030') 80 W030.number = '50-032' 81 W030.save() 82 except orm['space.Space'].DoesNotExist: 83 print " - Could not find 50-030 for renaming to 50-032" 84 85 # Add lock types 69 86 call_command("loaddata", "LockTypes.xml") 70 87 lock_types = orm['space.LockType'].objects 71 spaces = orm['space.Space'].objects72 88 spaces.filter(number__startswith='50-').update(lock_type=lock_types.get(slug='unknown')) 73 89 spaces.filter(number__startswith='N52-').update(lock_type=lock_types.get(slug='semo')) … … 81 97 def backwards(self, orm): 82 98 "Write your backwards methods here." 99 # Unfix 50-032 100 spaces = orm['space.Space'].objects 101 try: 102 W030 = spaces.get(number='50-032') 103 W030.number = '50-030' 104 W030.save() 105 except orm['space.Space'].DoesNotExist: 106 print " - Could not find 50-032 to unrename back to 50-030" 83 107 84 108
Note: See TracChangeset
for help on using the changeset viewer.