code_junkie

How to create dynamic and safe queries

Nov 12th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #Model definition
  2. class Blog(models.Model):
  3. name = models.CharField(max_length=100)
  4. tagline = models.TextField()
  5.  
  6. def __unicode__(self):
  7. return self.name
  8.  
  9. from mysite.blog.models import Blog
  10. b = Blog(name='Beatles Blog', tagline='All the latest Beatles news.')
  11. b.save()
Add Comment
Please, Sign In to add comment