Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-08 Thread Ina Panova
+1 doing both sounds right. Regards, Ina Panova Senior Software Engineer| Pulp| Red Hat Inc. "Do not go where the path may lead, go instead where there is no path and leave a trail." On Wed, Aug 7, 2019 at 11:15 PM Brian Bouterse wrote: > > > On Wed, Aug 7, 2019 at 3:05 PM David D

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-07 Thread Brian Bouterse
On Wed, Aug 7, 2019 at 3:05 PM David Davis wrote: > So I've been working on the change to have plugin writers manually specify > default_related_name. In terms of pulpcore, I see two options: > > 1. Just document that this needs to be done > 2. Enforce that default_related_name needs to be define

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-07 Thread David Davis
An exception would be raised whenever the pulp app starts that says, "The setting 'default_related_name' has not been defined for detail model X". David On Wed, Aug 7, 2019 at 3:20 PM Austin Macdonald wrote: > Seems right to me. Just curious what happens if the plugin doesn't define > default_

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-07 Thread Austin Macdonald
Seems right to me. Just curious what happens if the plugin doesn't define default_related_name? On Wed, Aug 7, 2019 at 3:16 PM Dana Walker wrote: > +1 > > Sound logic. > > > Dana Walker > > She / Her / Hers > > Software Engineer, Pulp Project > > Red Hat > > dawal...@red

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-07 Thread Dana Walker
+1 Sound logic. Dana Walker She / Her / Hers Software Engineer, Pulp Project Red Hat dawal...@redhat.com On Wed, Aug 7, 2019 at 3:05 PM David Davis wrote: > So I've been working on the change to have plugin writers manually specify > def

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-07 Thread David Davis
So I've been working on the change to have plugin writers manually specify default_related_name. In terms of pulpcore, I see two options: 1. Just document that this needs to be done 2. Enforce that default_related_name needs to be defined and raise an exception if it is not. I'd suggest we do bot

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-02 Thread David Davis
Thanks for the feedback. It sounds like no one is opposed to having plugin writers specify default_related_name for Detail models so I plan to move forward with this solution next week if no one objects. David On Thu, Aug 1, 2019 at 4:39 AM Ina Panova wrote: > I am in favour of manually settin

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-08-01 Thread Ina Panova
I am in favour of manually setting default_related_name and document this in plugin writers guide. Regards, Ina Panova Senior Software Engineer| Pulp| Red Hat Inc. "Do not go where the path may lead, go instead where there is no path and leave a trail." On Wed, Jul 24, 2019 at 7:06

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-07-24 Thread David Davis
I think my main concern with the solution to remove model inheritance is that we either only apply it to the Content model and run the risk of having conflicts in other Master/Detail models (unlikely but possible). Or we apply it to all M/D models which is a huge undertaking (unless we can create s

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-07-24 Thread Dana Walker
I like your solution using default_related_name [0] manually, as Brian noted [1], it's more explicit and therefore more pythonic. That in mind, Daniel's alternative, not using model inheritance for the Content models [2], while less simple a change initially, potentially had significant performanc

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-07-24 Thread David Davis
I want to bump this thread again. We've only had one person weigh in and this is a major change that'll affect all Pulp 3 plugins that we need to address soon. Please respond here or on the issue with feedback. David On Sun, Jul 21, 2019 at 10:49 AM Brian Bouterse wrote: > Thanks for the inves

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-07-21 Thread Brian Bouterse
Thanks for the investigation and demo patch. I posted a +1 for the manual option with reasoning here: https://pulp.plan.io/issues/4681#note-20 Other ideas and perspectives are welcome. I hope we can resolve this issue soon as we approach RC4. On Wed, Jul 17, 2019 at 12:55 PM David Davis wrote:

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-07-17 Thread David Davis
I did some investigation and posted my findings[0]. Basically, it would be possible to solve this problem by defining default_related_name either manually or automatically on detail models. I don't know if we want to go this route so feedback is appreciated. [0] https://pulp.plan.io/issues/4681#no

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-29 Thread David Davis
It seems like most people are in favor of setting the OneToOneField or perhaps the default_related_name on the detail model. I think there’s also some interest in seeing how we can do this automatically for plugins. I’ve added this feedback to the issue: https://pulp.plan.io/issues/4681#note-8 Da

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-24 Thread Ina Panova
I would avoid making changes in class naming. So +1 for the OneToOneField definition. Regards, Ina Panova Software Engineer| Pulp| Red Hat Inc. "Do not go where the path may lead, go instead where there is no path and leave a trail." On Tue, Apr 23, 2019 at 6:45 PM David Davis wrot

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-23 Thread David Davis
The default_related_name setting is something that django provides. Subclasses can also explicitly define their OneToOneField parent link as well: content_ptr = models.OneToOneField(Content, on_delete=models.CASCADE, parent_link=True, related_name='rpm_package') I am not sure what you mean by 'ro

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-23 Thread Brian Bouterse
On Tue, Apr 23, 2019 at 11:02 AM David Davis wrote: > I think I found another solution that might work best: defining > 'default_related_name' on subclassed master-detail models. So Package in > pulp_rpm would define its default_related_name as "rpm_package". > Would we be making 'default_related

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-23 Thread Austin Macdonald
If the plugin writers have to be involved, then they will have to understand this problem which isn't much improved over situation right now-- the plugins will still be responsible for making sure their names don't collide with other plugins. If it is reasonable to do, the plugin writer experience

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-23 Thread David Davis
I think I found another solution that might work best: defining 'default_related_name' on subclassed master-detail models. So Package in pulp_rpm would define its default_related_name as "rpm_package". David On Tue, Apr 23, 2019 at 10:29 AM David Davis wrote: > I wanted to email the pulp-dev l

Re: [Pulp-dev] Master-detail inheritance in Pulp 3

2019-04-23 Thread Tatiana Tereshchenko
I'm leaning towards option 2 "defining one-to-one field". Are there any downsides of that approach apart from one more field specified by plugin writers? It will keep class names and autogenerated endpoints nice and less redundant, and fair for all the plugins. On Tue, Apr 23, 2019 at 4:31 PM Davi