Grappelli admin "change_list" columns are not sortable - django

SOLVED: Has been a bug in grappelli-safe, which is the grappelli fork used for Mezzanine. Should be solved by now.
I have never used grappelli before switching to Mezzanine, so i do not know if this is standard behaviour, but i would be very surprised.
This is what happened: after installing Mezzanine everything worked fine, and Grappelli skinned my admin nicely. A few hours later i realized i could not use the column header row to sort objects by the value of that row. The row headers are only links, that reload the page. I'm pretty sure that these links should be overridden by some javascript to allow sorting, but there is no 404 or other error in retrieving the static files.
If someone could confirm that i'm really hunting a bug that would be great. I would hate to use hours for tracking something that is just normal behaviour. And if someone else knows how to fix that, or what script would be responsible for overriding the links, that would be even better.
I hate not to be more specific, but that's all i have right now... :(
Ah, one more thing:
A bit more specific at least: What i want to do is to click on "Status" to sort by the status column. But "Status" is a link to the current page, and therefore just reloads the page.

This just happened to me: It can also be caused by using django 1.4 with grappelli 2.3.8 (both current in pipi)
See this thread for details:
https://groups.google.com/forum/?fromgroups#!topic/django-grappelli/

Related

Sitecore 9, Cannot get Controller Renderings to Render

I'm running into an issue where it seems that Controller Renderings are not being rendered by our install of Sitecore 9. This is on a fresh install of 9. I've gone through tutorials on various sites stepping through the creation of Controller Renderings (in hopes I was doing something wrong), have fiddled around with the Controller name (include just the name, do the whole namespace, do the whole namespace with the assembly after it, etc). I've tried making the Controller inherit from just Controller, tried making it inherit from SitecoreController. I've tried without a view (returning just Content) and with a view. No luck.
What's more, I get no error, which I believe is unexpected. I can put anything I want into the Controller name, any string of garbage text, include this as a control inside a content item placeholder, publish it and I just get a blank screen. I can even revert the site back to where it was before I deployed any development code out to it, in essence returning it to the site provided by SIF and I get no error with my garbage controller rendering.
Has anyone experienced issues with Sitecore 9 and Controller Renderings? At the least, I was assuming I'd at least get thrown some error if I was setting up the rendering wrong.
Any help is appreciated.
Thanks much.
Well. Nevermind. But here's a great and obvious tip for anyone who comes after me. The SIF website sample layout is a webforms layout. Obviously, you cannot just drop a controller rendering or a view rendering into that. You have to drop it into a razor layout as there's no mixing MVC and webforms.
Didn't see it as the sample layout is not in our development project. But also would have loved to get some kind of error.
Stupid mistake. But maybe it'll help somebody else.

django-tinymce modern theme

I'm having issues getting the modern theme to work with django-tinymce. Both the simple and the advanced themes render correctly, but when I switch to the modern theme nothing renders and I get a 404 error for /static/tiny_mce/themes/modern/editor_template.js in the console
I am attempting to do all of this in the django admin. The error is coming from /static/tiny_mce/tiny_mce.js which is interesting because I don't have anything installed in that directory. I'm using /static/js/tinymce as my TINYMCE_JS_ROOT in settings.py. When switching between simple and advanced theme, everything works correctly.
I've tried to copy a version of editor_template.js in the exact location it's looking, but I still get the 404. It's like it wipes out /static/tiny_mce if it exists and replaces it with something, but I can't figure out how/where it's getting that from.
I'm using an install of TinyMCE 4.1.3 from http://www.tinymce.com/download/download.php and django 1.6.5
I've been struggling with TinyMCE recently, as well. I'm using TinyMCE v4 and Django 1.6. I went down the django-tinymce/django-flatpages-tinymce route because I had these working on another project. Some how it wasn't working for this new project. I did some research and decided to just go straight TinyMCE, no Django applications (eg, no django-tinymce or django-flatpages-tinymce).
This method cuts down on all configuration in Django, and it can be completely handled within the tinymce.init call. I found this much easier than dealing with Django's settings files, overriding models, etc. Just simply find the template you want TinyMCE to spice up and add the init call there.
The example here for full featured example really helped me:
http://www.tinymce.com/tryit/full.php
This use the modern theme...
I simply added this to whichever change_form.html template for whatever model I was needing the rich editor. For instance for flatpages:
admin/flatpages/flatpage/change_form.html
Or custom model in app:
admin/custom_app/model_name/change_form.html
I know this is exactly an answer to your question, but I think it's worth thinking about and might help you ultimately get what you need.
Also, I should note, it looks like only modern theme is available for TinyMCE v4:
http://www.tinymce.com/wiki.php/Tutorial:Migration_guide_from_3.x

