Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eighth): add advanced room creation page
closes #703
- Loading branch information
Showing
7 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
from django import forms | ||
|
||
from ...models import EighthRoom | ||
from ...models import EighthActivity, EighthRoom | ||
from .activities import ActivityMultiDisplayField | ||
|
||
|
||
class RoomForm(forms.ModelForm): | ||
activities = ActivityMultiDisplayField(queryset=None, required=False) | ||
|
||
class Meta: | ||
model = EighthRoom | ||
fields = ["name", "capacity", "available_for_eighth"] | ||
widgets = {"capacity": forms.TextInput(attrs={"size": 4})} | ||
|
||
def __init__(self, *args, label="Activities", **kwargs): # pylint: disable=unused-argument | ||
super().__init__(*args, **kwargs) | ||
self.fields["activities"].queryset = EighthActivity.objects.exclude(deleted=True).all() |
18 changes: 18 additions & 0 deletions
18
intranet/apps/eighth/migrations/0063_auto_20201224_1745.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.13 on 2020-12-24 22:45 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('eighth', '0062_auto_20200116_1926'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='eighthactivity', | ||
name='rooms', | ||
field=models.ManyToManyField(blank=True, related_name='room_activity_set', to='eighth.EighthRoom'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters