Added case law
This commit is contained in:
parent
d48ab05462
commit
ea92c96c22
@ -32,6 +32,7 @@ ALLOWED_HOSTS = ['*']
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'bootstrap_admin',
|
||||
'case_law',
|
||||
'charter_members.apps.CharterMembersConfig',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
|
1
case_law/__init__.py
Normal file
1
case_law/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
default_app_config = 'case_law.apps.CaseLawConfig'
|
12
case_law/admin.py
Normal file
12
case_law/admin.py
Normal file
@ -0,0 +1,12 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from case_law.models import Decision, Subtitle
|
||||
|
||||
admin.site.register(Subtitle)
|
||||
|
||||
|
||||
@admin.register(Decision)
|
||||
class DecisionAdmin(admin.ModelAdmin):
|
||||
fields = ['synopsis', 'headers', 'date', 'pdf']
|
||||
filter_horizontal = ['headers']
|
||||
list_display = ['synopsis', 'date']
|
6
case_law/apps.py
Normal file
6
case_law/apps.py
Normal file
@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CaseLawConfig(AppConfig):
|
||||
name = 'case_law'
|
||||
verbose_name = "Case Law"
|
18
case_law/models.py
Normal file
18
case_law/models.py
Normal file
@ -0,0 +1,18 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Subtitle(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Decision(models.Model):
|
||||
date = models.DateField()
|
||||
headers = models.ManyToManyField(Subtitle)
|
||||
pdf = models.FileField(upload_to='secure')
|
||||
synopsis = models.TextField()
|
||||
|
||||
def __str__(self):
|
||||
return self.synopsis
|
3
case_law/tests.py
Normal file
3
case_law/tests.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
3
case_law/views.py
Normal file
3
case_law/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