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 6648125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:37:06+00:00 2026-05-26T00:37:06+00:00

Trying to edit object permissions using django-guardian in the admin site I get this

  • 0

Trying to edit object permissions using django-guardian in the admin site I get this error.

Caught VariableDoesNotExist while rendering: Failed lookup for key [adminform] in u'[{}, {\’csrf_token\’: }, {\’debug\’: True, \’sql_queries\’: [{\’stacktrace\’:…

Template error

In template /Library/Python/2.7/site-packages/grappelli/templates/admin/change_form.html, error at line 34

The line where the error occurs.

var related_lookup_fields_fk = {% get_related_lookup_fields_fk adminform.model_admin %};    

I’m using grappelli and south if that makes any difference.

My model

class Alert(models.Model):
    """Alert for product updates"""
    product = models.ForeignKey(Product)
    message = models.CharField(help_text="What has changed?",blank=True, max_length=200)
    created = models.DateTimeField(auto_now_add=True, editable=False)
    updated = models.DateTimeField(auto_now=True, auto_now_add=True, editable=False)    

    def __unicode__(self):
        return u"%s" % self.message

    class Meta:
        ordering = ['-created']
        permissions = (
            ('view_alert', 'View Alert'),
        )

Admin.py

class AlertAdmin(GuardedModelAdmin):
    pass
admin.site.register(Alert, AlertAdmin)
  • 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-26T00:37:06+00:00Added an answer on May 26, 2026 at 12:37 am

    grappelli is the key here.

    This is related issue #51 (https://github.com/lukaszb/django-guardian/issues/51) which was fixed with https://github.com/lukaszb/django-guardian/commit/a21b044711266534eaef5e58397d0701ec101058.

    Unfortunately, I haven’t released new django-guardian yet so you can try using pip to install package directly from github:

    pip install -e git+git://github.com/lukaszb/django-guardian.git@a21b044711266534eaef5e58397d0701ec101058#egg=django-guardian-1.0.4.dev
    

    Hope that helps.

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

Sidebar

Related Questions

I'm trying to get edit-and-continue working with Visual Studio 2008 with an ASP.Net MVC
I'm trying to enter edit mode on a specific cell like this: void MainWindow::on_addButton_released()
I am trying to get the Edit with Vim context menu to open files
I am trying edit the header cell value when using a grid view in
Im using Struts2 and Hibernate, trying to create a simple form to edit an
I'm trying to edit a CoreData object when a user clicks on a cell
im trying to edit a field using code instead of the wizard. im not
I am trying to edit this code so that instead of just inserting the
I am trying to edit a word document from VB.NET using for the most
I'm trying to edit an existing object through a form. Every thing is working

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.