You should understand that extending a model will create a new table with columns existed in parent in addition to new columns you define , so yes you can extend ..
On Fri, 28 Feb 2020, 3:03 pm Ol P, <[email protected]> wrote: > What are you trying to achieve with this implementation? > > I want to achieve modularly and loose coupling. Separate responsibility in > other words. > > and What do you call a extended model ? > > By extended model, I mean pat of an existing model, that implemented in > one place (in out example app-A) but extended, altered or modified in > another please (in out example app-B) > > Instance of model1 is accesible in app2, this already means you got your >> model1 in app2. > > Yes, but not the model itself. > > On Friday, February 28, 2020 at 2:53:45 PM UTC+2, Naveen Arora wrote: >> >> What are you trying to achieve with this implementation? >> and What do you call a extended model ? >> Instance of model1 is accesible in app2, this already means you got your >> model1 in app2. >> >> Curious. >> >> >> On Friday, 28 February 2020 18:20:12 UTC+5:30, Ol P wrote: >>> >>> But how to add fields to it? >>> >>> Where to put what: >>> from appA import model1 >>> >>> >>> class ExtendedModel1(?): >>> ? >>> >>> new_field = models.CharFiled() >>> >>> class Meta: >>> ? >>> >>> >>> On Friday, February 28, 2020 at 2:23:17 PM UTC+2, Naveen Arora wrote: >>>> >>>> Clearly Possible, >>>> Simply import the model first using appname.models. Hope it helps:) >>>> You can use this as >>>> from appA import model1 >>>> in app2 >>>> >>>> On Thursday, 27 February 2020 22:04:12 UTC+5:30, Ol P wrote: >>>>> >>>>> Imagen we have *app-A* and *app-B* with *model-A* and *model-B* >>>>> accordingly. >>>>> And we want to extend *model-A* in *app-B*. >>>>> What should be written in *model-B* to implement it? >>>>> >>>>> In other words, is it possible to implement the same-table extension? >>>>> >>>> -- > 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/851d7bd0-4821-4b78-bfbf-881f0db090f5%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/851d7bd0-4821-4b78-bfbf-881f0db090f5%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/CAHV4E-cg-fji_xoKcrTaAHoCio_iX09fV9E0u%2BhW9cvJ--iebQ%40mail.gmail.com.

