--On Sunday 25 June 2017 15:08:25 Mark Phillips wrote:
> I have this class
>
> class DocumentMetaData(models.Model)
: > document = models.ManyToManyField(
Document) > metadata = models.ManyToManyField(
MetaData) > metadatavalue = models.ManyToManyField(
MetaDataValue)
That design is wrong. This is the design you want:
class DocumentMetaData(models.Model)
: name = models.CharField()
value = models.TextField()
class Document(models.Model):
title = models.CharField()
metadata = models.ManyToManyField(
DocumentMetaData)
This design allows many metadata with name and value to be linked to a each document. I'm not entirely sure how to describe what your data design accomplishes and I'm guessing you can't either or it doesn't accomplish what you think it should.
--
Melvyn Sopacua
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3017602. .KsclWe1iua%40devstation
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2O0KMGSxgR7dWcSXf6UeHq5xHCCwTXOtizUiWYH1p1v1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment