aboutsummaryrefslogtreecommitdiffstats
path: root/piccast/feeds/models.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2011-04-21 00:03:52 -0400
committerbnewbold <bnewbold@robocracy.org>2011-04-21 01:17:22 -0400
commit17f2d1ab9b3344d1880a7f7e98c972b8c599976b (patch)
tree4d747f42b2aebd3be3c2d8ed4651a808a645fd4f /piccast/feeds/models.py
parent150fa6dce3ac024fd2cf27acfa595d30905f2ccf (diff)
downloadpiccast-17f2d1ab9b3344d1880a7f7e98c972b8c599976b.tar.gz
piccast-17f2d1ab9b3344d1880a7f7e98c972b8c599976b.zip
some basic progress on models etc
Diffstat (limited to 'piccast/feeds/models.py')
-rw-r--r--piccast/feeds/models.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/piccast/feeds/models.py b/piccast/feeds/models.py
new file mode 100644
index 0000000..925bc87
--- /dev/null
+++ b/piccast/feeds/models.py
@@ -0,0 +1,54 @@
+from django.db import models
+
+class Category(models.Model):
+ #id
+ name = models.CharField(max_length=50);
+
+ def __unicode__(self):
+ return self.name
+
+class PicFeed(models.Model):
+ #id
+ created = models.DateTimeField()
+ shortname = models.SlugField(blank=False)
+ source_url = models.URLField(blank=True)
+ rssfeed_url = models.URLField(blank=True)
+ title = models.CharField(max_length=80, blank=True)
+ description = models.TextField(blank=True)
+ image = models.ForeignKey('feeds.Pic', blank=True, null=True)
+
+ def __unicode__(self):
+ return self.shortname
+
+class PicSet(models.Model):
+ #id
+ created = models.DateTimeField(null=True,blank=True)
+ source_url = models.URLField(blank=True)
+ title = models.CharField(max_length=128, blank=False)
+ description = models.TextField(blank=True)
+ keywords = models.CharField(max_length=256, blank=True)
+ image = models.ForeignKey('feeds.Pic', null=True,blank=True)
+ feed = models.ForeignKey('feeds.PicFeed', null=True,blank=False)
+ category = models.ForeignKey('feeds.Category', null=True,blank=True)
+ is_nsfw = models.BooleanField(default=False, blank=False);
+
+ def __unicode__(self):
+ return self.title
+
+class Pic(models.Model):
+ #id
+ set = models.ForeignKey('feeds.PicSet', null=True,blank=True)
+ title = models.CharField(max_length=128, blank=False)
+ thumbnail_url = models.URLField(blank=True)
+ thumbnail_height = models.PositiveIntegerField(null=True,blank=True)
+ thumbnail_width = models.PositiveIntegerField(null=True,blank=True)
+ original_url = models.URLField(blank=False)
+ original_height = models.PositiveIntegerField(null=True,blank=True)
+ original_width = models.PositiveIntegerField(null=True,blank=True)
+ source_url = models.URLField(blank=True)
+ caption = models.TextField(blank=True)
+ is_nsfw = models.NullBooleanField(null=True, blank=True)
+
+ def __unicode__(self):
+ return self.title
+