django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
33 stars 29 forks source link

Admin of Page content versions takes far too long #380

Open jrief opened 4 months ago

jrief commented 4 months ago

Our site currently has ~17k pages and if I click onto

Home › django CMS Versioning › Page content versions

a select box is created containing a select option for each of them. Since this uses Django's internal ModelChoiceIterator building that list of options takes far too long. It probably should be replaced by a lazy loading select field.

Anyway, my workaround to solve this problem is to completely disable that view in the admin view by adding

    def get_model_perms(self, request):
        return {}

to the class djangocms_versioning.admin.VersionAdmin.

For normal users, is there any reason why this interface must be part of the Django admin?

fsbraun commented 4 months ago

No, I do not think it is either helpful nor usable. One could redirect one level up to switch this off.

jrief commented 4 months ago

One could redirect one level up to switch this off.

I don't understand what you mean with this.

fsbraun commented 4 months ago

Sorry, I was not clear. "one level up" works only for the breadcrumb and is technically incorrect. What I meant:

I can imagine that the version admin changelist redirects to the changelist of the versioned object if no versioned object is selected.

/en/admin/djangocms_versioning/pagecontentversion/   --302-->  /en/admin/cms/pagecontent/

In the object changelist you can access versioning actions as well as select "manage versions" for a particular item.

The whole versioning section could go from the admin, provided the version changelist for specific objects remains accessible: image