diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:25:17 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:25:17 +0100 |
commit | 7aee3fb920a1477332d78c8f3fb546da428be6e8 (patch) | |
tree | cdfacfc1ef181881d2ac1c7f4c8d4bce2ec917eb /expo/models.py | |
parent | 8c818906b5c1228a6fb411cb96d1bd5f1663b49a (diff) | |
download | troggle-7aee3fb920a1477332d78c8f3fb546da428be6e8.tar.gz troggle-7aee3fb920a1477332d78c8f3fb546da428be6e8.tar.bz2 troggle-7aee3fb920a1477332d78c8f3fb546da428be6e8.zip |
[svn] QM parser now parses Hauchhoehle QMs.py
Photo model added.
Logbook parser now puts mugshots in as photo models, and descriptions from the old folk html pages in as "blurbs" on the person model.
Experimented with eye candy and a random logbook quote generator.
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8094 by aaron @ 12/31/2008 2:59 AM
Diffstat (limited to 'expo/models.py')
-rw-r--r-- | expo/models.py | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/expo/models.py b/expo/models.py index 930028b..69f9549 100644 --- a/expo/models.py +++ b/expo/models.py @@ -27,8 +27,9 @@ class Expedition(models.Model): class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
- is_vfho = models.BooleanField()
+ is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.")
mug_shot = models.CharField(max_length=100, blank=True,null=True)
+ blurb = models.TextField(blank=True,null=True)
def __unicode__(self):
return "%s %s" % (self.first_name, self.last_name)
@@ -55,7 +56,6 @@ class PersonExpedition(models.Model): -
#class LogbookSentanceRating(models.Model):
# rating = models.IntegerField()
@@ -157,10 +157,7 @@ class LogbookEntry(models.Model): author = models.ForeignKey(PersonExpedition,blank=True,null=True) # the person who writes it up doesn't have to have been on the trip
title = models.CharField(max_length=200)
cave = models.ForeignKey(Cave,blank=True,null=True)
- # this will be a foreign key of the place the logbook is describing - JT
place = models.CharField(max_length=100,blank=True,null=True)
- # adding optional cave reference
-# cave = models.ForeignKey(Cave,blank=True,null=True)
text = models.TextField()
# several PersonTrips point in to this object
@@ -273,4 +270,25 @@ class QM(models.Model): #dateKilled = models.DateField(blank=True)
def __str__(self):
QMnumber=str(self.found_by.cave)+'-'+str(self.found_by.date.year)+"-"+str(self.number)+self.grade
- return str(QMnumber)
\ No newline at end of file + return str(QMnumber)
+
+class Photo(models.Model):
+ caption = models.CharField(max_length=1000,blank=True,null=True)
+ contains_person_trip = models.ManyToManyField(PersonTrip,blank=True,null=True)
+ contains_person = models.ManyToManyField(Person,blank=True,null=True)
+ file = models.ImageField(upload_to='photos',)
+ is_mugshot = models.BooleanField(default=False)
+ contains_cave = models.ForeignKey(Cave,blank=True,null=True)
+ contains_entrance = models.ForeignKey(Entrance, related_name="photo_file",blank=True,null=True)
+ nearest_survey_point = models.ForeignKey(SurveyStation,blank=True,null=True)
+ nearest_QM = models.ForeignKey(QM,blank=True,null=True)
+
+
+ lon_utm = models.FloatField(blank=True,null=True)
+ lat_utm = models.FloatField(blank=True,null=True)
+ #content_type = models.ForeignKey(ContentType)
+ #object_id = models.PositiveIntegerField()
+ #location = generic.GenericForeignKey('content_type', 'object_id')
+
+ def __str__(self):
+ return self.caption
|