Changeset 2513
- Timestamp:
- 01/29/10 08:58:23 (6 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/pylucid_project/apps/pylucid_admin/management/commands/create_initialdata.py
r2345 r2513 6 6 The serialized data must be sorted by topology. 7 7 Otherwise the dump can't insert back into the database. 8 9 TODO: add FIXTURE_FILENAME and FIXTURE_PATH to BaseCommand.option_list 8 10 """ 9 11 import os 12 import codecs 10 13 import pprint 11 14 from optparse import make_option … … 48 51 ] 49 52 50 FIXTURE_FILENAME = " initial_data.json"53 FIXTURE_FILENAME = "pylucid.json" 51 54 52 55 FIXTURE_PATH = os.path.join(settings.PYLUCID_PROJECT_ROOT, "apps", "pylucid_admin", "fixtures") … … 130 133 print "Serialize data and save it into %r..." % FIXTURE_FILENAME 131 134 try: 132 with open(file_path, "w") as out:135 with codecs.open(file_path, "w", encoding="utf-8") as out: 133 136 json_serializer.serialize(objects, indent=options['indent'], stream=out, 134 137 ensure_ascii=False # http://docs.djangoproject.com/en/dev/topics/serialization/#notes-for-specific-serialization-formats