Re: Generic delete view.

2008-07-10 Thread William

Thanks, that was the issue. I looked back at the generic view
tutorial, and saw the code was structured slightly differently, which
allowed them to put the view in a string.
I also found this post in django-dev, which might be the one that you
saw earlier referencing generic views+newforms:
http://groups.google.com/group/django-developers/browse_thread/thread/618f7582c5e225ce/c3f254bc3559dfdc

Thanks!

On Jul 9, 12:04 pm, Rob Hudson <[EMAIL PROTECTED]> wrote:
> It took me a minute to see it, but "str object not callable" is
> referring to the fact that your URL pattern is providing a string as
> its 2nd argument and "delete_object" (the string) cannot be imported
> and called.
>
> You can either:
>
> 1) Use the actual view you imported (i.e. remove the single quotes).
>
> 2) Specific the 2nd argument in the URL pattern as the full path to
> the delete view: "django.views.generic.create_update.delete_object"
>
> I saw a reference on Django devs mailing list that these will be
> updated *very soon* to use newforms.
>
> -Rob
>
> On Jul 8, 7:14 pm, William <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I'm having a bit of trouble using the deletegenericview in
> > Django SVN. I have the following entry in my urlpatterns:
> > from django.views.generic.create_update import *
> > urlpatterns = patterns('',
> > ...
> > (r'^calendar/delete/(?P\d+)/$','delete_object',
> > {'model':Event,'post_delete_redirect':'/calendar/'}),
> > ...
> > )
>
> > And in a template, I have the following hyperlink:
> > Delete Event
>
> > When I click on the link in the above template, I get the following:
> > TypeError at /calendar/delete/1/
> > 'str' object is not callable
> > /usr/lib/python2.5/site-packages/django/core/handlers/base.py in
> > get_response, line 86
>
> > I've tried various different ways of calling thisgenericview, but
> > none seem to work.
> > As a side note, is it worth usinggenericviews such as create and
> > update since they still use oldforms?
>
> > Thanks for any help.
--~--~-~--~~~---~--~~
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 view.

2008-07-09 Thread Rob Hudson

It took me a minute to see it, but "str object not callable" is
referring to the fact that your URL pattern is providing a string as
its 2nd argument and "delete_object" (the string) cannot be imported
and called.

You can either:

1) Use the actual view you imported (i.e. remove the single quotes).

2) Specific the 2nd argument in the URL pattern as the full path to
the delete view: "django.views.generic.create_update.delete_object"

I saw a reference on Django devs mailing list that these will be
updated *very soon* to use newforms.

-Rob

On Jul 8, 7:14 pm, William <[EMAIL PROTECTED]> wrote:
> Hi, I'm having a bit of trouble using the delete generic view in
> Django SVN. I have the following entry in my urlpatterns:
> from django.views.generic.create_update import *
> urlpatterns = patterns('',
> ...
> (r'^calendar/delete/(?P\d+)/$','delete_object',
> {'model':Event,'post_delete_redirect':'/calendar/'}),
> ...
> )
>
> And in a template, I have the following hyperlink:
> Delete Event
>
> When I click on the link in the above template, I get the following:
> TypeError at /calendar/delete/1/
> 'str' object is not callable
> /usr/lib/python2.5/site-packages/django/core/handlers/base.py in
> get_response, line 86
>
> I've tried various different ways of calling this generic view, but
> none seem to work.
> As a side note, is it worth using generic views such as create and
> update since they still use oldforms?
>
> Thanks for any help.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---