Skip to content

refactor: added overlay base model for all overlay model to inherit.#943

Draft
adekoder wants to merge 1 commit into
NixOS:mainfrom
adekoder:add-overlay-base-model-class
Draft

refactor: added overlay base model for all overlay model to inherit.#943
adekoder wants to merge 1 commit into
NixOS:mainfrom
adekoder:add-overlay-base-model-class

Conversation

@adekoder

Copy link
Copy Markdown
Collaborator

Description:

We are refactoring the naming of the respective models MaintainersEdit and PackageEdit and subsequent similar models to hand similar type of edit, they are basically an Overlay an not an Edit since we are not actually editing the maintainers or the packages.

This PR is to create a structure this type of models by introducing a Base Abstract Class that check similar model can inherit from, this keep the part of the system organise since there is already a pattern established here.

@fricklerhandwerk

fricklerhandwerk commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

To avoid dumping dead code (however short-lived), I recommend doing the event name migration first (separately), and then moving the special cases under the base class together with the addition of the base class.

@adekoder

Copy link
Copy Markdown
Collaborator Author

To avoid dumping dead code (however short-lived), I recommend doing the event name migration first (separately), and then moving the special cases under the base class together with the addition of the base class.

sure ... noted

@fricklerhandwerk fricklerhandwerk marked this pull request as draft March 30, 2026 13:10
@fricklerhandwerk

Copy link
Copy Markdown
Collaborator

Depends on #944

Comment thread src/shared/models/base.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just put it into models/linkage.py so it stays together.

Comment thread src/shared/models/base.py
from django.db import models
from django.utils.translation import gettext_lazy as _

class BaseAbstractOverlay(models.Model):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class BaseAbstractOverlay(models.Model):
class Overlay(models.Model):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants