[svn] Weeks of local changes.

- Import is now non-destructive
- Parsers write output to a log file (path be specified in settings)
- databaseReset.py content been divided into separate functions which can be called for varying levels of deletion and importing
- control panel (view, template, urlpattern) added for deleting and importing
- Logins and signup fixed
- CaveArea model updated, view, hierarchical url patterns, and beginning of template added
- New site style
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8324 by cucc @ 5/3/2009 5:56 AM
This commit is contained in:
substantialnoninfringinguser
2009-05-13 06:15:48 +01:00
parent 1a36856b40
commit 625b2156e3
25 changed files with 544 additions and 270 deletions

View File

@@ -235,10 +235,10 @@ class LogbookEntry(TroggleModel):
return "%s: (%s)" % (self.date, self.title)
def get_next_by_id(self):
Logbook.objects.get(id=self.id+1)
LogbookEntry.objects.get(id=self.id+1)
def get_previous_by_id(self):
Logbook.objects.get(id=self.id-1)
LogbookEntry.objects.get(id=self.id-1)
class PersonTrip(TroggleModel):
person_expedition = models.ForeignKey(PersonExpedition,null=True)
@@ -448,13 +448,29 @@ class Entrance(TroggleModel):
if f[0] == self.findability:
return f[1]
class CaveArea(TroggleModel):
class Subcave(TroggleModel):
description = models.TextField()
name = models.CharField(max_length=200, unique = True)
cave = models.ForeignKey('Cave')
parentArea = models.ForeignKey('CaveArea')
survexFile = models.CharField(max_length=200)
name = models.CharField(max_length=200, )
cave = models.ForeignKey('Cave', blank=True, null=True, help_text="Only the top-level subcave should be linked to a cave")
parent= models.ForeignKey('Subcave', blank=True, null=True,)
adjoining = models.ManyToManyField('Subcave',blank=True, null=True,)
survex_file = models.CharField(max_length=200, blank=True, null=True,)
def __unicode__(self):
return self.name
def get_absolute_url(self):
urlString=self.name
if self.parent:
parent=self.parent
while parent.parent:
urlString=parent.name+'/'+urlString
parent=parent.parent
urlString=unicode(parent.cave.kataster_number)+urlString
else:
urlString=unicode(self.cave.kataster_number)+urlString
return settings.URL_ROOT + urlString
class QM(TroggleModel):
#based on qm.csv in trunk/expoweb/smkridge/204 which has the fields:
@@ -473,7 +489,7 @@ class QM(TroggleModel):
location_description = models.TextField(blank=True)
#should be a foreignkey to surveystation
nearest_station_description = models.CharField(max_length=400,null=True,blank=True)
nearest_station = models.OneToOneField(SurveyStation,null=True,blank=True)
nearest_station = models.CharField(max_length=200,blank=True,null=True)
area = models.CharField(max_length=100,blank=True,null=True)
completion_description = models.TextField(blank=True,null=True)
comment=models.TextField(blank=True,null=True)