On 2/7/11 5:29 PM, Ian Stokes-Rees wrote:
> This sounds good.  Form Preview could be useful, but right now I just
> want to be able to use Generic Views (DetailView.as_view()) to render
> the default context object using "as_table()", but I'm failing to do that.
>
> {{ object.as_table }} returns nothing, whereas, {{ object.name }} etc.
> works just fine.  I don't understand why object.as_table wouldn't
> work.  Below are some code fragments.

I think I can answer my own question: as_table() is a method of
ModelForm objects, not Model objects.  So I tried pointing DetailView at
WSMRTaskForm, but now I get the exception:

type object 'WSMRTaskForm' has no attribute '_default_manager'


Frustrating!  Any suggestions?  It doesn't seem unreasonable to want the
DetailView to be able to render the "default" tabular view of the Model
created by:

class WSMRTaskForm(ModelForm):
    class Meta:
        model = WSMRTask

Thanks,

Ian

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to