misc
This commit is contained in:
parent
39e81d5727
commit
ff92a221f1
|
@ -36,6 +36,10 @@ class Country(models.Model):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
class LegislationBook(models.Model):
|
class LegislationBook(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Book"
|
||||||
|
verbose_name_plural = "Books"
|
||||||
|
|
||||||
class ConferenceType(models.TextChoices):
|
class ConferenceType(models.TextChoices):
|
||||||
MIDDLE = "M", _("Middle School")
|
MIDDLE = "M", _("Middle School")
|
||||||
HIGH = "H", _("High School")
|
HIGH = "H", _("High School")
|
||||||
|
@ -88,6 +92,10 @@ class LegislationBook(models.Model):
|
||||||
return "{}".format(self.name)
|
return "{}".format(self.name)
|
||||||
|
|
||||||
class LegislativeText(models.Model):
|
class LegislativeText(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Legislation"
|
||||||
|
verbose_name_plural = "Legislation"
|
||||||
|
|
||||||
class Assemblies(models.TextChoices):
|
class Assemblies(models.TextChoices):
|
||||||
RGA = "RGA", _("Red General Assembly")
|
RGA = "RGA", _("Red General Assembly")
|
||||||
BGA = "BGA", _("Blue General Assembly")
|
BGA = "BGA", _("Blue General Assembly")
|
||||||
|
@ -112,7 +120,7 @@ class LegislativeText(models.Model):
|
||||||
committee = models.IntegerField()
|
committee = models.IntegerField()
|
||||||
category = models.CharField(max_length=256)
|
category = models.CharField(max_length=256)
|
||||||
docket_order = models.IntegerField()
|
docket_order = models.IntegerField()
|
||||||
school = models.ForeignKey(School, on_delete=models.SET_NULL, null=True)
|
school = models.ForeignKey(School, on_delete=models.CASCADE)
|
||||||
sponsors = models.CharField(max_length=256)
|
sponsors = models.CharField(max_length=256)
|
||||||
from_book = models.ForeignKey(LegislationBook, on_delete=models.CASCADE)
|
from_book = models.ForeignKey(LegislationBook, on_delete=models.CASCADE)
|
||||||
legislation_title = models.CharField(max_length=512)
|
legislation_title = models.CharField(max_length=512)
|
||||||
|
@ -150,6 +158,10 @@ class LegislativeText(models.Model):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
class LegislationClassification(models.Model):
|
class LegislationClassification(models.Model):
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Classification"
|
||||||
|
verbose_name_plural = "Classifications"
|
||||||
|
|
||||||
name = models.CharField(max_length=256, help_text="Name of this classification.")
|
name = models.CharField(max_length=256, help_text="Name of this classification.")
|
||||||
text_to_match = models.CharField(
|
text_to_match = models.CharField(
|
||||||
max_length=256,
|
max_length=256,
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
{% extends "explorer/base.html" %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
|
|
||||||
<div class="boxed">
|
|
||||||
<h1>All bills by {{ school_name }}</h1>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{% for text in legislation %}
|
|
||||||
<li><a href="/explorer/legislation/{{ text.id }}">{{ text.legislation_title }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
|
@ -81,12 +81,11 @@ def get_all_classified_by_id(request, classification_id):
|
||||||
"result_name": "All legislation in topic {}".format(classification.name)
|
"result_name": "All legislation in topic {}".format(classification.name)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def get_all_by_school(request, school_id):
|
def get_all_by_school(request, school_id):
|
||||||
school = get_object_or_404(School, pk=school_id)
|
school = get_object_or_404(School, pk=school_id)
|
||||||
|
|
||||||
return render(request, "explorer/school.html", {
|
return render(request, "explorer/results.html", {
|
||||||
"school_name": school.name,
|
"result_name": "All legislation by {}".format(school.name),
|
||||||
"legislation": school.legislativetext_set.all()
|
"legislation": school.legislativetext_set.all()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -94,6 +93,6 @@ def get_all_by_country(request, country_id):
|
||||||
country = get_object_or_404(Country, pk=country_id)
|
country = get_object_or_404(Country, pk=country_id)
|
||||||
|
|
||||||
return render(request, "explorer/results.html", {
|
return render(request, "explorer/results.html", {
|
||||||
"result_name": "All bills by country {}".format(country.name),
|
"result_name": "All legislation by country {}".format(country.name),
|
||||||
"legislation": country.legislativetext_set.all()
|
"legislation": country.legislativetext_set.all()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue