From eed4fea25589fd25b4c7e4988cda1bcc9ebab598 Mon Sep 17 00:00:00 2001
From: substantialnoninfringinguser
Date: Wed, 10 Jun 2009 05:37:53 +0100
Subject: [svn] Fixed a bug with QMs with numbers between 1 and 10, and fixed
the links in the recent changes box.
---
expo/forms.py | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
(limited to 'expo/forms.py')
diff --git a/expo/forms.py b/expo/forms.py
index 9573c18..929c4e9 100644
--- a/expo/forms.py
+++ b/expo/forms.py
@@ -4,6 +4,7 @@ import django.forms as forms
from django.forms.formsets import formset_factory
from django.contrib.admin.widgets import AdminDateWidget
import string
+from datetime import date
class CaveForm(ModelForm):
class Meta:
@@ -18,6 +19,13 @@ class LogbookEntryForm(ModelForm):
model = LogbookEntry
def wikiLinkHints(LogbookEntry=None):
+ """
+ This function returns html-formatted paragraphs for each of the
+ wikilink types that are related to this logbookentry. Each paragraph
+ contains a list of all of the related wikilinks.
+
+ Perhaps an admin javascript solution would be better.
+ """
res = ["Please use the following wikilinks, which are related to this logbook entry:"]
res.append(r'
QMs found:')
@@ -37,15 +45,4 @@ class LogbookEntryForm(ModelForm):
def __init__(self, *args, **kwargs):
super(LogbookEntryForm, self).__init__(*args, **kwargs)
- self.fields['text'].help_text=self.wikiLinkHints()
-
-class QMsFoundInlineForm(ModelForm):
- class Meta:
- model = QM
- exclude = 'ticked_off_by'
-
- def __init__(self, *args, **kwargs):
- super(QMsFoundInlineForm, self).__init__(*args, **kwargs)
- #self.fields['number'].initial=nextQMinyear()#work on that one
-
-
\ No newline at end of file
+ self.fields['text'].help_text=self.wikiLinkHints()
\ No newline at end of file
--
cgit v1.2.3