django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
42 stars 20 forks source link

feat: Add abstract base model `AbstractFrontendUIItem` #195

Closed fsbraun closed 3 months ago

fsbraun commented 3 months ago

As discussed in #194 the FrontendUIItem model class does not allow adding model fields, since this would imply subclassing CMSPluginModel twice which is not possible.

To remedy the situation, this PR introduces an abstract base model AbstractFrontendUIItem which by default has one concrete model FrontendUIItem.

If users need to create frontend models with additional model fields, they can do so using AbstractFrontendUIItem.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 86.96%. Comparing base (f11feee) to head (0e7fd74). Report is 5 commits behind head on master.

Files Patch % Lines
djangocms_frontend/contrib/link/models.py 0.00% 1 Missing and 1 partial :warning:
djangocms_frontend/contrib/link/forms.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #195 +/- ## ========================================== + Coverage 86.93% 86.96% +0.02% ========================================== Files 120 120 Lines 3107 3114 +7 Branches 330 330 ========================================== + Hits 2701 2708 +7 Misses 304 304 Partials 102 102 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.