Added expert witnesses

This commit is contained in:
Zak Timson 2017-09-05 02:24:39 -04:00
parent ea92c96c22
commit 4f1a22120e
7 changed files with 50 additions and 0 deletions

View File

@ -40,6 +40,7 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'expert_witnesses',
'forum.apps.ForumConfig', 'forum.apps.ForumConfig',
'main.apps.MainConfig', 'main.apps.MainConfig',
'newsletters.apps.NewslettersConfig' 'newsletters.apps.NewslettersConfig'

View File

@ -0,0 +1 @@
default_app_config = 'expert_witnesses.apps.ExpertWitnessesConfig'

12
expert_witnesses/admin.py Normal file
View File

@ -0,0 +1,12 @@
from django.contrib import admin
from .models import Expert, AreaOfExpertise
admin.site.register(AreaOfExpertise)
@admin.register(Expert)
class ExpertiseAdmin(admin.ModelAdmin):
fields = ['name', 'institute', 'expertise', 'cases']
filter_horizontal = ('expertise', 'cases')

6
expert_witnesses/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ExpertWitnessesConfig(AppConfig):
name = 'expert_witnesses'
verbose_name = 'Expert Witnesses'

View File

@ -0,0 +1,24 @@
from django.db import models
from case_law.models import Decision
class AreaOfExpertise(models.Model):
class Meta:
verbose_name = 'Area of Expertise'
verbose_name_plural = 'Area of Expertise'
field = models.CharField(max_length=255)
def __str__(self):
return self.field
class Expert(models.Model):
cases = models.ManyToManyField(Decision, null=True, blank=True)
expertise = models.ManyToManyField(AreaOfExpertise)
institute = models.CharField(max_length=255, null=True, blank=True)
name = models.CharField(max_length=255)
def __str__(self):
return self.name

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.