Skip to content

Instantly share code, notes, and snippets.

@leachim6
Created July 27, 2008 14:26
Show Gist options
  • Save leachim6/2778 to your computer and use it in GitHub Desktop.
Save leachim6/2778 to your computer and use it in GitHub Desktop.
from django.db import models
from django.contrib import admin
POST_TYPES = (
('A', 'Audio'),
('V', 'Video'),
('U', 'URL'),
('Q', 'Quote'),
('I', 'Image'),
)
class Post(models.Model):
title = models.CharField(max_length=100)
body = models.TextField()
type = models.CharField(max_length=1, choices=POST_TYPES)
admin.site.register(Post)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment