Ignore:
Timestamp:
Aug 8, 2011, 3:35:40 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
3cad159
Parents:
7f16c8e
git-author:
Alex Dehnert <adehnert@…> (08/08/11 03:35:40)
git-committer:
Alex Dehnert <adehnert@…> (08/08/11 03:35:40)
Message:

Import class/status/funding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/util/import_db.py

    r209218e r6f820e1  
    5050            print ">> Unknown category '%s' on group '%s'" % (cat_name, g.name, )
    5151            pass
     52        class_name = d['GROUP_CLASS']
     53        status_name = d['GROUP_STATUS']
     54        funding_name = d['GROUP_FUNDING_TYPE']
     55        if class_name == 'Standard':
     56            if status_name == 'Provisional':
     57                class_name = 'Unfunded'
     58                status_name = 'Active'
     59            elif status_name == 'Active':
     60                class_name = 'MIT-funded'
     61        g.group_class = groups.models.GroupClass.objects.get(name=class_name)
     62        g.group_status = groups.models.GroupStatus.objects.get(name=status_name)
     63        if funding_name == 'none':
     64            g.group_funding = None
     65        else:
     66            g.group_funding = groups.models.GroupFunding.objects.get(name=funding_name)
    5267        g.website_url       = d['WEBSITE_URL']
    5368        g.constitution_url  = d['CONSTITUTION_WEB_URL']
Note: See TracChangeset for help on using the changeset viewer.