diff options
author | luxagraf <sng@luxagraf.net> | 2012-09-22 22:27:04 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2012-09-22 22:27:04 -0400 |
commit | efb623af0bcb47d510501c282e1326b11343a29c (patch) | |
tree | 3a35fb19f5eba3b219c65277a5fb712cbe9604ac /apps/projects/models/natparks.py | |
parent | 0b481fd7931c2ae20ca21f89a87f2ba6a6c01e10 (diff) |
site reorg
Diffstat (limited to 'apps/projects/models/natparks.py')
-rw-r--r-- | apps/projects/models/natparks.py | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/apps/projects/models/natparks.py b/apps/projects/models/natparks.py deleted file mode 100644 index f4a739d..0000000 --- a/apps/projects/models/natparks.py +++ /dev/null @@ -1,56 +0,0 @@ -from django.contrib.gis.db import models -from PIL import Image -from blog.models import Entry -from photos.models import PhotoGallery -from locations.models import State - - -PUB_STATUS = ( - (0, 'Draft'), - (1, 'Published'), - ) - - -import datetime -def get_upload_path(self, filename): - return "images/projects/np/%s/%s" %(datetime.datetime.today().strftime("%Y"), filename) - - -class NationalParks(models.Model): - type = models.CharField(max_length=50) - name = models.CharField(max_length=254) - state = models.ForeignKey(State, null=True) - size = models.CharField(max_length=10, null=True) - fee = models.CharField(max_length=5, null=True) - camping_fee = models.CharField(max_length=10, null=True) - url = models.CharField(max_length=250, null=True) - code= models.CharField(max_length=16) - unit_name= models.CharField(max_length=254) - date_visited_begin = models.DateField('Date Visited',null=True) - date_visited_end = models.DateField('Date Visited',null=True) - date_park_created = models.DateField('Date Park Created',null=True) - zoom= models.IntegerField(null=True) - mpoly = models.MultiPolygonField(null=True) - visited = models.BooleanField(default=False) - dek = models.TextField(null=True, blank=True) - tag_line = models.CharField(max_length=254, null=True) - post = models.ForeignKey(Entry, null=True) - gallery = models.ForeignKey(PhotoGallery, blank=True, null=True, verbose_name='photo set') - image = models.FileField(upload_to=get_upload_path, null=True,blank=True,help_text="width: 980px, height: > 450px") - image_height = models.CharField(max_length=20, null=True,blank=True) - image_width = models.CharField(max_length=20, null=True,blank=True) - objects = models.GeoManager() - - class Meta: - verbose_name_plural = "National Parks" - app_label = 'projects' - ordering = ('-visited','unit_name',) - # Returns the string representation of the model. - def __unicode__(self): - return self.unit_name - - def save(self): - #get image dimensions - img = Image.open(self.image) - self.image_width, self.image_height = img.size - super(NationalParks, self).save()
\ No newline at end of file |