create subpages
This commit is contained in:
parent
dc0440fcef
commit
aac1cdb118
9 changed files with 184 additions and 3 deletions
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib import admin
|
||||
from .models import PublicBody, Party, Member, Question, Answer
|
||||
from .models import PublicBody, Party, Member, Question, Answer, Vote
|
||||
|
||||
|
||||
@admin.register(PublicBody)
|
||||
|
|
@ -33,4 +33,11 @@ class QuestionAdmin(admin.ModelAdmin):
|
|||
class AnswerAdmin(admin.ModelAdmin):
|
||||
list_display = ("question", "answered_by", "created_at")
|
||||
list_filter = ("answered_by",)
|
||||
search_fields = ("body",)
|
||||
search_fields = ("body",)
|
||||
|
||||
|
||||
@admin.register(Vote)
|
||||
class VoteAdmin(admin.ModelAdmin):
|
||||
list_display = ("title", "public_body", "date")
|
||||
list_filter = ("public_body", "date")
|
||||
search_fields = ("title", "description")
|
||||
31
council/migrations/0002_vote.py
Normal file
31
council/migrations/0002_vote.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Generated by Django 4.2.23 on 2025-08-21 07:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('council', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Vote',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('date', models.DateField(blank=True, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('members', models.ManyToManyField(blank=True, related_name='votes', to='council.member')),
|
||||
('public_body', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='council.publicbody')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Abstimmung',
|
||||
'verbose_name_plural': 'Abstimmungen',
|
||||
'ordering': ['-date', '-created_at'],
|
||||
},
|
||||
),
|
||||
]
|
||||
BIN
council/migrations/__pycache__/0002_vote.cpython-312.pyc
Normal file
BIN
council/migrations/__pycache__/0002_vote.cpython-312.pyc
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue