Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 10 files changed
  • 0 comments
  • 1 contributor
Oct 15, 2011
beatpanda@gmail.com ignore 416b39e
beatpanda@gmail.com finished incident report model a1ff1a8
38 .gitignore
... ... @@ -0,0 +1,38 @@
  1 +db
  2 +db/*
  3 +*.db
  4 +*.pyc
  5 +*.swp
  6 +*.swk
  7 +*.out
  8 +pip-log.txt
  9 +local_settings.py
  10 +screenlog*
  11 +data/
  12 +tmp/
  13 +src/
  14 +*~
  15 +._*
  16 +.settings/org.eclipse.core.resources.prefs
  17 +dcdata/entities/apidata/
  18 +dcdata/test_data/denormalized/denorm_indivs.08.csv
  19 +dcdata/test_data/denormalized/denorm_indivs.08.txt
  20 +dcdata/test_data/denormalized/denorm_pac2cand.csv
  21 +dcdata/test_data/denormalized/denorm_pac2cand.txt
  22 +dcdata/test_data/denormalized/denorm_pac2pac.csv
  23 +dcdata/test_data/denormalized/denorm_pac2pac.txt
  24 +dcdata/test_data/denormalized/nimsp_allocated_contributions.csv
  25 +dcdata/test_data/denormalized/nimsp_unallocated_contributions.csv.TMP
  26 +dcdata/test_data/denormalized/nimsp_unallocated_contributions_salted.csv
  27 +dcdata/test_data/denormalized/nimsp_unallocated_contributions_unsalted.csv
  28 +dc_web/build
  29 +.project
  30 +.pydevproject
  31 +PYSMELLTAGS
  32 +.DS_Store
  33 +nationwide_candidates.pkl
  34 +.coverage
  35 +postgresql.conf.*
  36 +pgexperts.conf.*
  37 +sysctl.conf.*
  38 +migrations
0  README 100644 → 100755
File mode changed
0  __init__.py 100644 → 100755
File mode changed
0  incident_report/__init__.py
No changes.
60 incident_report/models.py
... ... @@ -0,0 +1,60 @@
  1 +from django.db import models
  2 +from django.contrib.localflavor.us.models import USStateField, PhoneNumberField
  3 +
  4 +class Person(models.Model):
  5 + name = models.CharField(max_length=256)
  6 + withhold = models.BooleanField()
  7 + class Meta:
  8 + abstract = True
  9 +
  10 +class Cop(Person):
  11 + badge_num = models.CharField(max_length=128, blank=True, null=True)
  12 + cert_num = models.CharField(max_length=128, blank=True, null=True)
  13 + license_num = models.CharField(max_length=10)
  14 + agency = models.ForeignKey('Agency')
  15 +
  16 +class Witness(Person):
  17 + contact_phone = PhoneNumberField()
  18 + contact_email = models.EmailField()
  19 + contact_other = models.TextField()
  20 + statement = models.TextField()
  21 +
  22 +class Victim(Person):
  23 + arrested = models.BooleanField()
  24 + complaint = models.BooleanField()
  25 + lawyer = models.BooleanField()
  26 + charge = models.CharField(max_length=128)
  27 + injuries = models.TextField()
  28 + contact_phone = PhoneNumberField()
  29 + contact_email = models.EmailField()
  30 + contact_other = models.TextField()
  31 +
  32 +class Agency(models.Model):
  33 + """Agencies will be presented as a dropdown and shouldn't be editable from the user-facing side"""
  34 + state = USStateField()
  35 + name = models.CharField(max_length=256)
  36 + jurisdiction = models.CharField(max_length=256)
  37 +
  38 +class Evidence(models.Model):
  39 + title = models.CharField(max_length=128, blank=True, null=True)
  40 + photo = models.ImageField(upload_to="evidence")
  41 + vid_link = models.URLField()
  42 + incident = models.ForeignKey('Incident')
  43 + private = models.BooleanField()
  44 +
  45 +
  46 +class Incident(models.Model):
  47 + date = models.DateField()
  48 + time = models.TimeField()
  49 + filed = models.DateTimeField(auto_now=True,auto_now_add=True)
  50 + loc_lat = models.FloatField()
  51 + loc_lon = models.FloatField()
  52 + loc_text = models.CharField(max_length=128, blank=True, null=True)
  53 + loc_state = models.CharField(max_length=128, blank=True, null=True)
  54 + loc_city = models.CharField(max_length=128, blank=True, null=True)
  55 + cop = models.ManyToManyField('Cop')
  56 + witness = models.ManyToManyField('Witness')
  57 + victim = models.ManyToManyField('Victim')
  58 + nature = models.CharField(max_length=128, blank=True, null=True)
  59 + private = models.BooleanField()
  60 +# Create your models here.
16 incident_report/tests.py
... ... @@ -0,0 +1,16 @@
  1 +"""
  2 +This file demonstrates writing tests using the unittest module. These will pass
  3 +when you run "manage.py test".
  4 +
  5 +Replace this with more appropriate tests for your application.
  6 +"""
  7 +
  8 +from django.test import TestCase
  9 +
  10 +
  11 +class SimpleTest(TestCase):
  12 + def test_basic_addition(self):
  13 + """
  14 + Tests that 1 + 1 always equals 2.
  15 + """
  16 + self.assertEqual(1 + 1, 2)
1  incident_report/views.py
... ... @@ -0,0 +1 @@
  1 +# Create your views here.
0  manage.py 100644 → 100755
File mode changed
8 settings.py 100644 → 100755
@@ -11,8 +11,8 @@
11 11
12 12 DATABASES = {
13 13 'default': {
14   - 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
15   - 'NAME': '', # Or path to database file if using sqlite3.
  14 + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  15 + 'NAME': 'db/copwatch.sql', # Or path to database file if using sqlite3.
16 16 'USER': '', # Not used with sqlite3.
17 17 'PASSWORD': '', # Not used with sqlite3.
18 18 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
@@ -27,7 +27,7 @@
27 27 # timezone as the operating system.
28 28 # If running in a Windows environment this must be set to the same as your
29 29 # system time zone.
30   -TIME_ZONE = 'America/Chicago'
  30 +TIME_ZONE = 'America/Los_Angeles'
31 31
32 32 # Language code for this installation. All choices can be found here:
33 33 # http://www.i18nguy.com/unicode/language-identifiers.html
@@ -115,6 +115,8 @@
115 115 'django.contrib.sites',
116 116 'django.contrib.messages',
117 117 'django.contrib.staticfiles',
  118 + 'south',
  119 + 'incident_report',
118 120 # Uncomment the next line to enable the admin:
119 121 # 'django.contrib.admin',
120 122 # Uncomment the next line to enable admin documentation:
0  urls.py 100644 → 100755
File mode changed

No commit comments for this range

Something went wrong with that request. Please try again.