Re: Cache middleware problem

2014-12-18 Thread Andreas Kuhne
Add a never cache decorator to the view that does the deleting (and perhaps to the view that lists the items). Then you shouldn't have any problems and you can still use the cache middleware. See https://docs.djangoproject.com/en/1.6/topics/cache/ Regards, Andréas 2014-12-19 5:07 GMT+01:00 T

Cache middleware problem

2014-12-18 Thread T Kwn
I have a list view where I can add or delete objects. I found that if the cache middleware is included: 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware' The page doesn't operate properly. Basically deleted objects don't always disappear. Added

Re: Database queries location

2014-12-18 Thread Lachlan Musicman
I usually put those functions in the view cheers L. On 19 December 2014 at 08:12, pythonista wrote: > I understand that functions can be placed in the models fille > > However if I have complex queries that receive post input does the > > > Query live in the model

Database queries location

2014-12-18 Thread pythonista
I understand that functions can be placed in the models fille However if I have complex queries that receive post input does the Query live in the model the views or an external module -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Webcomponents in Django

2014-12-18 Thread Peter of the Norse
On 11/19/2014 7:18 AM, Timothy W. Cook wrote: then the designer-element.html is imported: href="elements/designer-element/designer-element.html"> Here's your problem. This is a relative link, so the current directory gets used as the base, and it tries to load

Re: eCommerce Search

2014-12-18 Thread Patti Chen
You can use haystack(http://haystacksearch.org/) to communicate with search engines. On Thu, Dec 18, 2014 at 5:20 AM, Jonathan Baker wrote: > Also, check out: https://github.com/alex/django-filter > > On Wed, Dec 17, 2014 at 2:11 PM, John Rodkey

ModelAdmin with inlines: How to learn if/what has changed before the models are saved?

2014-12-18 Thread Carsten Fuchs
Hi fellow Django developers, using a model with several related models, for the Django Admin I have a ModelAdmin that uses several InlineModelAdmin objects, very much as in the example at . All works well,

Re: ANN: Django website redesign launched

2014-12-18 Thread Thomas Leo
The new Design looks great! Awesome job! One thing I really like about https://docs.python.org/3/ is the ability to show/hide the side bar. The new design features a very large sidebar, being able to toggle it would be awesome. Also as previously mentioned trac doesn't look right yet. On

Optimizing has_perm query time on PERMISSION AND GROUP PERMISSION

2014-12-18 Thread mohd irshad
Hello , I am constantly facing face max cpu usage problem because of few database (postgres) heavy query has_perm is one of them. how can I optimized such query. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Raw access to cache table

2014-12-18 Thread François Schiettecatte
Hi I use fcntl.flock() from the fcntl module. I have used this method in C, Perl and Python, works great. Happy to share code. François > On Dec 18, 2014, at 9:24 AM, Javier Guerra Giraldez > wrote: > > On Thu, Dec 18, 2014 at 6:20 AM, Erik Cederstrand >

change_list html template filter block inject a css class

2014-12-18 Thread Damjan Dimitrioski
Hi, the following block of code is an excerpt from change_list.html template: {% block filters %} > {% if cl.has_filters %} > > {% trans 'Filter' %} > > > > {% for spec in cl.filter_specs %} > {% if "somefilter" in

Re: Raw access to cache table

2014-12-18 Thread Javier Guerra Giraldez
On Thu, Dec 18, 2014 at 6:20 AM, Erik Cederstrand wrote: > I'm using Django as a hub to synchronize data between various external > systems. To do this, I have some long-running Django management commands that > are started as cron jobs. To ensure that only one job is

Re: Raw access to cache table

2014-12-18 Thread Avraham Serour
I implemented a network lock using redis, the module had some other functionalities, but the basic lock class was: class Lock(): """ Regular behavior lock, works across the network, useful for distributed processes """ def __init__(self, name): self.redis =

Re: Raw access to cache table

2014-12-18 Thread Vijay Khemlani
I'm not sure that using a cache system as a lock mechanism is a good idea. What I would do is setup a task queue (using celery and rabbitMQ) with a single worker, that way you guarantee that only one task is running at a time and you can queue as many as you want. Also, each task has a maximum

Re: Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Frankline
Nicely answered. Thanks Andreas. On Thu, Dec 18, 2014 at 3:27 PM, Andreas Kuhne wrote: > > Hi Frankline, > > You can only reference variables in the templates directly with the > blocktrans tag. See >

Re: Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Andreas Kuhne
Hi Frankline, You can only reference variables in the templates directly with the blocktrans tag. See https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#blocktrans-template-tag. So you have to use the "with" statement on blocktrans to access properties of a class. Regards, Andréas

Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Frankline
Hi all, I recently had a weird problem in my django templates regarding evaluating variables within a blocktrans, but I finally figured it out. I guess I just want to know the reason why it worked, an explanation sort of. THIS DID NOT WORK {% blocktrans %}Approve all {{ objects.count }} users{%

Raw access to cache table

2014-12-18 Thread Erik Cederstrand
Hi list, I'm using Django as a hub to synchronize data between various external systems. To do this, I have some long-running Django management commands that are started as cron jobs. To ensure that only one job is working on a data set at any one time, I have implemented a locking system

Django Multiple ForeignKey Navigation

2014-12-18 Thread Rodney Lewis
Hey All; Sorry my question yesterday was poorly assembled. I'm trying again. Please take a look: https://stackoverflow.com/questions/27543962/django-multiple-foreignkey-navigation Thank you so much for any help! -- Rodney Lewis http://www.youtube.com/pyrodney -- You received this message