Changeset 89b3a65
- Timestamp:
- Mar 6, 2013, 8:08:17 PM (13 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- 9358747
- Parents:
- 21f7242
- git-author:
- Alex Dehnert <adehnert@…> (03/06/13 20:08:17)
- git-committer:
- Alex Dehnert <adehnert@…> (03/06/13 20:08:17)
- Location:
- asadb/space
- Files:
-
- 2 edited
-
fixtures/LockTypes.xml (modified) (1 diff)
-
migrations/0006_lock_types_setup.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/space/fixtures/LockTypes.xml
r8aea837 r89b3a65 49 49 <field type="CharField" name="db_update">none</field> 50 50 </object> 51 <object pk="7" model="space.locktype"> 52 <field type="CharField" name="name">Group</field> 53 <field type="SlugField" name="slug">group</field> 54 <field type="TextField" name="description">Room with access administered by the group directly.</field> 55 <field type="CharField" name="info_addr">asa-exec@mit.edu</field> 56 <field type="CharField" name="info_url"></field> 57 <field type="CharField" name="db_update">none</field> 58 </object> 51 59 </django-objects> -
asadb/space/migrations/0006_lock_types_setup.py
re2ceffa r89b3a65 7 7 8 8 9 # W20: mostly cac-card, but some other things 10 # Walker: keys and combos 11 # N52: SEMO 12 # See also discuss[menelaus asa-db 1320] 13 9 14 room_lock_types = ( 10 15 ('W20-454', 'cac-key', ), 11 16 ('W20-401D', 'cac-combo', ), 12 #('W20-415A', 'inner', ), # not in list?17 #('W20-415A', 'inner', ), # APO's press room --- doesn't even have a door 13 18 ('W20-449', 'inner', ), 14 19 ('W20-451A', 'inner', ), … … 17 22 ('W20-481', 'inner', ), 18 23 ('W20-485/A', 'inner', ), 24 25 # 50-XXX offices: see https://diswww.mit.edu/menelaus/asa-db/4606 26 ('50-001', 'cac-combo', ), 27 ('50-020', 'cac-key', ), 28 ('50-023', 'cac-key', ), 29 ('50-024', 'cac-combo', ), 30 ('50-028', 'cac-combo', ), 31 ('50-030', 'group', ), 32 ('50-301', 'group', ), 33 ('50-302', 'cac-combo', ), 34 ('50-303', 'cac-key', ), 35 ('50-304/A', 'cac-combo', ), 36 ('50-306', 'cac-key', ), 37 ('50-309', 'cac-key', ), 38 ('50-316/A', 'cac-key', ), 39 ('50-318', 'cac-key', ), 40 ('50-320', 'cac-combo', ), 41 #('50-352', 'cac-key', ), # no current occupant 42 ('50-354A', 'cac-key', ), 43 ('50-356/A', 'cac-key', ), 44 ('50-357', 'cac-key', ), 45 ('50-358', 'cac-key', ), 46 ('50-360', 'cac-key', ), 19 47 ) 20 21 # Walker: keys and combos: discuss[menelaus asa-db 1320]22 # N52: SEMO23 48 24 49 class Migration(DataMigration): … … 29 54 lock_types = orm['space.LockType'].objects 30 55 spaces = orm['space.Space'].objects 31 spaces.filter(number__startswith='50-').update(lock_type=lock_types.get(slug=' cac-combo'))56 spaces.filter(number__startswith='50-').update(lock_type=lock_types.get(slug='unknown')) 32 57 spaces.filter(number__startswith='N52-').update(lock_type=lock_types.get(slug='semo')) 33 58 for room, lock_type in room_lock_types: 59 print "Setting room=%s's lock_type to %s" % (room, lock_type, ) 34 60 room_obj = spaces.get(number=room) 35 61 room_obj.lock_type = lock_types.get(slug=lock_type)
Note: See TracChangeset
for help on using the changeset viewer.