Created
March 30, 2012 15:17
-
-
Save Alir3z4/2252222 to your computer and use it in GitHub Desktop.
Slugify all the country.printable_name and put them in slug field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def forwards(self, orm): | |
""" | |
Slugify all the country.printable_name and put them in slug field | |
""" | |
from django.template.defaultfilters import slugify | |
for country in orm.Country.objects.all(): | |
country.slug = slugify(country.printable_name) | |
countey.save() | |
def backwards(self, orm): | |
db.delete_column('datacenter_country', 'slug') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment