diff --git a/.gitignore b/.gitignore index d8cb58c2a7..ba5b0591d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ lib/settings.py +env/* *.py[c,o] *.swp diff --git a/Makefile b/Makefile index 49453dc830..2d98d87b23 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,15 @@ clean: rebase: git pull --rebase origin master +push: + git push + zero: + # go back to original database state, be careful! python manage.py migrate main zero setup: + # use ansible to ansible ansible commander locally ansible-playbook app_setup/setup.yml --verbose -i "127.0.0.1," -c local -e working_dir=`pwd` syncdb: @@ -20,8 +25,8 @@ runserver: # already done and should not have to happen again: # -south_init: - python manage.py schemamigration main --initial +#south_init: +# python manage.py schemamigration main --initial dbchange: # run this each time we make changes to the model diff --git a/app_setup/setup.yml b/app_setup/setup.yml index 38d1733431..192af80fd9 100644 --- a/app_setup/setup.yml +++ b/app_setup/setup.yml @@ -6,25 +6,22 @@ # TODO: setup celery and any worker processes/requirements - hosts: 127.0.0.1 - gather_facts: True + gather_facts: False user: root vars_files: - vars/vars.yml tasks: - + - name: install packages action: yum name=$item state=installed - with_items: - - postgresql # database client - - postgresql-server # database server - - Django # web stack - - Django-south # migration support - - python-django-tastypie # rest support - - python-psycopg2 + with_name: + - postgresql # database client + - postgresql-server # database server + - python-psycopg2 # database library - # the following could probably be included, though ident identification is fiddly - # so we won't use it to create the database and database user + - name: install python modules + pip: requirements=${working_dir}/requirements.txt - name: configure the database authentication more or less open for setup template: src=templates/pg_hba_low.j2 dest=/var/lib/pgsql/data/pg_hba.conf @@ -52,9 +49,6 @@ - name: configure python settings (with database password) template: src=templates/settings.py.j2 dest=${working_dir}/lib/settings.py - #- name: sync Django database - # shell: python ${working_dir}/manage.py syncdb - - name: sync django database django_manage: > command=syncdb diff --git a/lib/main/models/__init__.py b/lib/main/models/__init__.py index d583f02104..65a0349468 100644 --- a/lib/main/models/__init__.py +++ b/lib/main/models/__init__.py @@ -6,8 +6,8 @@ from django.db import models # TODO: audit cascade behavior and defaults # TODO: set related names -# SET_NULL = models.SET_NULL -# PROTECT = models.PROTECT +SET_NULL = models.SET_NULL +PROTECT = models.PROTECT class CommonModel(models.Model): '''