google-code-export / django-mptt

Automatically exported from code.google.com/p/django-mptt
Other
0 stars 0 forks source link

Can't get node count #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the following model in a new app: http://pastebin.com/mc1a0fb1
2. python manage.py shell
3. Category.tree.add_related_count(Category.tree.root_nodes(), Item,
'category', 'q_c', cumulative=True)
4. Get error: http://pastebin.com/m69ed1937

I'm using SVN version, django 1.1, Ubuntu 9.10

I'm not sure if this is a bug. I'm still learning to use mptt.

Original issue reported on code.google.com by ezequiel...@gmail.com on 3 Feb 2010 at 9:12

GoogleCodeExporter commented 9 years ago
I tried using a ForeignKey, just to have an exact match with the example given 
in the
book, and it seems it works. So the problem seems to be with ManyToMany 
relations.

Original comment by ezequiel...@gmail.com on 5 Feb 2010 at 4:53

GoogleCodeExporter commented 9 years ago
Could you please test with the latest stable version?

Original comment by matjaz.c...@gmail.com on 4 Sep 2010 at 1:14

GoogleCodeExporter commented 9 years ago
Tested using latest version of django-mptt with:

 * django 1.1
 * SQLite
 * Ubuntu 8.04

Unable to reproduce, assumed fixed. Comment if you're still getting this error 
and we'll reopen.

Original comment by craig.ds@gmail.com on 10 Sep 2010 at 9:48

GoogleCodeExporter commented 9 years ago
I'm getting a similar error with postgresql.

Django 1.2
PostgreSQL
CentOS

Original comment by agabel on 15 Sep 2010 at 7:46

GoogleCodeExporter commented 9 years ago
Hi agabel

What version of django-mptt and PostgreSQL are you using?

Original comment by craig.ds@gmail.com on 16 Sep 2010 at 11:28

GoogleCodeExporter commented 9 years ago
Django 1.2
PostgreSQL 8.1

It looks like we are both trying to get a count from a ManyToMany.  The sql 
that is created cannot handle this type of relation.

Original comment by agabel on 7 Oct 2010 at 2:07

GoogleCodeExporter commented 9 years ago
Migrated to https://github.com/django-mptt/django-mptt/issues/#issue/90

Original comment by craig.ds@gmail.com on 19 Dec 2010 at 1:08