Return to Snippet

Revision: 38912
at January 12, 2011 03:53 by Affix


Updated Code
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

Revision: 38911
at January 10, 2011 10:15 by Affix


Initial Code
from django.db import models

# Create your models here.

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 Category(models.Model):
	category_title = models.CharField(max_length=200)
	def __unicode__(self):
		return self.category_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(Posts)
	comment_content = models.TextField(max_length=500)
	def __unicode__(self):
		return self.comment_author

Initial URL
http://affix.me

Initial Description

                                

Initial Title
Django tut Blog model Complete

Initial Tags
django

Initial Language
Python