pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

volta private pastebin - collaborative debugging tool What's a private pastebin?


Posted by mtigas on Wed 23 Jul 09:35
report abuse | download | new post

  1. #models.py for newforms-admin permissions example
  2. #see http://www.miketigas.com/?p=625
  3. from django.db import models
  4. from django.contrib.auth.models import User
  5.  
  6. class Blog(models.Model):
  7.     name        = models.CharField(max_length=30)
  8.     slug = models.SlugField()
  9.     description = models.TextField()
  10.     # the user that "owns" this blog
  11.     user        = models.ForeignKey(User,blank=True,null=True)
  12.  
  13.     def __unicode__(self):
  14.         return u'%s' % (self.name)
  15.  
  16.     class Meta:
  17.         permissions = (('access_all_blogs','Access to all blogs'),)
  18.  
  19. class BlogPost(models.Model):
  20.     title = models.CharField(max_length=30)
  21.     slug = models.SlugField()
  22.     pubdate = models.DateTimeField()
  23.     post = models.TextField()
  24.  
  25.     def __unicode__(self):
  26.         return u'%s' % (self.title)
  27.  
  28.     class Meta:
  29.         permissions = (('access_all_posts','Access to all posts'),)

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me