Changeset 89b3a65


Ignore:
Timestamp:
Mar 6, 2013, 8:08:17 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
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)
Message:

Correct Walker room access

Location:
asadb/space
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/space/fixtures/LockTypes.xml

    r8aea837 r89b3a65  
    4949        <field type="CharField" name="db_update">none</field>
    5050    </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>
    5159</django-objects>
  • asadb/space/migrations/0006_lock_types_setup.py

    re2ceffa r89b3a65  
    77
    88
     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
    914room_lock_types = (
    1015    ('W20-454',     'cac-key', ),
    1116    ('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
    1318    ('W20-449',     'inner', ),
    1419    ('W20-451A',    'inner', ),
     
    1722    ('W20-481',     'inner', ),
    1823    ('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', ),
    1947)
    20 
    21 # Walker: keys and combos: discuss[menelaus asa-db 1320]
    22 # N52: SEMO
    2348
    2449class Migration(DataMigration):
     
    2954        lock_types = orm['space.LockType'].objects
    3055        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'))
    3257        spaces.filter(number__startswith='N52-').update(lock_type=lock_types.get(slug='semo'))
    3358        for room, lock_type in room_lock_types:
     59            print "Setting room=%s's lock_type to %s" % (room, lock_type, )
    3460            room_obj = spaces.get(number=room)
    3561            room_obj.lock_type = lock_types.get(slug=lock_type)
Note: See TracChangeset for help on using the changeset viewer.