Skip to content

Commit 67a1574

Browse files
author
Krystle Salazar
committed
Add models
1 parent a26615a commit 67a1574

File tree

9 files changed

+270
-31
lines changed

9 files changed

+270
-31
lines changed

.cc-metadata.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Whether this GitHub repo is for a CC-led engineering project
22
engineering_project: true
3+
# Name of the repository/project in English
4+
english_name: CC Legal Database
5+
# All technologies used
6+
technologies: Python, Django, Django REST Framework, PostgreSQL
37
# Whether this repository should be featured on the CC Open Source site's "Projects" page
48
featured: false
59
# Slack channel name

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence, they will
33
# be requested for review when someone opens a pull request.
4-
* @creativecommons/internal-tech
4+
* @creativecommons/ct-legal-database-core-committers @creativecommons/internal-tech

Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ flake8 = "*"
1010

1111
[packages]
1212
django = "*"
13+
django-countries = "*"
1314
django-heroku = "*"
1415
gunicorn = "*"
1516
psycopg2 = "*"

Pipfile.lock

+104-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

caselaw/settings.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
2222

2323
# SECURITY WARNING: keep the secret key used in production secret!
24-
SECRET_KEY = os.environ.get(
25-
"DJANGO_SECRET_KEY", "o#-@3p*_2*#jf=cut@f5@3yy*m!*loiuc)7r)%w+nec5dg+ne@"
26-
)
24+
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY")
2725

2826
# SECURITY WARNING: don't run with debug turned on in production!
2927
DEBUG = os.environ.get("DJANGO_DEBUG_ENABLED", default=False)
@@ -35,6 +33,7 @@
3533

3634
INSTALLED_APPS = [
3735
"legal_db.apps.LegalDBConfig",
36+
"django_countries",
3837
"django.contrib.admin",
3938
"django.contrib.auth",
4039
"django.contrib.contenttypes",
@@ -82,7 +81,7 @@
8281
"ENGINE": "django.db.backends.postgresql",
8382
"NAME": os.environ.get("DJANGO_DATABASE_NAME", "postgres"),
8483
"USER": os.environ.get("DJANGO_DATABASE_USER", "postgres"),
85-
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", "secret"),
84+
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD"),
8685
"HOST": os.environ.get("DJANGO_DATABASE_HOST", "127.0.0.1"),
8786
"PORT": os.environ.get("DJANGO_DATABASE_PORT", "5432"),
8887
}

legal_db/admin.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from django.contrib import admin
22

3-
from .models import License
3+
from .models import Case, Scholarship
44

5-
admin.site.register(License)
5+
admin.site.register(Case)
6+
admin.site.register(Scholarship)
7+
admin.site.register(FAQ)

legal_db/migrations/0001_initial.py

+77-16
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,92 @@
1-
# Generated by Django 3.0.6 on 2020-06-01 14:43
1+
# Generated by Django 3.0.7 on 2020-06-03 20:53
22

3+
import django.contrib.postgres.fields
34
from django.db import migrations, models
5+
import django_countries.fields
46

57

68
class Migration(migrations.Migration):
79

810
initial = True
911

10-
dependencies = []
12+
dependencies = [
13+
]
1114

1215
operations = [
1316
migrations.CreateModel(
14-
name="License",
17+
name='Case',
18+
fields=[
19+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20+
('license', models.CharField(blank=True, max_length=25, null=True)),
21+
('license_version', models.CharField(blank=True, max_length=25, null=True)),
22+
('is_ported', models.BooleanField(blank=True, null=True)),
23+
('contributor_name', models.CharField(max_length=120)),
24+
('contributor_email', models.EmailField(max_length=254)),
25+
('contribution_credit', models.BooleanField()),
26+
('link', models.URLField(max_length=2000)),
27+
('country', django_countries.fields.CountryField(max_length=2)),
28+
('summary', models.TextField(blank=True, null=True)),
29+
('notes', models.TextField(blank=True, null=True)),
30+
('publish', models.BooleanField(default=False)),
31+
('created_at', models.DateTimeField(auto_now_add=True)),
32+
('updated_at', models.DateTimeField(auto_now=True)),
33+
('name', models.CharField(blank=True, max_length=200, null=True)),
34+
('case_no', models.CharField(blank=True, max_length=50, null=True)),
35+
('jurisdiction', models.CharField(blank=True, max_length=250, null=True)),
36+
('court_name', models.CharField(max_length=250)),
37+
('decision_district_city_circuit', models.CharField(blank=True, max_length=250, null=True)),
38+
('language', models.CharField(blank=True, max_length=50, null=True)),
39+
('decided_at', models.DateField(blank=True, null=True)),
40+
('en_translation_link', models.URLField(blank=True, max_length=2000, null=True)),
41+
('cc_involvement', models.CharField(blank=True, max_length=100, null=True)),
42+
('cc_implication', models.TextField(blank=True, null=True)),
43+
('work_type', models.CharField(blank=True, max_length=100, null=True)),
44+
('issue', models.CharField(blank=True, max_length=200, null=True)),
45+
('blurb', models.TextField(blank=True, null=True)),
46+
('original_blurb', models.TextField(blank=True, null=True)),
47+
('background', models.TextField(blank=True, null=True)),
48+
('result', models.TextField(blank=True, null=True)),
49+
],
50+
options={
51+
'abstract': False,
52+
},
53+
),
54+
migrations.CreateModel(
55+
name='FAQ',
56+
fields=[
57+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
58+
('question', models.CharField(max_length=250)),
59+
('answer', models.TextField(blank=True, null=True)),
60+
('created_at', models.DateTimeField(auto_now_add=True)),
61+
('updated_at', models.DateTimeField(auto_now=True)),
62+
],
63+
),
64+
migrations.CreateModel(
65+
name='Scholarship',
1566
fields=[
16-
(
17-
"id",
18-
models.AutoField(
19-
auto_created=True,
20-
primary_key=True,
21-
serialize=False,
22-
verbose_name="ID",
23-
),
24-
),
25-
("code", models.CharField(max_length=12)),
26-
("title", models.CharField(max_length=50)),
27-
("version", models.CharField(blank=True, max_length=25, null=True)),
28-
("notes", models.TextField(blank=True, null=True)),
67+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
68+
('license', models.CharField(blank=True, max_length=25, null=True)),
69+
('license_version', models.CharField(blank=True, max_length=25, null=True)),
70+
('is_ported', models.BooleanField(blank=True, null=True)),
71+
('contributor_name', models.CharField(max_length=120)),
72+
('contributor_email', models.EmailField(max_length=254)),
73+
('contribution_credit', models.BooleanField()),
74+
('link', models.URLField(max_length=2000)),
75+
('country', django_countries.fields.CountryField(max_length=2)),
76+
('summary', models.TextField(blank=True, null=True)),
77+
('notes', models.TextField(blank=True, null=True)),
78+
('publish', models.BooleanField(default=False)),
79+
('created_at', models.DateTimeField(auto_now_add=True)),
80+
('updated_at', models.DateTimeField(auto_now=True)),
81+
('title', models.CharField(blank=True, max_length=250, null=True)),
82+
('authors', models.CharField(blank=True, max_length=250, null=True)),
83+
('published_at', models.DateField(blank=True, null=True)),
84+
('elements_discussing', models.CharField(blank=True, max_length=250, null=True)),
85+
('journal_or_publisher', models.CharField(blank=True, max_length=256, null=True)),
86+
('categories', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), blank=True, null=True, size=None)),
2987
],
88+
options={
89+
'abstract': False,
90+
},
3091
),
3192
]

0 commit comments

Comments
 (0)