Skip to content

Instantly share code, notes, and snippets.

@chrisgemignani
Created December 22, 2008 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisgemignani/39174 to your computer and use it in GitHub Desktop.
Save chrisgemignani/39174 to your computer and use it in GitHub Desktop.
"""
Reduce the size of the store fixture by removing adminareas
"""
from django.config.serializers import yaml
store = yaml.load(open("store.yaml"))
small_store = [itm for itm in store
if not itm['model'] == 'l10n.adminarea' or
(itm['model'] == 'l10n.adminarea' and itm['fields']['country'] == 231)]
s = yaml.dump(small_store)
outf = open('small_store.yaml','w')
outf.write(s)
outf.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment