Add kanban updates and static root

This commit is contained in:
rucki
2026-08-22 16:26:46 +02:00
parent b7b5e19a90
commit 40648d10a1
14 changed files with 220 additions and 59 deletions
+16 -1
View File
@@ -1,6 +1,6 @@
from django import forms
from django.contrib.auth.models import User
from .models import ApiKey, Attachment, Item, UserPreference
from .models import ApiKey, Attachment, Item, Kanban, Tag, UserPreference
class MultipleFileInput(forms.ClearableFileInput):
@@ -71,6 +71,21 @@ class UserPreferenceForm(forms.ModelForm):
widgets = {'overview_lines': forms.NumberInput(attrs={'class': 'form-control', 'min': 1, 'max': 50})}
class KanbanForm(forms.ModelForm):
tag_name = forms.CharField(label='Tag', widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'my2dos'}))
class Meta:
model = Kanban
fields = ['name', 'tag_name']
widgets = {'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Name des Kanbans'})}
def save(self, commit=True):
tag_name = self.cleaned_data['tag_name'].strip().lstrip('#').lower()
tag, _ = Tag.objects.get_or_create(name=tag_name)
self.instance.tag = tag
return super().save(commit=commit)
class ApiKeyForm(forms.ModelForm):
class Meta:
model = ApiKey