Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1112991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:47:25+00:00 2026-05-17T02:47:25+00:00

This is my code for views.py def addCategory(request): user = users.get_current_user() if users.is_current_user_admin(): if

  • 0

This is my code for views.py

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

Please help me out.I’m using django with gae.
This is forms.py

class CategoryForm(forms.ModelForm):
    name = forms.CharField(label='Category', widget=forms.TextInput(attrs={'size':50}))

    class Meta:
        model = Category
        fields = ['name']

Here is the complete stack trace. http://dpaste.com/251985/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:47:25+00:00Added an answer on May 17, 2026 at 2:47 am

    Django does not support GAE currently. You have to use patched Django, for example, http://www.allbuttonspressed.com/projects/djangoappengine and then rewrite your model using standard django db model (currently you are using GAE one). However djangoappengine does not provide 100% compatibility.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my views.py, i have a snippit of code like this: def clean_post_data(form): for
I used this code in my users views and had no trouble: <% if
I'm currently doing something like this in my views.py: def home(request): ingredients = Ingredience.objects.all()
This code works (when ControlType=dropDown then the background yellow ): <Window x:Class=TestCollapsed.Views.MainView xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
I have this code in PHP writing views to a text-file and just increasing
I have this code which adds a x number of views to a Multiview
views.py: def register(request): flag = True possible = '0123456789abcdefghijklmnopqrstuvwxyz' token = '' tempToken =
I want this code to display list of friends of a user, list of
Very confused about this one. This code in views.py works, but only when I'm
I have this code: class Mailer < ActionMailer::Base def foo recipients bar@example.com from foo@example.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.