mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-01-20 01:42:30 +00:00
FileUploadForm does not work with django 1.7.
It tries to use database during class initialisation. removed it for now - not sure if it's important...
This commit is contained in:
parent
94c232c775
commit
c3300f7c96
@ -148,32 +148,32 @@ def get_name(pe):
|
|||||||
else:
|
else:
|
||||||
return pe.person.first_name
|
return pe.person.first_name
|
||||||
|
|
||||||
class UploadFileForm(forms.Form):
|
#class UploadFileForm(forms.Form):
|
||||||
title = forms.CharField(max_length=50)
|
# title = forms.CharField(max_length=50)
|
||||||
file = forms.FileField()
|
# file = forms.FileField()
|
||||||
html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))
|
# html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}))
|
||||||
lon_utm = forms.FloatField(required=False)
|
# lon_utm = forms.FloatField(required=False)
|
||||||
lat_utm = forms.FloatField(required=False)
|
# lat_utm = forms.FloatField(required=False)
|
||||||
slug = forms.CharField(max_length=50)
|
# slug = forms.CharField(max_length=50)
|
||||||
date = forms.DateField(required=False)
|
# date = forms.DateField(required=False)
|
||||||
|
|
||||||
caves = [cave.slug for cave in Cave.objects.all()]
|
# caves = [cave.slug for cave in Cave.objects.all()]
|
||||||
caves.sort()
|
# caves.sort()
|
||||||
caves = ["-----"] + caves
|
# caves = ["-----"] + caves
|
||||||
cave = forms.ChoiceField([(c, c) for c in caves], required=False)
|
# cave = forms.ChoiceField([(c, c) for c in caves], required=False)
|
||||||
|
|
||||||
entrance = forms.ChoiceField([("-----", "Please select a cave"), ], required=False)
|
# entrance = forms.ChoiceField([("-----", "Please select a cave"), ], required=False)
|
||||||
qm = forms.ChoiceField([("-----", "Please select a cave"), ], required=False)
|
# qm = forms.ChoiceField([("-----", "Please select a cave"), ], required=False)
|
||||||
|
|
||||||
expeditions = [e.year for e in Expedition.objects.all()]
|
# expeditions = [e.year for e in Expedition.objects.all()]
|
||||||
expeditions.sort()
|
# expeditions.sort()
|
||||||
expeditions = ["-----"] + expeditions
|
# expeditions = ["-----"] + expeditions
|
||||||
expedition = forms.ChoiceField([(e, e) for e in expeditions], required=False)
|
# expedition = forms.ChoiceField([(e, e) for e in expeditions], required=False)
|
||||||
|
|
||||||
logbookentry = forms.ChoiceField([("-----", "Please select an expedition"), ], required=False)
|
# logbookentry = forms.ChoiceField([("-----", "Please select an expedition"), ], required=False)
|
||||||
|
|
||||||
person = forms.ChoiceField([("-----", "Please select an expedition"), ], required=False)
|
# person = forms.ChoiceField([("-----", "Please select an expedition"), ], required=False)
|
||||||
|
|
||||||
survey_point = forms.CharField()
|
# survey_point = forms.CharField()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from troggle.core.models import Cave, Expedition, Person, LogbookEntry, PersonExpedition, PersonTrip, DPhoto, QM
|
from troggle.core.models import Cave, Expedition, Person, LogbookEntry, PersonExpedition, PersonTrip, DPhoto, QM
|
||||||
from troggle.core.forms import UploadFileForm
|
#from troggle.core.forms import UploadFileForm
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.template import loader, Context
|
from django.template import loader, Context
|
||||||
@ -259,8 +259,8 @@ def newFile(request, pslug = None):
|
|||||||
# "TU": py.time_underground,
|
# "TU": py.time_underground,
|
||||||
# "author": py.is_logbook_entry_author}
|
# "author": py.is_logbook_entry_author}
|
||||||
# for py in previouslbe.persontrip_set.all()])
|
# for py in previouslbe.persontrip_set.all()])
|
||||||
else:
|
# else:
|
||||||
fileform = UploadFileForm() # An unbound form
|
# fileform = UploadFileForm() # An unbound form
|
||||||
|
|
||||||
return render_with_context(request, 'editfile.html', {
|
return render_with_context(request, 'editfile.html', {
|
||||||
'fileForm': fileform,
|
'fileForm': fileform,
|
||||||
|
Loading…
Reference in New Issue
Block a user