diff mippet/models.py @ 1:013cf0aa49b7

Implement basic mippets, stub templates
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Thu, 24 Jun 2010 08:59:14 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mippet/models.py	Thu Jun 24 08:59:14 2010 -0500
@@ -0,0 +1,27 @@
+from django.db import models
+
+# Create your models here.
+
+class free_license(models.Model):
+    name = models.CharField(max_length=200)
+    desc = models.TextField()
+    text = models.TextField()
+    gpl_compatible = models.BooleanField()
+    def __unicode__(self):
+        return self.name
+    
+
+class mscript(models.Model):
+    name = models.CharField(max_length=512)
+    code = models.TextField()
+    free_license = models.ForeignKey(free_license)
+    underlying_file = models.FileField(upload_to="var/")
+    is_standalone = models.BooleanField()
+    def __unicode__(self):
+        return self(name)
+
+class bundle(models.Model):
+    name = models.CharField(max_length=512)
+    script = mscript()
+    def __unicode__(self):
+        return self(name)