--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/035f39c8-cc71-4ae5-81ed-53f2c0d4aee3%40googlegroups.com.
Not sure if I understand the question correctly, but are you trying to use model-A in app-B?
On Fri, Feb 28, 2020 at 12:33 AM Ol P <o...@global-mediator.com> 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 django...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9e98c0dc-547c-4b99-8bc3-f31187444f98%40googlegroups.com.
garage (app-A)
models
class Vehicle(models.Model)
vin=models.CharField(max_length=50)
...
def import_data(self):
...
# import vehicals
external integration (app-B)
models
class ExtendedVehicle(Vehicle)
external_field=models.CharField(max_length=50)
def import_data(self):
super(ExtendedVehicle, self).import_data() self.import_external_field()
def import_external_field(self):
...
# import external_field
One-time class definition is always good choice, I won't do it like that.
But can you share the detailed scenario you are gonna implement?
On Fri, Feb 28, 2020 at 1:03 AM Ol P <o...@global-mediator.com> wrote:
I want to extend model-A from app-B without modification of app-A--
For example, add a field or new methods or override existing.On Thursday, February 27, 2020 at 6:54:37 PM UTC+2, Jin wrote:Not sure if I understand the question correctly, but are you trying to use model-A in app-B?On Fri, Feb 28, 2020 at 12:33 AM Ol P <o...@global-mediator.com> 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 django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/035f39c8-cc71-4ae5-81ed-53f2c0d4aee3%40googlegroups.com.
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9e98c0dc-547c-4b99-8bc3-f31187444f98%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3dce9e3-bd95-495e-85b3-a359c21dc95e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3dce9e3-bd95-495e-85b3-a359c21dc95e%40googlegroups.com.
from appA import model1
class ExtendedModel1(?):
?
new_field = models.CharFiled()
class Meta:
?
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.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/851d7bd0-4821-4b78-bfbf-881f0db090f5%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
Why are you trying to create the same table again and again with more or less attributes ?