Hi, Cale thanks for the reply. but in uml diagram Product Feature doesn't have any relation with the product. so why did you made a relation with the product model? can you please guide me on how to do this?
On Thu, Aug 26, 2021 at 8:44 PM Cale Roco <[email protected]> wrote: > theres a lot of different ways you can do this, depending on your desired > functionality, the amount of data you intend to store etc, > > // Simple Example > class Product(models.Model): > name = models.Charfield(max_length=255) > > > class ProductFeature(models.Model): > product = models.ForeignKey(Product, on_delete=models.CASCADE) > feature = models.ForeignKey("Feature", on_delete=models.CASCADE) > > class Feature(models.Model): > name = models.CharField(max_length=60) > value = models.CharField(max_length=60) > > On Thursday, 26 August 2021 at 16:14:04 UTC+1 [email protected] wrote: > >> Hi Derek it is not difficult for me to write the model for the product >> entity. but there are also other diagrams that I want to convert into >> models. so I was just wanted to clear my concept. >> I am confused in Super types and sub types as you can see an entity >> within the entity. how should I convert them into models? >> >> On Thu, Aug 26, 2021 at 6:50 PM Derek <[email protected]> wrote: >> >>> There is not sufficient data in that image to create models. You don't >>> know the field types, for example. >>> >>> Once you have those, it should not be too hard e.g.: >>> >>> from django.db import models >>> >>> class Product(models.Model): >>> product_id = models.AutoField() >>> name = models.CharField( max_length=255) >>> date_introduction = models.DateField() >>> comment = models.TextField() >>> >>> #etc. >>> >>> You'll need to use ForeignKey fields to link related tables, of course. >>> >>> HTH. >>> >>> On Thursday, 26 August 2021 at 10:28:23 UTC+2 [email protected] wrote: >>> >>>> can anyone help me? >>>> >>>> On Thu, Aug 26, 2021 at 9:32 AM DJANGO DEVELOPER <[email protected]> >>>> wrote: >>>> >>>>> Currently, I am working on an inventory management system and I have >>>>> got some UML diagrams and want to convert those uml diagrams into django >>>>> models. So can anyone guide me on how to convert those UML diagrams into >>>>> django models? >>>>> an example is below of uml diagram >>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/django-users/d7cc08c3-cb88-422b-8cb3-a15130abeba1n%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/django-users/d7cc08c3-cb88-422b-8cb3-a15130abeba1n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>> 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 [email protected]. >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/74f7d899-ceb8-42a4-8809-fdd5aac48625n%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/74f7d899-ceb8-42a4-8809-fdd5aac48625n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/dbc1bde9-06d9-440d-95ea-1c9c55d1c698n%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/dbc1bde9-06d9-440d-95ea-1c9c55d1c698n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKPY9pndwiaa8qv5b55e%2BOtvzb0pERSgQZ0xUv8saff%2BW8-hKQ%40mail.gmail.com.

