mirror of
https://github.com/kennethreitz-archive/django-piston-xauth.git
synced 2026-06-21 07:50:58 +00:00
14 lines
419 B
Python
14 lines
419 B
Python
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
from django.contrib import admin
|
|
|
|
class Blogpost(models.Model):
|
|
title = models.CharField(max_length=255)
|
|
content = models.TextField()
|
|
author = models.ForeignKey(User, related_name='posts')
|
|
created_on = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __unicode__(self):
|
|
return self.title
|
|
|
|
admin.site.register(Blogpost) |