Changes between Initial Version and Version 1 of Ticket #29701


Ignore:
Timestamp:
Aug 22, 2018, 8:51:48 AM (6 years ago)
Author:
Harm Verhagen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29701 – Description

    initial v1  
    1 I noticed that  using {{has_add_permission()}} on a admin.TabularInline  fails.
     1I noticed that  using {{{has_add_permission()}}} on a {{{admin.TabularInline}}}  fails.
    22
    33
     
    77
    88models.py
    9 {code}
     9{{{
    1010class ModelA(models.Model):
    1111    name = models.CharField(max_length=2)
     
    2727    def __str__(self):
    2828        return "%s-%s" % (self.a, self.b)
    29 {code}
     29}}}
    3030
    3131admin.py
    32 {code}
     32{{{
    3333class ThroughInline(admin.TabularInline):
    3434
     
    4949class ThroughAdmin(admin.ModelAdmin):
    5050    pass
    51 {code}
     51}}}
    5252
    5353Then create your objects.
    54 {code}
     54{{{
    5555>>> from <yourapp>.models import ModelA, ModelB, Through
    5656>>> a = ModelA.objects.create(name='a')
    5757>>> b= ModelB.objects.create(name='b')
    5858>>> t = Through.objects.create(a=a, b=b)
    59 {code}
     59}}}
    6060
    6161Fire up a runserver and visit the admin api: http://localhost:8000/admin/<yourapp>/modela/1/change/
     
    6464
    6565A server 500
    66 {code}
     66{{{
    6767KeyError at /admin/<appname>/modela/1/change/
    6868
     
    116116  83.         content = template.render(context, self._request)
    117117
    118 {code}
     118}}}
    119119
    120120h3. expected result
     
    123123
    124124h3. version
    125 {{Django==2.1}}
     125{{{Django==2.1}}}
Back to Top