Giter Site home page Giter Site logo

jazzband / django-categories Goto Github PK

View Code? Open in Web Editor NEW
455.0 455.0 135.0 2.96 MB

This app attempts to provide a generic category system that multiple apps could use. It uses MPTT for the tree storage and provides a custom admin for better visualization (copied and modified from feinCMS).

License: Apache License 2.0

Python 69.93% CSS 2.26% JavaScript 15.37% HTML 7.19% Makefile 3.53% Batchfile 1.72%

django-categories's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-categories's Issues

Category and CategoryBase should be in separate apps

long version
After a few hours of bug hunting, I found out why my current translation is not loaded. I think, there is a problem with your directory structure:

For each app django loads the translations from the locale subdirectory. In my case, I only load the categories.editor app - so I only get the translations in categories/editor/locale. The problem is that categories.editor relies on stuff from the categories folder and those translations won't get loaded.

So did I get something wrong or should CategoryBase rather be a model in categories.editor (or something like categories.common) in order to be translated?

short version

  • to have the CategoryBase model translated its app has to be in INSTALLED_APPS
  • if one does not want the Category model, its app should not be in the INSTALLED_APPS

=> CategoryBase and Category should not be in the same app

current workaround
If you only want categories.editor put categories and categories.editor in INSTALLED_APPS and then unregister the Admin for Category:

admin.site.unregister(Category)

lazy connection, how does it work?

I have read about the lazy connection at the bottom of this link
https://django-categories.readthedocs.org/en/latest/getting_started.html#connecting-your-model-with-django-categories

I have also read about the actual steps to make it happen in this link
https://django-categories.readthedocs.org/en/latest/registering_models.html#registering-models

So I put this inside my settings.py

django-categories

CATEGORIES_SETTINGS = {
'M2M_REGISTRY': {
'articles.Blog': 'categories',
}
}

when I run "python manage.py add_category_fields articles" I get this error:
ImportError: cannot import name MODEL_REGISTRY

I also tried putting the following into init.py
from categories import registration
from articles.models import Blog
registration.register_m2m(Blog)

But nothing happens.

The bottom of this link https://django-categories.readthedocs.org/en/latest/registering_models.html#registering-a-many-to-many-relationship shows sample code using categories.register_m2m, but categories module doesn't have register_m2m, it's inside registration.py. I doubt the accuracy of the document.

Template tags broken for custom categories

I have custom category subclassed from CategoryBased

Using template tags on such a category fails because the tags expect either a Category instance or a string. Is there any reason for the template tags to check for a Category instance instead of CategoryBase ?

Add an ADMIN_FIELDSETS configuration

Using markup like:

'ADMIN_FIELDSETS': {
    'appA': None,
    'appB': 'Catigoricals',
    'appC': {'name': 'Cats', 'index': 2}
}

It allows for the default behavior if not listed (admin field set called categories appended to their admin class).
appA would not get any field set
appB would get a field set appended to the admin class called 'Catigoricals'
appC would get a field set named 'Cats' inserted at index 2 of their field sets in their admin class.

Migrations broken from 1.0.2 -> 1.0.3

As migrations 0009 and 0010 where not only renamed but also changed in content, upgrading from 1.0.2 to 1.0.3 is not possible.
Backward migration to 0008 in 1.0.2 before upgrading is not possible due to restrictions on CategoryRelation.story field; forward migrations fails as <categories: 0010_changed_category_relation> migration does not exists anymore, and if you ignore that with --delete-ghost-migrations categories:0010_add_field_categoryrelation_category fails as categories_categoryrelation already exists (from 'old' 0010).
Any solutions?

category detail caching causes problems when using on multiple sites

On line 14 in views.py
says

@cache_page(CACHE_VIEW_LENGTH)

key_prefix is not sent in. I thought it would default to the one in settings
CACHE_MIDDLEWARE_KEY_PREFIX

but it doesn't. Because of this if categories module is used when the same django instance has more then one site. The sites share the same category_detail page. I think if this has to be here. There should be a settings field called

KEY_PREFIX_SETTING or something. that we can set in settings so then you would do
@cache_page(CACHE_VIEW_LENGTH, key_prefix=KEY_PREFIX_SETTING)

Otherwise just remove it and let us take care of caching in middle ware.