Django-CMS sometimes cannot publish a page

I have a site in Django-CMS 2.4.1. I often go into the admin panel and change a page there, e.g. dragging a plugin from one placeholder to another, or just change the details of a plugin.
If I press "Publish draft" straight after this, I often get an error:
PublicIsUnmodifiable: The public instance cannot be published. Use draft.
Alternatively, sometimes I am told that I cannot submit the form as the slug is already taken (by the same page).
I have found that if I navigate away, come back, make the changes again, and press "Save and continue editing", and only then "Publish draft", it often works - but not always.
Also, I have found that I often cannot delete plugins from pages.
Has this happened to anyone else? Has my database somehow become corrupted?
Sorry I can't be more specific, but I thought I'd ask in case others have had the same problem. I am still trying to work out the pattern. The new management command cms check doesn't detect anything wrong.
One thought - I am using mptt version 0.5.5, which is higher than that loaded automatically by Django-CMS (which uses 0.5.2).

How to replace ManytoMany widget against an iPad compatible widget?

Personally I don't think Django's built-in widget for ManyToManyField relationship is particularly good. Especially when it comes down to use it on an iPad, the widget is neither intuitive nor practical (you have no ctrl button to hold down to multi select).
So I am battling this issue now for one week, trying to make a formset with forms that include each a dropdown.
My attempts to achieve the solution above, have also been fruitless so far.
So I thought maybe its a good time to take a step back and ask the community:
What would you do in my shoes? If you were given a requirement like this, how would you replace the M2M widget? What options do I have?
I just found out about the admin M2M widget according to this question on Stackoverflow.
django.contrib.admin.widgets.FilteredSelectMultiple
It is a bit big and not very pretty, but would do the job.
I have found this tutorial and followed every step. But the widget is still showing as a plain M2M widget instead of the admin one. The css and js are loaded correctly (no indication of 404) but still the old widget shows up.
Many Thanks,
Try using chosen library. You can download it from here: http://harvesthq.github.com/chosen/.
To integrate it with django try django-chosen application. You could install it from PIP or directly download sources from github.

django on apache - admin page links are VISIBLE but not CLICKABLE

I have just deployed a django site, and upon changing the value my DEBUG variable to 'False' causes my admin page links to change from active links to simple text.
An attempt to go directly to what I know should be the URL causes a 'TemplateDoesNotExist'.
I am sure it's not a permissions issue with Apache, I feel it is something to do with my admin configuration though I have no idea what.
I figured it out. Here is a reference for anyone else who might find themselves with this problem.
I was using what must be a deprecated method of defining my Admin models - I put them all in models.py, instead of creating a separate admin.py file for each application.
When learning django, there are plenty of tutorials floating around that recommend or give examples that use this method. Apparently this is no longer a good idea (at least not as of Django 1.4). It could probably be wrangled into working with some template hacking, but it is is probably cleaner and definitely simpler to just follow the latest conventions and create the admin.py file.
I thought I was saving time by just cramming it all into one file "for now" but without some of the magical debug-only template loading, this solution failed.
Hope this saves someone some frustration!
I know this question's been already solved.
But in my case, coming from django 1.7 to a server that runs django 1.6, I had to add
admin.auto_discover()
to my urls.py.
Well, I had added this line to the end of urls.py and django admin was all characters !
Moving it to top up the file, above definition of urlpatterns, fixed the issue.
Hope this helps :)