-
Notifications
You must be signed in to change notification settings - Fork 1
Static Article Plugins
W. Bomar edited this page Dec 9, 2021
·
7 revisions
Archived. We will not have "Static Article Plugins"; they are too high-maintenance compared to much simpler solutions.
Support addition of news articles that originate from the TACC news site.
Ideally, we have a dynamic solution that pulls from one news site:
But this was not feasible (Summer 2021)* thus:
* Not feasible because of constraints on time, of knowledge, and from incomplete architecture.
Instead, the image fields should be in the plugin, not via a child plugin, but a solution has not yet been implemented.
The AbstractLink
model has been successfully extended:
- Build model so it extends
AbstractPicture
fromdjangocms-picture
. - Tweak model to sweep bugs under the rug.
- Quit when he was unable to resolve the error,
TaccsiteStaticNewsArticlePreview has no field named 'cmsplugin_ptr_id'
upon saving a plugin instance. - Learn:
from djangocms_picture.models import AbstractPicture
# To allow user to not set image
# FAQ: Emptying the clean() method avoids picture validation
# SEE: https://github.com/django-cms/djangocms-picture/blob/3.0.0/djangocms_picture/models.py#L278
def skip_image_validation():
pass
class TaccsiteStaticNewsArticlePreview(AbstractPicture):
#
# …
#
# Remove error-prone attribute from parent class
# FAQ: Avoid error when running `makemigrations`:
# "You are trying to add a non-nullable field 'cmsplugin_ptr' […]"
# SEE: https://github.com/django-cms/djangocms-picture/blob/3.0.0/djangocms_picture/models.py#L212
# SEE: https://github.com/django-cms/djangocms-picture/blob/3.0.0/djangocms_picture/models.py#L234
cmsplugin_ptr = None
class Meta:
abstract = False
# Validate
def clean(self):
skip_image_validation()
TACC ACI WMA Core-CMS Project Documentation