Skip to content

Commit

Permalink
added new field 'last_edited' to class CourtDecision
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Nov 10, 2023
1 parent 8f06422 commit 07b13e6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions archiv/fixtures/dump.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions archiv/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ class Meta:
"year_book_title": autocomplete.ModelSelect2(
url="archiv-ac:yearbook-autocomplete"
),
"partial_legal_system": autocomplete.ModelSelect2(
url="archiv-ac:partiallegalsystem-autocomplete"
),
"court": autocomplete.ModelSelect2(
url="archiv-ac:court-autocomplete"
),
}

def __init__(self, *args, **kwargs):
Expand Down
17 changes: 17 additions & 0 deletions archiv/migrations/0013_courtdecission_modified_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.4 on 2023-11-10 10:13

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("archiv", "0012_alter_court_options_alter_courtdecission_options_and_more"),
]

operations = [
migrations.AddField(
model_name="courtdecission",
name="modified_date",
field=models.DateTimeField(auto_now=True),
),
]
1 change: 1 addition & 0 deletions archiv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ class CourtDecission(models.Model):
help_text="Fulltext field (technical field)",
)
vector_column = SearchVectorField(null=True)
modified_date = models.DateTimeField(auto_now=True)

class Meta:
ordering = [
Expand Down
1 change: 1 addition & 0 deletions archiv/templates/archiv/courtdecission_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ <h2>Authors</h2>
{% for x in object.author.all %}
<p>{{ x }} <a href="{{ x.get_absolute_url }}"><i class="bi bi-link-45deg"></i></a></p>
{% endfor %}
<small>updated: {{ object.modified_date }}</small>
</div>
</div>
</div>
Expand Down

0 comments on commit 07b13e6

Please sign in to comment.