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

Not seeing category fields in admin? #79

Open
heymarkreeves opened this issue Nov 15, 2013 · 5 comments
Open

Not seeing category fields in admin? #79

heymarkreeves opened this issue Nov 15, 2013 · 5 comments

Comments

@heymarkreeves
Copy link

I installed (pip) django-categories today, and added a field in my model:

categories = models.ManyToManyField('categories.Category', blank=True, null=True)

before running syncdb.

I have Categories in my admin, and I'm not seeing any file errors for treeTable or expand/collapse files, but I'm only seeing 1 level deep:

http://www.circa1977.net/snap/admin-categories.png

In the source for the page, I can see the child rows, but they don't show in the admin. Nor does a expand/collapse toggle.

The following doesn't seem to be true, either. I'm using fieldsets, and the categories field only shows up if I include it in the fieldsets in my ModelAdmin.

https://django-categories.readthedocs.org/en/latest/admin_settings.html

I'm using Django 1.6.

Should I be seeing something else in the admin? How do I enable the treeview + checkboxes described in the docs?

Thanks!

Mark

@heymarkreeves
Copy link
Author

I do have categories.editor installed as well.

@heymarkreeves
Copy link
Author

Django 1.6 includes jQuery 1.9.1 in the admin. It looks like treeTable.js needs to be updated in django-categories to be compatible.

I'm currently working on trying to get jQueryMigrate included.

@heymarkreeves
Copy link
Author

I've overridden change_list.html to try jQueryMigrate or specify jQuery 1.8.3 to no avail. Something in treeTable.js just isn't enhancing the table. I can force expanded view within the tree_editor.html template and see all the rows, but the expand/collapse toggles are never revealed.

@heymarkreeves
Copy link
Author

This was purely an issue with how treeTable.js and treeTable.css are working. Specifically, line 427 of treeTable.js needed the negative margin-left inline style removed. I then tweaked column & .expanded width values in treeTable.css to see things properly.

@mnestor
Copy link

mnestor commented Jan 9, 2014

The simple fix:

Put:
.treeTable td:nth-of-type(1) {
padding-left: 21px;
padding-right: 10px;
}

in: editor/static/editor/jquery.treeTable.css

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

2 participants