Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override foreign_key_lookups with checkbox or multiple selection #120

Open
beebek opened this issue Jan 20, 2014 · 0 comments
Open

override foreign_key_lookups with checkbox or multiple selection #120

beebek opened this issue Jan 20, 2014 · 0 comments

Comments

@beebek
Copy link

beebek commented Jan 20, 2014

class Organization(db.Model):
    name = CharField()

    def __unicode__(self):
        return self.name


class Privilege(db.Model):
    name = CharField()

    def __unicode__(self):
        return self.name

class PrivilegeAdmin(ModelAdmin):
    columns = ('privilege_name')


class Role(db.Model):
    organization = ForeignKeyField(Organization)
    privilege = ForeignKeyField(Previlige)

class RoleAdmin(ModelAdmin):
    foreign_key_lookups = {'privilege': 'name'}

I am finding it difficulty to create a individual privilege for individual role. Instead is there a way so that the foreign_key_lookups can have multiple selection or checkbox.
e.g. role = admin, reporter, article_writer
privilege = menu1, menu2, menu3, menu4, menu5

Present setting will allow me to select each privilege at a time, requiring 5 individual 'save'.
Is there a way out to override the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant