2009-05-14 23:09:33 +08:00
|
|
|
from django.db import models
|
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
class Parent(models.Model):
|
|
|
|
name = models.CharField(max_length=128)
|
|
|
|
|
|
|
|
class Child(models.Model):
|
2011-01-24 15:01:00 +08:00
|
|
|
parent = models.ForeignKey(Parent, editable=False, null=True)
|
|
|
|
name = models.CharField(max_length=30, blank=True)
|