I also just tried to set the
CACHE_VIEW_LENGTH in settings to
0 - this is the same as no cache. So this doesn't help because we need middleware cache to work
None - This just makes it default to 300 seconds. With the key-prefix as None so this also doesn't help.

Sorry I should have clarified. For django version 1.2.5 it doesn't cause a problem because it defaults key_prefix to CACHE_MIDDLEWARE_KEY_PREFIX. But for communities.washingtontimes it does because 1.3.1 doesn't default the key prefix. Not sure about later versions then 1.3.1

thanks

Missing static files on pypi

The pip installation of django-categories is missing the static/ directories. In order to get the static assets, one has to install from github

Django 1.5 and adminmedia

The TreeEditor is currently not functional in Django 1.5 because it's templates use the removed adminmedia tag library. This bug report says it all: feincms/feincms#371

As per: https://docs.djangoproject.com/en/dev/releases/1.5-beta-1/

The template tags library adminmedia, which only contained the deprecated
template tag {% admin_media_prefix %}, was removed. Attempting to load
it with {% load adminmedia %} will fail. If your templates still contain
that line you must remove it.

Test failing with from categories.tests import views

When I run tests within my django project django-categories throws an ImportError. If I change
/django-categories/categories/tests/init.py line 1 from from categories.tests import views to from categories import views
ImportError is not thrown.

File "/tmp/cmstest/src/django-categories/categories/tests/init.py",
line 1, in
from categories.tests import views
ImportError: cannot import name views

Can't install alongside Django 1.5b2

I'm developing against Django 1.5 beta, and always got an error when installing. After a bit of fiddling, I know that installing django-categories in a clean (--no-site-packages) virtualenv

a) together with Django 1.4.3 works fine (pip install Django django-categories)
b) after having installed Django 1.4.3 works fine (pip install Django && pip install django-categories)
c) together with Django 1.5b2 works fine (surprisingly!) (pip install https://www.djangoproject.com/download/1.5b2/tarball/ django-categories)
d) after having installed Django 1.5b2 fails (pip install https://www.djangoproject.com/download/1.5b2/tarball/ && pip install django-categories)

The log is here: https://gist.github.com/560478e396afa1a289b1

I presume the error has to do with trying to import django.db.models.Q without having settings setup.

Unable to make the tree editor work

Either i am unable to make the tree editor work properly or it is missing some features. All I get i the admin is the arrows.

> Top
   > Belolw
> More
   > Stuff

I would expect:

> Top                                magnifyinglass / plus sign / drag handle
   > Belolw                          magnifyinglass / plus sign / drag handle
> More                               magnifyinglass / plus sign / drag handle
   > Stuff                           magnifyinglass / plus sign / drag handle

Am I missing something or should i use feincms for the admin?

line 11 of tree_editor.html has an error

the javascript error happens when you click on the check box on admin tree view. both on opera and firefox the console says
event is not defined: this.checked = event.currentTarget.checked;
and referers to line 48 of the page, which is line 11 of the tree_editor.html template

Exception when trying to deactivate category

Hi,
I'm receiving this error when trying to deactivate a catagory:

Django Version:     1.3.1
Exception Type:     AttributeError 
Exception Value:    

 'CategoryAdmin' object has no attribute '_meta'

  Exception Location:   /home/nuno/Proyectos/hella/src/libs/django-categories/categories/base.py in deactivate, line 132

The code which raise the exception is :

   def deactivate(self, request, queryset):
    """
    Set active to False for selected items
    """
   -->  opts = self._meta   <-
    selected_cats = opts.model.objects.filter(
        pk__in=[int(x) for x in request.POST.getlist('_selected_action')])

I'm using this library by directy linking my model with the base Category..as in this case i need some king of "category flat pages"

 category = models.OneToOneField('categories.Category')

Can anybody tell me if 'im doing something wrong?
Should I extends CatagoryBase and create a custom "Mycategory" model to use ths library?
Everything is working fine except this.

Thanks in advance

Can not use pip install django-categories with python2.7.3 and django1.5

(env)$ python --version
Python 2.7.3

(env)$ django-admin.py --version
1.5

(env)$ pip install django-categories
Downloading/unpacking django-categories
Running setup.py egg_info for package django-categories
Traceback (most recent call last):
File "", line 16, in
File "/home/ec2-user/investormill/env/build/django-categories/setup.py", line 2, in
import categories
File "categories/init.py", line 23, in
from categories import settings
File "categories/settings.py", line 4, in
from django.db.models import Q
File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/db/init.py", line 11, in
if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/conf/init.py", line 52, in getattr
self._setup(name)
File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/conf/init.py", line 45, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 16, in

File "/home/ec2-user/investormill/env/build/django-categories/setup.py", line 2, in

import categories

File "categories/init.py", line 23, in

from categories import settings

File "categories/settings.py", line 4, in

from django.db.models import Q

File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/db/init.py", line 11, in

if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:

File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/conf/init.py", line 52, in getattr

self._setup(name)

File "/home/ec2-user/investormill/env/lib/python2.7/site-packages/django/conf/init.py", line 45, in _setup

% (desc, ENVIRONMENT_VARIABLE))

