From 1c3509f17c4280c346587070b4a81647634de5df Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 18 Nov 2023 19:05:53 -0500 Subject: gtd: fixed a bug adding wirednotes and rearranged top menu --- app/gtd/forms.py | 17 ----------------- app/gtd/urls.py | 2 +- app/gtd/views.py | 10 +++++++--- templates/base_gtd.html | 9 ++++----- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/app/gtd/forms.py b/app/gtd/forms.py index 595611b..3e93a02 100644 --- a/app/gtd/forms.py +++ b/app/gtd/forms.py @@ -27,23 +27,6 @@ class GTDProjectUpdateForm(ModelForm): fields = ['title', 'body_markdown', 'date_goal', 'project_type', 'outcome', 'date_ended'] -class WiredNoteCreateForm(ModelForm): - - def __init__(self, *args, **kwargs): - user = kwargs.pop('user') - self.user = user - super(WiredNoteCreateForm, self).__init__(*args, **kwargs) - self.fields['post'].required = False - - def save(self, commit=True): - self.instance.user = self.user - return super().save(commit=commit) - - class Meta: - model = WiredNote - fields = ['title', 'url', 'body_markdown', 'post'] - - class WiredNoteEditForm(ModelForm): def __init__(self, *args, **kwargs): diff --git a/app/gtd/urls.py b/app/gtd/urls.py index a56bbf4..c47e968 100644 --- a/app/gtd/urls.py +++ b/app/gtd/urls.py @@ -8,7 +8,7 @@ urlpatterns = [ path( r'todo', views.GTDNoteTODOView.as_view(), - name="note-todo" + name="todo-list" ), path( r'notes', diff --git a/app/gtd/views.py b/app/gtd/views.py index db014b1..bb11030 100644 --- a/app/gtd/views.py +++ b/app/gtd/views.py @@ -8,7 +8,6 @@ from .forms import ( GTDNoteEditForm, GTDProjectCreateForm, GTDProjectUpdateForm, - WiredNoteCreateForm, WiredNoteEditForm, WiredPostUpdateForm ) @@ -46,7 +45,6 @@ class GTDNoteUpdateView(UpdateView): return reverse('gtd:note-list', kwargs={"pk": self.object.project.pk}) - class GTDNoteListView(ListView): model = GTDNote template_name = "gtd/note_list.html" @@ -78,8 +76,14 @@ class GTDNoteTODOView(ListView): template_name = "gtd/note_list.html" def get_queryset(self): + # need to get wired notes and gtd notes and blend them by + # date created maybe? return GTDNote.objects.filter(status=1) + def get_context_data(self, **kwargs): + context = super(GTDNoteTODOView, self).get_context_data(**kwargs) + return context + class GTDProjectCreateView(CreateView): model = GTDProject @@ -139,7 +143,7 @@ class GTDProjectDeleteView(DeleteView): class WiredNoteCreateView(CreateView): model = WiredNote - form_class = WiredNoteCreateForm + fields = ['title', 'url', 'body_markdown', 'post'] template_name = "gtd/wirednote_form.html" def get_success_url(self): diff --git a/templates/base_gtd.html b/templates/base_gtd.html index d429828..96dab38 100644 --- a/templates/base_gtd.html +++ b/templates/base_gtd.html @@ -20,13 +20,12 @@ L {% block breadcrumbs %}{% endblock %} -- cgit v1.2.3-70-g09d2