On 10/9/09, Kristaps Kūlis <kristaps.ku...@gmail.com> wrote: > Hello > > I have such models: > > Class Model1(models.Model): > [content] > Class Model2(models.Model): > model1 = models.ForeignKey(Model1) > > How to ensure that Model1 has at least 1 referenced model ? > data are added using django admin interface, which inlineadmins
Hi, How about using OneToOneField instead ForeignKey http://docs.djangoproject.com/en/dev/ref/models/fields/#onetoonefield cheers -djibon- -- -------------------------------------------------------------- http://www.tumbletooth.org my linkedin profile : http://www.linkedin.com/in/bayuadji -------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---