django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.


Command python setup.py egg_info failed with error code 1 in /home/ec2-user/investormill/env/build/django-categories
Storing complete log in /home/ec2-user/.pip/pip.log

Difficulty setting up

Django-categories appears to be the perfect solution for my needs. I followed the instructions for installation and setup meticulously.

  1. I installed it, per instructions: pip install django-categories
  2. I added the apps to INSTALLED_APPS.
  3. I registered Many-to-Many Category fields in settings.py using a "lazy connection":
CATEGORIES_SETTINGS = {
'M2M_REGISTRY': {
    'resources.ResourceEntry': (
        {'name': 'audience', 'related_name': 'audiences'},
        {'name': 'diagnosis','related_name': 'diagnoses'},
    ),
    }
}
  1. I ran "python manage.py add_category_fields" both with and without specifying an app, but I always get the error:
ImportError: cannot import name MODEL_REGISTRY
in File "/home/tereza/t42/lib/python2.5/site-packages/categories/management/commands/add_category_fields.py", line 23 

which can be avoided if I add ".settings" to line 23, like so:

        from categories.settings import MODEL_REGISTRY 
  1. but then I get a new error:
TypeError: migrate_app() takes at least 4 arguments (1 given) 

I'm pretty much at a loss here. Why is the add_category_fields command incorrect? Am I missing something that would be obvious to a real Pythonista or Djangonaut?

Error when selecting categories in django admin - only present in django 1.4

I simply downloaded the repository, and did a did a mange.py syncdb on the example project. Then when I ran it in the server, when to admin and clicked Categories I got a type error.

TypeError at /admin/categories/category/
get_ordering() takes at most 2 arguments (3 given)

EDIT:

I tried running the app through django 1.3.1 and it worked fine. Looks like something changed in Django 1.4 and broke the app.

Trackback:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/categories/category/

Django Version: 1.4
Python Version: 2.7.1
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'categories',
'categories.editor',
'mptt',
'simpletext',
'south')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/categories/editor/tree_editor.py" in changelist_view
  6.                                 request, extra_context, _args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapper
  7.         return bound_func(_args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  8.                 response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in bound_func
  9.             return func(self, _args2, *_kwargs2)
    
    File "/Library/Python/2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  10.             self)
    
    File "/Library/Python/2.7/site-packages/django/contrib/admin/views/main.py" in init
  11.     self.query_set = self.get_query_set(request)
    
    File "/Library/Python/2.7/site-packages/categories/editor/tree_editor.py" in get_query_set
  12.     qs = super(TreeChangeList, self).get_query_set(_args, *_kwargs).order_by('tree_id', 'lft')
    
    File "/Library/Python/2.7/site-packages/django/contrib/admin/views/main.py" in get_query_set
  13.     ordering = self.get_ordering(request, qs)
    

Exception Type: TypeError at /admin/categories/category/
Exception Value: get_ordering() takes at most 2 arguments (3 given)

Am I doing something wrong, or is this a bug?

Thanks in advance
-David

Fails on Django 1.4 Alpha 1

Here's the Traceback:

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/categories/category/

Django Version: 1.4 alpha 1
Python Version: 2.7.1
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'haystack',
'south',
'usat',
'grid_o',
'stories',
'categories',
'categories.editor',
'massmedia')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/categories/editor/tree_editor.py" in changelist_view
  6.         return self.old_changelist_view(request, extra_context)
    
    File "/Users/jhensley/.virtualenvs/change-o/lib/python2.7/site-packages/categories/editor/tree_editor.py" in old_changelist_view
  7.             self.list_per_page, self.list_editable, self)
    

