def addCategory(request):
    user = users.get_current_user()
    if users.is_current_user_admin():
        if request.method == 'POST':
            form = CategoryForm(request.POST)
            if form.is_valid():
                cd = form.cleaned_data
                Category.objects.create_category(cd['name'])
                return HttpResponseRedirect('/admin/dashboard/')
        else:
            form = CategoryForm()
            temdict = {'form': form, 'title': 'New Category'}
            return render_to_response('new_category.html', temdict)
    else:
        return render_to_response('not_admin.html', {'admin': 'no'})
and this is my model models.py

class Category(db.Model):
    catid = db.IntegerProperty(required=True)
    name = db.StringProperty(required=True)

    def get_absolute_url(self):
        return "/tag/%s/" % str(self.catid)

    class Meta:
        verbose_name = 'Category'
When I'm running the code it shows:

Exception Type: AttributeError
Exception Value:
type object 'Category' has no attribute '_meta'
Exception Location: D:\shwetanka\projects\shwetanka\django\forms
\models.py in fields_for_model, line 166
Python Executable:  C:\Python26\pythonw.exe

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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.

Reply via email to