diff options
author | Martin Green <martin.speleo@gmail.com> | 2011-07-10 23:57:31 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2011-07-10 23:57:31 +0100 |
commit | 5075ded032150872641bc51afa34696a4c8370eb (patch) | |
tree | f90c02dd4eeb8556450f19ae1f4bbf0d595efbd7 | |
parent | 47c2e87979baaac3be641f3f607f644c7d6b0894 (diff) | |
download | troggle-5075ded032150872641bc51afa34696a4c8370eb.tar.gz troggle-5075ded032150872641bc51afa34696a4c8370eb.tar.bz2 troggle-5075ded032150872641bc51afa34696a4c8370eb.zip |
Removed modelforms for Caves started to add normal forms
-rw-r--r-- | core/forms.py | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/core/forms.py b/core/forms.py index 2a54428..ec639b0 100644 --- a/core/forms.py +++ b/core/forms.py @@ -7,46 +7,49 @@ import string from datetime import date
from tinymce.widgets import TinyMCE
-class CaveForm(ModelForm):
- class Meta:
- model = Cave
-
-class PersonForm(ModelForm):
- class Meta:
- model = Person
-
-class LogbookEntryForm(ModelForm):
- class Meta:
- 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'</p><p style="float: left;"><b>QMs found:</b>')
- for QM in LogbookEntry.instance.QMs_found.all():
- res.append(QM.wiki_link())
-
- res.append(r'</p><p style="float: left;"><b>QMs ticked off:</b>')
- for QM in LogbookEntry.instance.QMs_ticked_off.all():
- res.append(QM.wiki_link())
+#class CaveForm(ModelForm):
+# class Meta:
+# model = Cave
+
+#class PersonForm(ModelForm):
+# class Meta:
+# model = Person
+
+#class LogbookEntryForm(ModelForm):
+# class Meta:
+# 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'</p><p style="float: left;"><b>QMs found:</b>')
+# for QM in LogbookEntry.instance.QMs_found.all():
+# res.append(QM.wiki_link())
+
+# res.append(r'</p><p style="float: left;"><b>QMs ticked off:</b>')
+# for QM in LogbookEntry.instance.QMs_ticked_off.all():
+# res.append(QM.wiki_link())
# res.append(r'</p><p style="float: left; "><b>People</b>')
# for persontrip in LogbookEntry.instance.persontrip_set.all():
# res.append(persontrip.wiki_link())
# res.append(r'</p>')
- return string.join(res, r'<br />')
+# return string.join(res, r'<br />')
+
+# def __init__(self, *args, **kwargs):
+# super(LogbookEntryForm, self).__init__(*args, **kwargs)
+# self.fields['text'].help_text=self.wikiLinkHints()#
- def __init__(self, *args, **kwargs):
- super(LogbookEntryForm, self).__init__(*args, **kwargs)
- self.fields['text'].help_text=self.wikiLinkHints()
+class CaveForm(forms.Form):
+ html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))
def getTripForm(expedition):
|