Exception Type: TypeError at /admin/categories/category/
Exception Value: init() takes exactly 13 arguments (12 given)

unsupported operand type(s) for +: 'NoneType' and 'tuple' in admin.py

File "C:\Python27\lib\site-packages\django_categories-0.4.5-py2.7.egg\categories\admin.py" in module> 109. 'fields': ('category','categories'),
Exception Type: TypeError at /admin/categories/
Exception Value: unsupported operand type(s) for +: 'NoneType' and 'tuple'

I've commented out this section to get it to work. Something I'm missing?

for model,modeladmin in admin.site._registry.items():
if model in registry.values():
admin.site.unregister(model)
admin.site.register(model, type('newadmin', (modeladmin.class,), {
'fieldsets': modeladmin.fieldsets + (('Categories',{
'fields': ('category','categories'),
}),)
}))

i18n

What about translations - are there any planned? Could I start adding a German one? (using ugettext of course)

How to count all items in cat tree?

Now i can count items only with one category, as this
Electronic (0)_first cat -> Computers (13) -> Mainboards (4)_last cat

i want count right items as this
Electronic (17)_first cat -> Computers (17) -> Mainboards (4)_last cat

how to?

Slug field and django-modeltranslation

I have the following simple model

class Department(CategoryBase):
    pass

just to build a category tree.
The same model is translated through django-modeltranslate (http://code.google.com/p/django-modeltranslation/), which works on a subscription basis, just like admin.

It automatically adds a field fieldname_ for each language, wrapping the use of fieldname according to the current language.
In my case the field is "name".

When saving an instance django-categories raises an exception, since it tries to create a slug from "name" which is not present in the POST data.

is there a way to solve this incompatibility?

Slug values that are too long cause unrecoverable error

When you use a title that has more than 50 characters a slug is created within the advanced section of the admin panel. Even when you edit this slug to contain less than 50 characters, the application will still give you an error as if there are still too many characters.

models.py is missing from editor app

I'm trying to get django-categories-0.4.8 work with my project (based on django 1.2.1) but no luck so far. One thing I noticed is the models.py file is missing from the editor app. This prevents the staticfiles app from searching into the "editor/media/editor" directory.

Is django-categories-0.4.8 supposed to work with django 1.2.1 by the way?

Error upgrading from 0.7.1 to 0.8.0

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>from categories.models import Category
>>>c = Category()
>>>c.name = "China"
>>>c.save()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/bundles/port-8488/app_image/pyenv/lib/python2.7/site-packages/categories/models.py", line 104, in save
for item in self.get_descendants():
File "/bundles/port-8488/app_image/pyenv/lib/python2.7/site-packages/mptt/models.py", line 222, in get_descendants
if not include_self and self.is_leaf_node():
File "/bundles/port-8488/app_image/pyenv/lib/python2.7/site-packages/mptt/models.py", line 358, in is_leaf_node
return not self.get_descendant_count()
File "/bundles/port-8488/app_image/pyenv/lib/python2.7/site-packages/mptt/models.py", line 244, in get_descendant_count
self._mpttfield('left') - 1) / 2
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

Class based views

I've whipped together a few basic class based views to help clean things up in a project I'm working on. I didn't want to do a big full fledged pull request out of the blue, but I figured I'd drop a note to see if anyone is interested.

https://github.com/tgecho/django-categories/tree/classviews

I'm up for whatever fixes/changes. I'll be poking at it a bit more as my project moves along. Also, I'll be needing date based versions soon, so those will be coming along.

CategoryDetailView replicates category_detail, but it's a bit nicer to override pieces (in my case I just wanted to play with the context).
Usage example:
url(r'^categories/(?P.+)/$', CustomCategoryDetailView.as_view(), name='categories_category'),

CategoryRelatedDetail is for showing an object from another model that is partially identified based on the category it belongs to (i.e. using unique_together). As a bonus it creates a nice template cascade for you.
Usage example:
url(r'^categories/(?P<category_path>.+)/photos/(?P.*)/$', CategoryRelatedDetail.as_view(model=Photo), name='photo_detail'),

