I'm having a similar problem actually. I'm trying to extend Photologue to offer front-end user upload capability with generic views and I haven't been able to successfully render a page yet. Each of the commented-out "upload_args" are variations I've tried to get something back and none of them have worked.
urls.py #upload_args = {'model': Photo } #upload_args = {'model': Photo, 'template_name':'photologue/ photo_upload.html' } #upload_args = {'form_class':UserPhotoUploadForm } #upload_args = {'form_class':UserPhotoUploadForm, 'template_name':'photologue/photo_upload.html' } upload_args = dict(form_class=UserPhotoUploadForm) urlpatterns += patterns('django.views.generic.create_update', url(r'^photo/upload/$', 'create_object', upload_args ), ) I continue to get this kind of cryptic error: Page not found (404) Request Method: GET Request URL: http://localhost/photologue/photo/upload/ No <django.utils.functional.__proxy__ object at 0x89eecac> found matching the query Any help or guidance would be greatly appreciated! :o) On Jul 27, 7:26 pm, djangonoob <ye.eug...@gmail.com> wrote: > hi, > in my urls.py i have imported the MyFormClass from models.py > > However i am still receiving the error 'NoneType object is not > callable' > > What else do i need to import? > > Here is the things i have imported in urls.py > > #urls.py > from django.conf.urls.defaults import * > from django.conf import settings > from mycompany.press.models import MyForm, MyFormClass > from mycompany.press import views > import datetime > import os > from django.forms import ModelForm > from django.views.genericimport create_update > > Best Regards > > On Jul 27, 7:07 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote: > > > First, of course you should separate that code, and form classes usually > > go in forms.py, models in models.py. > > Second, you are getting a 'NoneType object is not callable' beacause of > > what you have in urls.py. Look at that carefully and you'll figure it out. > > > djangonoob wrote: > > > oh by the way, > > > i've tried your method and i received the error: > > > > 'NoneType' object is not callable > > > > May i know how do i solve this issue? > > > > Best Regards, > > > Eugene > > > > On Jul 27, 12:15 pm, Vasil Vangelovski <vvangelov...@gmail.com> wrote: > > > >> First you create a ModelForm: > > > >> from django.forms import ModelForm > > >> from myproject.myapp.models import MyModelClass > > > >> class MyFormClass(ModelForm): > > >> class Meta: > > >> model = MyModelClass > > > >> there you have your form_class that you need to pass to the view you > > >> want: > > > >> ‘django.views.generic.create_update.update_object’, > > >> dict(form_class=MyFormClass) > > > >> see: > > > >>http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#topics-... > > > >>> Hi all, > > >>> I am wondering how can i use form_class withgenericviews? > > > >>> FOr example, according to the online > > >>> doc,http://docs.djangoproject.com/en/dev/ref/generic-views/ > > >>> we can use form_class as a required argument forcreate_object, > > >>> update_object, delete_object > > > >>> But the online doc stopped short on how to use the form_class. > > > >>> Is there anyone woh has a simple example on how to use form_class as a > > >>> required argument forgenericviews? > > > >>> Thanks alot! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---