Anonymous avatar Anonymous committed 5db17e9

Comments (0)

Files changed (1)

 from django.template.defaultfilters import slugify
 
 
-# define our path roots
 PHOTOLOGUE_DIR = 'photologue'
-PHOTOLOGUE_URL = '/photologue'
 
 
 class Gallery(models.Model):
 
     def get_absolute_url(self):
         args = self.pub_date.strftime("%Y/%b/%d").lower().split("/") + [self.slug]
-        return reverse('pr-gallery-detail', args=args)
+        return reverse('pl-gallery-detail', args=args)
 
     def latest(self, limit=5):
         return self.photos.all()[:limit]
 class GalleryUpload(models.Model):
     id = models.IntegerField(default=1, editable=False, primary_key=True)
     zip_file = models.FileField('Images file (.zip)',
-                                upload_to=PRESSROOM_DIR+"/temp",
+                                upload_to=PHOTOLOGUE_DIR+"/temp",
                                 help_text="Select a .zip file of images to upload into a new Gallery.")
     title_prefix = models.CharField(maxlength=75,
                                     help_text="Photos will be titled using this prefix.")
 
 
 class Photo(models.Model):
-    image = models.ImageField("Photograph", upload_to=PRESSROOM_DIR+"/photos/%Y/%b/%d")
+    image = models.ImageField("Photograph", upload_to=PHOTOLOGUE_DIR+"/photos/%Y/%b/%d")
     pub_date = models.DateTimeField("Date published", default=datetime.now)
     title = models.CharField(maxlength=80)
     slug = models.SlugField(prepopulate_from=('title',),
                             help_text='A "Slug" is a unique URL-friendly title for an object.')
     caption = models.TextField()
-    photographer = models.CharField(maxlength=100)
+    photographer = models.CharField(maxlength=100, blank=True)
     info = models.TextField(blank=True,
                             help_text="Additional information about the photograph such as date taken, equipment used etc..")
 
 
     def get_absolute_url(self):
         args = self.pub_date.strftime("%Y/%b/%d").lower().split("/") + [self.slug]
-        return reverse('pr-photo-detail', args=args)
-
+        return reverse('pl-photo-detail', args=args)
 
     def cache_path(self):
         return os.path.join(os.path.dirname(self.get_image_filename()), "cache")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.