Inlines javascript does not seem to work

13 views
Skip to first unread message

Wim Feijen

unread,
Dec 21, 2015, 9:31:27 AM12/21/15
to Mezzanine Users
Hi people,

On a fresh Mezzanine installation, the button for adding inlines does not appear in my installation.

What happens is that I see four forms and no button to add more. More-over, the fourth form does not work but seems to be a pre-cursor which should have been added by javascript. Screenshots are enclosed. Any idea what could be going wrong?

My models:
books/models.py:

from django.db import models
class Author(models.Model):
   name
= models.CharField(max_length=100)
class Book(models.Model):
   author
= models.ForeignKey(Author, on_delete=models.CASCADE)
   title
= models.CharField(max_length=100)


books
/admin.py:

from django.contrib import admin

from .models import Book, Author
   
class BookInline(admin.TabularInline):
    model = Book
   
class AuthorAdmin(admin.ModelAdmin):
    inlines = [
        BookInline,
    ]

admin.site.register(Author, AuthorAdmin)





(test)django@vps2048:~/projects/testmez$ pip freeze
Django==1.8.7
Mezzanine==4.0.1
Pillow==3.0.0
argparse==1.2.1
beautifulsoup4==4.4.1
bleach==1.4.2
chardet==2.3.0
distribute==0.6.24
django-contrib-comments==1.6.2
filebrowser-safe==0.4.0
future==0.15.2
grappelli-safe==0.4.1
html5lib==1.0b8
oauthlib==1.0.3
pytz==2015.7
requests==2.9.0
requests-oauthlib==0.6.0
six==1.10.0
tzlocal==1.2
wsgiref==0.1.2


Screenshot from 2015-12-21 15:21:54.png
Screenshot from 2015-12-21 15:21:43.png

Ryne Everett

unread,
Dec 21, 2015, 9:35:20 AM12/21/15
to Mezzanine Users
Are there any javascript errors?

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eduardo Rivas

unread,
Dec 21, 2015, 9:38:44 AM12/21/15
to mezzani...@googlegroups.com
Try importing and using mezzanine.core.admin.TabularDynamicInlineAdmin
instead of Django's default inlines.

Eduardo Rivas

unread,
Dec 21, 2015, 9:40:51 AM12/21/15
to mezzani...@googlegroups.com
Sorry, to be clear, the BookInline class should subclass
TabularDynamicInlineAdmin instead of admin.TabularInline.

Wim Feijen

unread,
Dec 21, 2015, 9:46:38 AM12/21/15
to mezzani...@googlegroups.com
Thanks Eduardo!

That solves it. :)

On 21 December 2015 at 15:40, Eduardo Rivas <jeriva...@gmail.com> wrote:
Sorry, to be clear, the BookInline class should subclass TabularDynamicInlineAdmin instead of admin.TabularInline.


--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/S9-9W9vzTK4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Wim Feijen
Eigenaar

Tussen kerst en oud en nieuw zijn wij gesloten.

Go2People Websites
Nieuwe Herengracht 49
1011 RN Amsterdam

T:  020 737 0378 / 06 1111 3316 
Reply all
Reply to author
Forward
0 new messages