Opened 5 years ago

Closed 5 years ago

#13650 closed (invalid)

Permissions of abstract model without fields not added on syncdb

Reported by: deschler Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: eschler@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've got an abstract model which has no fields and only defines permissions. The permission isn't added to the auth_permission table on syncdb nor is the content_type added to django_content_type. The app is in INSTALLED_APPS.

class Base(models.Model):

class Meta:

abstract = True
permissions = (

("can_do_foo", _(u"Can do foo")),

)

Is this a bug or am i missing something? I'm using django-1.2.1.

Change History (3)

comment:1 Changed 5 years ago by deschler

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
class Base(models.Model):
    class Meta:
        abstract = True
        permissions = (
            ("can_do_foo", _(u"Can do foo")),
        )

comment:2 Changed 5 years ago by anonymous

  • Cc eschler@… added

comment:3 Changed 5 years ago by russellm

  • Resolution set to invalid
  • Status changed from new to closed

Yes - you are missing something. The model is abstract. That means it doesn't exist. As soon as you define a concrete subclass, the permissions, content type etc will be created for that concrete subclass; depending on how you have subclassed the concrete class, the permissions etc will be inherited.

Note: See TracTickets for help on using tickets.
Back to Top