> On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote:
>>
>>
>> On Aug 5, 1:50 pm, Roald de Vries <downa...@gmail.com> wrote:
>>> Dear all,
>>>
>>> I have the following error, and don't know what it means:
>>>
>>> Error: One or more models did not validate:
>>> update.personupdate: 'address' has a relation with model
>>> Address,
>>> which has either not been installed or is abstract.
>>>
>>> I did a pretty big refactoring, but I think the problems started
>>> when
>>> I separated my Person class into an abstract base class
>>> PersonProfile
>>> and a derived class Person, and added the class PersonUpdate,
>>> deriving
>>> from PersonProfile too.
>>>
>>> Can anybody help?
>>>
>>> Thanks in advance, cheers,
>>>
>>> Roald
>>
>> Can you provide some code snippets from your model definitions?
>
> I had adapted the error a little, but here the real code (in Dutch)
> and the corresponding errors. I can help you with the Dutch if it's
> necessary ;-).
>
>
> #################
> # in core.models:
> #################
>
> # ...
> class Persoonprofiel(models.Model):
> geslacht = models.CharField(max_length=8, choices=(('M',
> 'Man'), ('V', 'Vrouw')))
> voorletters = models.CharField(max_length=12, blank=False)
> # ...
> class Meta:
> abstract = True
> # ...
> class Persoon(Persoonprofiel):
> foto = models.ImageField(upload_to="personen_fotos",
> blank=True)
> titel = models.CharField(max_length=100, blank=True)
> # ...
> class Meta:
> verbose_name = 'Persoon'
> verbose_name_plural = 'Personen'
> ordering = ['achternaam']
>
>
> ###################
> # in update.models:
> ###################
>
> # ...
> class PersoonUpdate(Persoonprofiel):
> persoon = models.ForeignKey('Persoon')
> bezoekadres = models.ForeignKey('Adres',
> related_name='persoonupdates_als_bezoekadres', blank=True, null=True)
> # ...
>
>
> #########
> # errors:
> #########
>
> Error: One or more models did not validate:
> update.persoonupdate: 'persoon' has a relation with model Persoon,
> which has either not been installed or is abstract.
> update.persoonupdate: 'bezoekadres' has a relation with model Adres,
> which has either not been installed or is abstract.
> # ...
Solved. Solution: omit the quotes the referenced models that foreign
keys refer to.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment