This file contains 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
from django.contrib.contenttypes.fields import GenericForeignKey | |
from django.contrib.contenttypes.models import ContentType | |
from autofixture import AutoFixture, generators | |
class GenericFKAutoFixture(AutoFixture): | |
""" | |
AutoFixture class that generate instances with ::GenericForeignKey:: that | |
make sense. This is, the ::object_id:: will match an acutal instance of the |
This file contains 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
# Simple environment | |
env.project_name = 'my_project' | |
env.project_path = '/home/user/{project_name}'.format(**env) | |
env.environment = 'dev' # 'dev' || 'prod' | |
env.dump_path = '{project_path}/db'.format(**env) | |
@task | |
def dump(filename=None): | |
"""Generate and download a db dump.""" | |
# ensure remote dump_path exists |
This file contains 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
/mysite | |
| app1/ | |
| models.py | |
| tasks.py | |
| app2/ | |
| models.py | |
| tasks.py | |
| config/ | |
| local.py | |
| development.py |