CategoryRelatedList shows a list of objects of a given model that are related to a category.
Usage example:
url(r'^categories/(?P<category_path>.+)/photos/$', CategoryRelatedList.as_view(model=Photo), name='photo_list'),

Admin treetable not working for me

Not sure if this is a versions problem. I get this error when loading admin page for Categories:

TypeError: Result of expression '$' [undefined] is not an object.
On this line in treeTable.js
$.fn.treeTable = function(opts) {

treeTable v 2.3.0
jQuery v. 1.4.2

Searching for a subcategories hides results

The TreeTable collapses all children by default. adding:

            var srchString = document.getElementById('searchbar').value;
            if (srchString == '')
                treeTable = $("#result_list").treeTable({initialState : "{{ EDITOR_TREE_INITIAL_STATE }}"});
            else:
                treeTable = $("#result_list").treeTable({initialState : "expanded"});

to tree_editor.html will work, but the formatting isn't correct.

level in import_categories

in import_categories.py,
level is count by:

level = line.count(indent)

this is sometimes wrong because it also counts the non-leading indent chars...

Tests fail on MySQL + InnoDB

The musicgenres.json fixture fails to load on systems running MySQL + InnoDB โ€” foreign key constraints fail because of the order of the items in that fixture file. Reordering them fixes the problem.

See https://gist.github.com/1373942 for a reordered version of the fixture.

Best way to query objects on category name or parent

Sorry for such a simple question, but can you tell me the best way to query on objects that either have a parent category of 'News' or have the category name of 'News'? I am currently using Q and the following code:

entries = SuperPage.objects.filter(Q(category__parent__name='News')|Q(category__name='News'))

I have also tried using a superpage_set query with a Category object, but I can't see a way to get all objects for the Parent and all children. Sorry if this makes no sense. I appreciate any help you can give.

Links to external files in admin page are broken

In the example project comes with django-categories-0.4.8, the links to external files in the admin page (/admin/categories/category/) are broken.

<script type="text/javascript" src="/static/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/static/ie_compat.js"></script>
<script type="text/javascript" src="/static/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/toolbox.js"></script>
<script type="text/javascript" src="/static/page_toolbox.js"></script>
<script type="text/javascript" src="/static/js/genericcollections.js"></script>

type object 'TreeEditorQuerySet' has no attribute '_meta' on delete in admin

I am catching the following error when I try to delete a category within the admin on 0.8.1:

type object 'TreeEditorQuerySet' has no attribute '_meta'

Exception Location: /home/user/project/lib/python2.7/site-packages/django/db/models/deletion.py in delete, line 228

More info:

Environment:

Request Method: POST
Request URL: http://null.null:9000/admin/categories/category/

Django Version: 1.3
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.comments',
'south',
'main',
'avatar',
'registration',
'profiles',
'taggit',
'debug_toolbar',
'voting',
'sorl.thumbnail',
'django.contrib.flatpages',
'categories',
'editor',
'mptt']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')

Traceback:
File "/home/user/project/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/editor/tree_editor.py" in changelist_view
  6.         return self.old_changelist_view(request, extra_context)
    
    File "/home/user/project/lib/python2.7/site-packages/editor/tree_editor.py" in old_changelist_view
  7.         response = self.response_action(request, queryset=cl.get_query_set())
    
    File "/home/user/project/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
  8.         response = func(self, request, queryset)
    
    File "/home/user/project/lib/python2.7/site-packages/django/contrib/admin/actions.py" in delete_selected
  9.         queryset.delete()
    
    File "/home/user/project/lib/python2.7/site-packages/django/db/models/query.py" in delete
  10.     collector.delete()
    
    File "/home/user/project/lib/python2.7/site-packages/django/db/models/deletion.py" in decorated
  11.         func(self, _args, *_kwargs)
    
    File "/home/user/project/lib/python2.7/site-packages/django/db/models/deletion.py" in delete
  12.         if not model._meta.auto_created:
    

Exception Type: AttributeError at /admin/categories/category/
Exception Value: type object 'TreeEditorQuerySet' has no attribute '_meta'

Link in description: 404 page

Hi,

Just FYI, the link in your description goes to a 404 page.

What's the official project page (outside of GitHub?)

Thanks!
Micky

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.