Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

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

No commit comments for this range

Something went wrong with that request. Please try again.