Current version on Haystack (2.10) combined with Elasticsearch produces weird results when you want to sort search results on charfield, the issue has been reported here https://github.com/toastdriven/django-haystack/issues/866 and here: https://github.com/toastdriven/django-haystack/issues/569

I'm a big fan of fighting with Drupal's inefficiencies and bottlenecks. Most of these come from contrib modules. Everytime we install a contrib module we should be ready for surprises which come on board with the module.

To make haystack search pager place nicelly with other get parameters, we can do something like this:

To make Django messages look nice in your bootstrap 3 template you need two things:

Drupal Views offers us a cool feature: ajaxified pagers. When you click on a pager, it changes the page without reloading the main page itself and then scrolls to the top of the view. It works great, but sometimes you may encounter a problem: if you have a fixed header on your page (the one that stays on top when you scroll the page) it will overlap with the top of your view container thus scroll to top won't work preciselly correct and the header will cover the top part of your view.

Media and static files won't be served in devel mode untill you put this at the end of the main urls.py file:

Run this line in order to start Django project by using Two Scoops of Django Project Template

It appears that Django Taggit doesn't support transliteratable tags, what we need to do is to add such support, how you may ask? We should use proxy models. Just add this piece of code to, let's say, ru_taggit.py file:

When Solr Thumbnail (https://github.com/mariocesar/sorl-thumbnail) returns and error like "SuspiciousOperation: Attempted access to '/media/products/505.jpg' denied" or Bad request: 400 you need to check the path of the image you want to resize: it shouldn't start with your MEDIA_ROOT like  '/media/products/505.jpg'.

Debugging python code is extremelly simple and powerfull. Just use ipdb for this purposes:

pip install ipdb

Then open up your code and in the place where you need code to stop insert this:

Pages

Subscribe to TimOnWeb RSS