I've tried to JOIN instead of ", " in sql query and it works but only
in sql frontend. I don't know where to fix this statement in Django.


On Nov 6, 5:52 pm, sergo <[EMAIL PROTECTED]> wrote:
> I'm using django-tagging and django-multilingual applications in my
> project. I don't know if the problem is in these packages or it is
> more general. Google gives thishttp://bugs.mysql.com/bug.php?id=16190
> , so I thought it is more general problem.
>
> Error page says:
>
> Environment:
>
> Request Method: GET
> Request URL:http://127.0.0.1:8000/scripts/tag/material/
> Django Version: 1.1 pre-alpha SVN-9285
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'django.contrib.markup',
>  'sergepogosyan.mytags',
>  'sergepogosyan.articles',
>  'sergepogosyan.scripts',
>  'sergepogosyan.about',
>  'sergepogosyan.gallery',
>  'django.contrib.comments',
>  'tagging',
>  'multilingual',
>  'multilingual.flatpages',
>  'localeurl']
> Installed Middleware:
> ('django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.locale.LocaleMiddleware',
>  'localeurl.middleware.LocaleURLMiddleware',
>  'multilingual.middleware.DefaultLanguageMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware',
>  'multilingual.flatpages.middleware.FlatpageFallbackMiddleware')
>
> Traceback:
> File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
> get_response
>   86.                 response = callback(request, *callback_args,
> **callback_kwargs)
> File "C:\Python25\lib\site-packages\tagging\views.py" in
> tagged_object_list
>   52.     return object_list(request, queryset, **kwargs)
> File "C:\Python25\lib\site-packages\django\views\generic
> \list_detail.py" in object_list
>   60.             page_obj = paginator.page(page_number)
> File "C:\Python25\lib\site-packages\django\core\paginator.py" in page
>   37.         number = self.validate_number(number)
> File "C:\Python25\lib\site-packages\django\core\paginator.py" in
> validate_number
>   28.         if number > self.num_pages:
> File "C:\Python25\lib\site-packages\django\core\paginator.py" in
> _get_num_pages
>   60.             if self.count == 0 and not
> self.allow_empty_first_page:
> File "C:\Python25\lib\site-packages\django\core\paginator.py" in
> _get_count
>   48.                 self._count = self.object_list.count()
> File "C:\Python25\lib\site-packages\django\db\models\query.py" in
> count
>   296.         return self.query.get_count()
> File "C:\Python25\lib\site-packages\django\db\models\sql\query.py" in
> get_count
>   237.         data = obj.execute_sql(SINGLE)
> File "C:\Python25\lib\site-packages\django\db\models\sql\query.py" in
> execute_sql
>   1734.         cursor.execute(sql, params)
> File "C:\Python25\lib\site-packages\django\db\backends\util.py" in
> execute
>   19.             return self.cursor.execute(sql, params)
> File "C:\Python25\lib\site-packages\django\db\backends\mysql\base.py"
> in execute
>   83.             return self.cursor.execute(query, args)
> File "C:\Python25\lib\site-packages\MySQLdb\cursors.py" in execute
>   166.             self.errorhandler(self, exc, value)
> File "C:\Python25\lib\site-packages\MySQLdb\connections.py" in
> defaulterrorhandler
>   35.     raise errorclass, errorvalue
>
> Exception Type: OperationalError at /scripts/tag/material/
> Exception Value: (1054, "Unknown column 'scripts_script.id' in 'on
> clause'")
>
> and here's sql query in error page:
>
> SELECT COUNT(*) FROM `scripts_script` , `tagging_taggeditem` LEFT JOIN
> `scripts_script_translation` AS `scripts_script_translation_en` ON
> ((`scripts_script_translation_en`.master_id = `scripts_script`.`id`)
> AND (`scripts_script_translation_en`.language_id = 2)) LEFT JOIN
> `scripts_script_translation` AS `scripts_script_translation_ru` ON
> ((`scripts_script_translation_ru`.master_id = `scripts_script`.`id`)
> AND (`scripts_script_translation_ru`.language_id = 1)) WHERE
> `tagging_taggeditem`.content_type_id = %s AND
> `tagging_taggeditem`.tag_id = %s AND `scripts_script`.`id` =
> `tagging_taggeditem`.object_id
>
> Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to