the whole object tools depend on has_add_permission

2013-05-15 Thread Hadi Sunyoto
what i want to do:
i want to add link beside add object in change_list.html
the link will be displayed only to selected groups

what i do is overriding the change_list.html block object-tools

from: change_list.html

{% block content %}
  
{% block object-tools %}
  {% if has_add_permission %} <-- pos 1
 <-- pos 2
  {% block object-tools-items %} <-- pos 3

  
{% blocktrans with cl.opts.verbose_name as name %}Add {{ 
name }}{% endblocktrans %}
  

  {% endblock %}

  {% endif %}

But it seems that ul position should be in pos 1, and {%if 
has_add_permission %} should be in pos 3, while {% block object-tools-items 
%} should be in pos 2.

By having the current change_list, overriding object-tools-items, the link 
will be displayed ONLY has_add_permission, but that is not what i want

Is this a bug in change_list.html? i hope i make myself clear. thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django development server timeout too quick

2013-04-24 Thread Hadi Sunyoto
The problem is like this:

i am using django admin, and in several forms, it might take around 10-20 
minutes to fill up.
By the time save button is pressed, i am always redirected to login page.

The question is: how can i make the timeout longer (or maybe last forever)

I set the cache to file and session_engine to db

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': 'some/path',
'TIMEOUT': 10,
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"

What else am i missing here? any direction will be much appreciated

i also have tried to set --noreload in runserver so that file changed does 
not get reloaded, but i still get the same problem.

i don't plan on using apache/ngix/etc because this is only for my personal 
use

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.