Commits

Anonymous committed da7fee7

[project @ 355]
Added utility method for creating photos.

  • Participants
  • Parent commits aa810b7

Comments (0)

Files changed (1)

File cciw/cciwmain/models/forums.py

     def get_absolute_url(self):
         return self.gallery.get_absolute_url() + str(self.id) + '/'
 
+    @staticmethod
+    def create_default_photo(filename, gallery):
+        Photo.objects.create(
+                    created_at=datetime.now(),
+                    open=True,
+                    hidden=False,
+                    filename=filename,
+                    description="",
+                    gallery=gallery,
+                    checked_by=None,
+                    approved=None,
+                    needs_approval=False
+        )
+        
     class Meta:
         app_label = "cciwmain"