Added expert witnesses
This commit is contained in:
parent
ea92c96c22
commit
4f1a22120e
@ -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'
|
||||||
|
1
expert_witnesses/__init__.py
Normal file
1
expert_witnesses/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
default_app_config = 'expert_witnesses.apps.ExpertWitnessesConfig'
|
12
expert_witnesses/admin.py
Normal file
12
expert_witnesses/admin.py
Normal 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
6
expert_witnesses/apps.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ExpertWitnessesConfig(AppConfig):
|
||||||
|
name = 'expert_witnesses'
|
||||||
|
verbose_name = 'Expert Witnesses'
|
24
expert_witnesses/models.py
Normal file
24
expert_witnesses/models.py
Normal 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
|
3
expert_witnesses/tests.py
Normal file
3
expert_witnesses/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
3
expert_witnesses/views.py
Normal file
3
expert_witnesses/views.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
Loading…
Reference in New Issue
Block a user