Subdomain Posts
None | 22 days ago
None | 164 days ago
Python | 164 days ago
None | 164 days ago
Python | 164 days ago
None | 171 days ago
Python | 227 days ago
Python | 227 days ago
None | 227 days ago
Python | 227 days ago
Recent Posts
None | 8 sec ago
None | 45 sec ago
None | 48 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
OCaml | 2 min ago
PHP | 2 min ago
None | 2 min ago
ASM (NASM) | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By mtigas on the 23rd of Jul 2008 08:35:35 AM
Download |
Raw |
Embed |
Report
#models.py for newforms-admin permissions example
#see http://www.miketigas.com/?p=625
from django.db import models
from django.contrib.auth.models import User
class Blog(models.Model):
name = models.CharField(max_length=30)
slug = models.SlugField()
description = models.TextField()
# the user that "owns" this blog
user = models.ForeignKey(User,blank=True,null=True)
def __unicode__(self):
return u'%s' % (self.name)
class Meta:
permissions = (('access_all_blogs','Access to all blogs'),)
class BlogPost(models.Model):
title = models.CharField(max_length=30)
slug = models.SlugField()
pubdate = models.DateTimeField()
post = models.TextField()
def __unicode__(self):
return u'%s' % (self.title)
class Meta:
permissions = (('access_all_posts','Access to all posts'),)
Submit a correction or amendment below.
Make A New Post