Explorar o código

Adding test model for creating RESTful endpoint

David Leonard %!s(int64=10) %!d(string=hai) anos
pai
achega
bcd50dffbb
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      hackathon_starter/hackathon/models.py

+ 10 - 1
hackathon_starter/hackathon/models.py

@@ -13,4 +13,13 @@ class UserProfile(models.Model):
 class Profile(models.Model):
     user = models.ForeignKey(User)
     oauth_token = models.CharField(max_length=200)
-    oauth_secret = models.CharField(max_length=200)
+    oauth_secret = models.CharField(max_length=200)
+
+class Snippet(models.Model):
+    created = models.DateTimeField(auto_now_add=True)
+    title = models.CharField(max_length=100, blank=True, default='')
+    code = models.TextField()
+    linenos = models.BooleanField(default=False)
+
+    class Meta:
+        ordering = ('created',)