- Timestamp:
- Jan 22, 2012, 11:03:38 PM (14 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- 8a8ba4c
- Parents:
- 2ca295b
- git-author:
- Alex Dehnert <adehnert@…> (01/22/12 23:03:38)
- git-committer:
- Alex Dehnert <adehnert@…> (01/22/12 23:03:38)
- File:
-
- 1 edited
-
asadb/util/import_db.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/util/import_db.py
r2ca295b ra3b83ea 11 11 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' 12 12 13 from django.db import transaction 13 14 import django.contrib.auth.models 14 15 import reversion … … 84 85 g.save() 85 86 86 if __name__ == '__main__': 87 indb = sys.stdin 88 reader = csv.DictReader(indb) 87 88 @transaction.commit_on_success 89 def import_groups(reader): 89 90 with reversion.create_revision(): 90 91 for line in reader: … … 94 95 reversion.set_user(importer) 95 96 reversion.set_comment("Groups importer") 97 98 99 if __name__ == '__main__': 100 indb = sys.stdin 101 reader = csv.DictReader(indb) 102 import_groups(reader)
Note: See TracChangeset
for help on using the changeset viewer.