Re: generic delete_object issue on Firefox (redirect bug)

2008-04-29 Thread yml

Hello Koenb,
Thank you very much your workaround is working like a charm. I have
pasted below an example. In case someone else look for a solution to
this problem in the future. However this is close to witchcraft art. I
do not understand how FF can be aware that I am doing something in my
view with request.POST or not.
Does anyone has a rational explanation on why this work?

---8<---
@login_required()
def survey_delete(request,slug):
# TRICK: The following line does not have any logical explination
# except than working around a bug in FF. It has been suggested
there
# 
http://groups.google.com/group/django-users/browse_thread/thread/e6c96ab0538a544e/0e01cdda3668dfce#0e01cdda3668dfce
request_post = request.POST.copy()
return delete_object(request, slug=slug,
**{"model":Survey,
 "post_delete_redirect": "/survey/editable/",
 "template_object_name":"survey",
 "login_required": True,
 'extra_context': {'title': _('Delete survey')}
})
--->8---
Thank you

--yml

On Apr 28, 10:42 pm, koenb <[EMAIL PROTECTED]> wrote:
> The problem is FF does not like it if you do not consume the POST
> data.
> Just add the line
> request.POST
> somewhere in your view before redirecting.
>
> Koen
>
> On 28 apr, 17:33, yml <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > I noticed a very strange behavior with the generic view called :
> > "delete_object". The symptom is the following :
> >   * Firefox return an error message
> > ---8<---
> > The connection was reset
>
> > The connection to the server was reset while the page was loading.
>
> > *   The site could be temporarily unavailable or too busy. Try
> > again in a few
> >   moments.
>
> > *   If you are unable to load any pages, check your computer's
> > network
> >   connection.
>
> > *   If your computer or network is protected by a firewall or
> > proxy, make sure
> >   that Firefox is permitted to access the Web.
> > --->8---
> > It seems that the bug is in Firefox code. The same code is working
> > fine on IE 6.0 and Opéra, I am testing this on windows.
>
> > My code look like this (extracted form urls.py):
> > ---8<---
> >  url(r'^delete/(?P[-\w]+)/$', delete_object,
> > {"model":Survey,
> >  "post_delete_redirect": "/survey/editable/",
> >  "template_object_name":"survey",
> >  "login_required": True,
> >  'extra_context': {'title': _('Delete survey')}
> > },
> > name='survey-delete'),
> > --->8---
> > It would be nice if someone could help me with a workaround or a
> > solution.
>
> > Should I report issues in the django bug tracker ?
> > Thank you for your help.
> > --yml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic delete_object issue on Firefox (redirect bug)

2008-04-28 Thread koenb

Sorry;

forgot to add, you will need to wrap the generic view in a custom
wrapper view for that.



On 28 apr, 22:42, koenb <[EMAIL PROTECTED]> wrote:
> The problem is FF does not like it if you do not consume the POST
> data.
> Just add the line
> request.POST
> somewhere in your view before redirecting.
>
> Koen
>
> On 28 apr, 17:33, yml <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > I noticed a very strange behavior with the generic view called :
> > "delete_object". The symptom is the following :
> >   * Firefox return an error message
> > ---8<---
> > The connection was reset
>
> > The connection to the server was reset while the page was loading.
>
> > *   The site could be temporarily unavailable or too busy. Try
> > again in a few
> >   moments.
>
> > *   If you are unable to load any pages, check your computer's
> > network
> >   connection.
>
> > *   If your computer or network is protected by a firewall or
> > proxy, make sure
> >   that Firefox is permitted to access the Web.
> > --->8---
> > It seems that the bug is in Firefox code. The same code is working
> > fine on IE 6.0 and Opéra, I am testing this on windows.
>
> > My code look like this (extracted form urls.py):
> > ---8<---
> >  url(r'^delete/(?P[-\w]+)/$', delete_object,
> > {"model":Survey,
> >  "post_delete_redirect": "/survey/editable/",
> >  "template_object_name":"survey",
> >  "login_required": True,
> >  'extra_context': {'title': _('Delete survey')}
> > },
> > name='survey-delete'),
> > --->8---
> > It would be nice if someone could help me with a workaround or a
> > solution.
>
> > Should I report issues in the django bug tracker ?
> > Thank you for your help.
> > --yml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic delete_object issue on Firefox (redirect bug)

2008-04-28 Thread koenb

The problem is FF does not like it if you do not consume the POST
data.
Just add the line
request.POST
somewhere in your view before redirecting.

Koen

On 28 apr, 17:33, yml <[EMAIL PROTECTED]> wrote:
> Hello,
> I noticed a very strange behavior with the generic view called :
> "delete_object". The symptom is the following :
>   * Firefox return an error message
> ---8<---
> The connection was reset
>
> The connection to the server was reset while the page was loading.
>
> *   The site could be temporarily unavailable or too busy. Try
> again in a few
>   moments.
>
> *   If you are unable to load any pages, check your computer's
> network
>   connection.
>
> *   If your computer or network is protected by a firewall or
> proxy, make sure
>   that Firefox is permitted to access the Web.
> --->8---
> It seems that the bug is in Firefox code. The same code is working
> fine on IE 6.0 and Opéra, I am testing this on windows.
>
> My code look like this (extracted form urls.py):
> ---8<---
>  url(r'^delete/(?P[-\w]+)/$', delete_object,
> {"model":Survey,
>  "post_delete_redirect": "/survey/editable/",
>  "template_object_name":"survey",
>  "login_required": True,
>  'extra_context': {'title': _('Delete survey')}
> },
> name='survey-delete'),
> --->8---
> It would be nice if someone could help me with a workaround or a
> solution.
>
> Should I report issues in the django bug tracker ?
> Thank you for your help.
> --yml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



generic delete_object issue on Firefox (redirect bug)

2008-04-28 Thread yml

Hello,
I noticed a very strange behavior with the generic view called :
"delete_object". The symptom is the following :
  * Firefox return an error message
---8<---
The connection was reset

The connection to the server was reset while the page was loading.

*   The site could be temporarily unavailable or too busy. Try
again in a few
  moments.

*   If you are unable to load any pages, check your computer's
network
  connection.

*   If your computer or network is protected by a firewall or
proxy, make sure
  that Firefox is permitted to access the Web.
--->8---
It seems that the bug is in Firefox code. The same code is working
fine on IE 6.0 and Opéra, I am testing this on windows.

My code look like this (extracted form urls.py):
---8<---
 url(r'^delete/(?P[-\w]+)/$', delete_object,
{"model":Survey,
 "post_delete_redirect": "/survey/editable/",
 "template_object_name":"survey",
 "login_required": True,
 'extra_context': {'title': _('Delete survey')}
},
name='survey-delete'),
--->8---
It would be nice if someone could help me with a workaround or a
solution.

Should I report issues in the django bug tracker ?
Thank you for your help.
--yml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---