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

  • SEARCH
  • Home
  • 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 8499017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:33:26+00:00 2026-06-11T00:33:26+00:00

Hi Stackoverflow people, I am working with class based views and for a test

  • 0

Hi Stackoverflow people,

I am working with class based views and for a test site, I followed the documentation to setup the class based views.
For a project site (based on the project model below), I just want to create a quick CRUD application for the simple project model below.

models.py

class Project(models.Manager):
    name =  models.CharField(_('Name of the Project'), max_length = 100,)
    slug = models.SlugField(max_length=100,)
    ...

views.py

from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from project.models import Project

class ProjectCreate(CreateView):
    model = Project

class ProjectUpdate(UpdateView):
    model = Project

When I now load \project\add, which should call the ProjectCreate class, I get the following error:
type object ‘Project’ has no attribute ‘_meta’

I do not understand why. The model class normally does not require meta information. In other class based projects, I did not encounter this problem.

Thank you for your suggestions!

Traceback

Django Version: 1.4.1
Python Version: 2.7.1

Traceback:
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/views/generic/base.py" in view
  48.             return self.dispatch(request, *args, **kwargs)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  69.         return handler(request, *args, **kwargs)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/views/generic/edit.py" in get
  168.         return super(BaseCreateView, self).get(request, *args, **kwargs)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/views/generic/edit.py" in get
  130.         form_class = self.get_form_class()
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/views/generic/edit.py" in get_form_class
  89.             return model_forms.modelform_factory(model)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/forms/models.py" in modelform_factory
  407.     return form_metaclass(class_name, (form,), form_class_attrs)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/forms/models.py" in __new__
  206.                                       opts.exclude, opts.widgets, formfield_callback)
File "/Users/neurix/Development/vir_project_2.0/lib/python2.7/site-packages/django/forms/models.py" in fields_for_model
  146.     opts = model._meta

Exception Type: AttributeError at /project/add/
Exception Value: type object 'Project' has no attribute '_meta'
  • 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-06-11T00:33:28+00:00Added an answer on June 11, 2026 at 12:33 am

    Change:

    class Project(models.Manager)
    

    to:

    class Project(models.Model)
    

    because models.Model is actual class you must extend to create custom models, and managers are actually used to override database operations models are involved in.

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

Sidebar

Related Questions

In the project im working on, people wrote services class to access DAO. Almost
Hi people stackoverflow. I'm working with MVVM, I have ViewModel call UserViewModel with a
Hi Stackoverflow people, I am working on an organisation registration, in which orgs can
Hi Stackoverflow people, What is the best way to refer from one model to
I finally got cython working thanks to some of the people here on stackoverflow,
Hello wonderful people of stackoverflow! I have a problem. I am working on an
I'm working on StackQL.net , which is just a simple web site that allows
Hi Stackoverflow people, I am implementing the MarkerCluster function for google map markers. I
Hello stackoverflow people! I've got a problem which I haven't been able to solve
Hi Stackoverflow people, I would like to change the m2m widget in the admin

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.