1.add Bookmark model on models.py
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Link( models.Model ):
url = models.URLField( unique = True )
class Bookmark( models.Model ):
title = models.CharField( max_length = 200 )
user = models.ForeignKey( User )
link = models.ForeignKey( Link )
2.sync db with python manage.py
#python manage syncdb
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言