Commits

Luke Plant committed 605eec7 Merge

Merged from default

Comments (0)

Files changed (6)

cciw/bookings/admin.py

     def camp(obj):
         return "%s-%s" % (obj.camp.year, obj.camp.number)
     camp.admin_order_field = 'camp__year'
-    list_display = ['first_name', 'last_name', 'sex', 'account', camp, 'state', 'confirmed_booking']
+    list_display = ['first_name', 'last_name', 'sex', 'account', camp, 'state', 'confirmed_booking', 'created']
     del camp
     search_fields = ['first_name', 'last_name']
     ordering = ['-camp__year', 'camp__number']

cciw/bookings/anonymizers.py

     model = BookingAccount
 
     attributes = [
-        # Skipping field id
+        ('id', "SKIP"),
         ('email', "email"),
         ('name', "name"),
         ('address', "full_address"),
         ('post_code', "uk_postcode"),
         ('phone_number', "phonenumber"),
         ('share_phone_number', "bool"),
-        #('total_received', "decimal"),
-        #('first_login', "datetime"),
-        #('last_login', "datetime"),
+        ('total_received', "SKIP"),
+        ('first_login', "datetime"),
+        ('last_login', "SKIP"),
+        ('email_communication', "SKIP")
     ]
 
 
     model = Booking
 
     attributes = [
-         # Skipping field id
-         # Skipping field account_id
-         # Skipping field camp_id
+        ('id', "SKIP"),
+        ('camp_id', "SKIP"),
+        ('account_id', "SKIP"),
         ('first_name', "first_name"),
         ('last_name', "last_name"),
         ('sex', "choice"),
         ('phone_number', "phonenumber"),
         ('email', "email"),
         ('church', "similar_lorem"),
-        #('south_wales_transport', "bool"),
-        ('contact_address', "address"),
-        ('contact_post_code', "post_code"),
+        ('south_wales_transport', "SKIP"),
+        ('contact_address', "full_address"),
+        ('contact_post_code', "uk_postcode"),
         ('contact_phone_number', "phonenumber"),
         ('dietary_requirements', "similar_lorem"),
         ('gp_name', "name"),
         ('illnesses', "similar_lorem"),
         ('learning_difficulties', "similar_lorem"),
         ('serious_illness', "bool"),
-        #('agreement', "bool"),
-        #('price_type', "choice"),
-        #('amount_due', "decimal"),
-        #('shelved', "bool"),
-        #('state', "choice"),
-        #('created', "datetime"),
-        #('booking_expires', "datetime"),
+        ('agreement', "SKIP"),
+        ('price_type', "SKIP"),
+        ('amount_due', "SKIP"),
+        ('shelved', "SKIP"),
+        ('state', "SKIP"),
+        ('created', "SKIP"),
+        ('booking_expires', "SKIP"),
     ]
 

cciw/officers/anonymizers.py

     model = User
 
     attributes = [
+        ('id', "SKIP"),
         ('username',   'username'),
         ('first_name', 'first_name'),
         ('last_name',  'last_name'),
         ('date_joined', 'similar_datetime'),
         # Set to today:
         ('last_login', lambda *args: datetime.now()),
+        ('is_superuser', "SKIP"),
+        ('password', "SKIP"),
+        ('is_staff', "SKIP"),
+        ('is_active', "SKIP")
     ]
 
     def alter_object(self, obj):
     model = Application
 
     attributes = [
-        # 'full_name' and 'full_maiden_name' - see below
+        ('id', "SKIP"),
+        ('officer_id', "SKIP"),
+        ('full_name', "SKIP"), # see below
+        ('full_maiden_name', "SKIP"),
         ('birth_date', "date"),
         ('birth_place', "city"),
         ('address_firstline', "street_address"),
         ('concern_details', "lorem"),
         ('allegation_declaration', "bool"),
         ('crb_check_consent', "bool"),
-        # 'finished', "bool", - leave as is
-        # ('date_submitted', "date"), - leave as is
+        ('finished', "SKIP"),
+        ('date_submitted', "SKIP"),
     ]
 
     order = 2
     model = ReferenceForm
 
     attributes = [
+        ('id', "SKIP"),
+        ('reference_info_id', "SKIP"),
         ('referee_name', "name"),
         ('how_long_known', "varchar"),
         ('capacity_known', "similar_lorem"),
         ('character', "similar_lorem"),
         ('concerns', "lorem"),
         ('comments', "similar_lorem"),
-        # 'date_created': "date",
+        ('date_created', "SKIP"),
     ]
 if DEVBOX and DEBUG:
     INSTALLED_APPS += (
         'django.contrib.admindocs',
-        'output_validator',
         'debug_toolbar',
     )
 
     (LIVEBOX,    "cciw.middleware.http.WebFactionFixes"),
     (True,       "django.middleware.gzip.GZipMiddleware"),
     (DEVBOX,     "debug_toolbar.middleware.DebugToolbarMiddleware"),
-    (DEVBOX,     "output_validator.middleware.ValidatorMiddleware"),
     (True,       'django.middleware.csrf.CsrfViewMiddleware'),
     (True,       'django.middleware.clickjacking.XFrameOptionsMiddleware'),
     (True,       "django.contrib.sessions.middleware.SessionMiddleware"),
 if settings.DEVBOX:
     from django.contrib.staticfiles.urls import staticfiles_urlpatterns
     urlpatterns += patterns('',
-                            (r'^validator/', include('output_validator.urls')),
                             (r'^admin_doc/', include('django.contrib.admindocs.urls')),
                             (r'^usermedia/(?P<path>.*)$', 'django.views.static.serve',
                              {'document_root': settings.MEDIA_ROOT}),
 from collections import namedtuple
 from datetime import datetime
-from fabric.api import run, local, abort, env, put
+from fabric.api import run, local, abort, env, put, get
 from fabric.contrib import files
 from fabric.contrib import console
 from fabric.decorators import hosts, runs_once
     def __init__(self, django_app='', dbname=''):
         self.django_app = django_app
         self.dbname = dbname
+        self.dbuser = dbname
 
         self.webapp_root = join(webapps_root, self.django_app)
         # src_root - the root of all sources on this target.
 # TODO:
 #  - backup db task. This should be run only in production, and copies
 #    files to Amazon S3 service.
+
+def get_live_db():
+    filename = "dump_%s.db" % PRODUCTION.dbname
+    run("pg_dump -Fc -U %s -O -o -f ~/%s %s" % (PRODUCTION.dbuser, filename, PRODUCTION.dbname))
+    get("~/%s" % filename)
+
+def local_restore_from_dump(filename):
+    local("pg_restore -O -U cciw -c -d cciw < %s" % filename)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.