I think this is more of a django-users comment, so I'll post Adam's
template for places.

I think you've found the wrong mailing list for this post. This mailing
list is for the development of Django itself, not for support using Django.
This means the discussions of bugs and features in Django itself, rather
than in your code using it. People on this list are unlikely to answer your
support query with their limited time and energy. Read more on the mailing
lists at https://www.djangoproject.com/community/

For support, please use the NEW Django forum at
https://forum.djangoproject.com , django-users mailing list, or IRC #django
on Freenode, or a site like Stack Overflow. There are people out there
willing to help on those channels, but they might not respond if you don't
ask your question well. Stack Overflow's question guide can help you frame
it well: https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of
Conduct: https://www.djangoproject.com/conduct/ . These are our "ground
rules" for working well as a community, and will help you get the most out
of Django and our fantastic community.

Thanks for your understanding,

Adam

I'll send you a direct message.

Joe


On Thu, Jan 30, 2020 at 6:02 AM LBris <laurentbris2...@gmail.com> wrote:

> Hi everyone,
>
> Would it be possible to provide a new inheritance mechanism between
> classes in Django ?
>
> I explain my point :
>
> I have an app, for instance "HR": In this app, I would manage a model that
> is called "Employee". I store several information on this model and it's
> fine.
>
> Suppose I have a SECOND app, for instance "Fleet". In this app, I would
> manage a model that is called "Vehicle" and of course I store several
> information on this model.
>
> Suppose I only use the app "HR"  and one day, I decide to use the app
> "Fleet". That's okey, no problem. Both will work.
>
> But what if I decide to create a THIRD app, for instance "HR-Fleet" that
> does the bridge between the two others ?
>
> That means that HR can be used ALONE and same for Fleet.
>
> But HR-Fleet would add additional information. For instance, on the
> employee we would add a field "company_car" that points to a vehicle. The
> trick is, it would be GREAT to be able to do that without creating
> additional table in the database.
>
> Here is a sample of code to illustrate the behavior I'm trying to explain :
>
> In app "HR" :
>
> hr/employee.py :
>
> class Employee(models.model):
>    name = ...
>    email = ...
>
> In app "Fleet" :
>
> fleet/vehicle.py
>
> class Vehicle(models.model):
>    brand = ...
>    model = ...
>    fuel_type = ...
>
> In app "HR-Fleet" :
>
> hr_fleet/employee.py :
>
> class HRFleetEmployee(models.model):
>    _inherit = <path_to_employee_model>
>
>    company_car = models.ForeignKey(...)
>
>
> And that would add an extra field on the Employee model without adding any
> table in the database or using proxy model or ...
>
> Can you guys tell me if that behavior is possible ?
>
> If you don't get the point of such a functionnality, I can try to give
> more details or be more clear.
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/7800872b-6191-4505-b3bb-f726b0b92db3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/7800872b-6191-4505-b3bb-f726b0b92db3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Joe Tennies
tenn...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACiOJ6s%3DBnPo_6BNtA7vs5S8Cv%3DOqCBm%3DaNv8G1UM6AkZ%2BW6fg%40mail.gmail.com.

Reply via email to