/ Published in: Python

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from django.db import models # Create your models here. class Category(models.Model): category_title = models.CharField(max_length=200) def __unicode__(self): return self.category_title class Post(models.Model): entry_title = models.CharField(max_length=200) entry_content = models.TextField(max_length=5000) entry_category = models.ForeignKey(Category) def __unicode__(self): return self.entry_title class Comment(models.Model): comment_author = models.CharField(max_length=200) author_email = models.CharField(max_length=200) author_web = models.CharField(max_length=200) post_id = models.ForeignKey(Post) comment_content = models.TextField(max_length=500) def __unicode__(self): return self.comment_author
URL: http://affix.me
Comments
