Re: Django Mysql Error : Unknown system variable 'innodb_strict_mode

2018-08-29 Thread Jason
you shouldn't need to set the storage engine to innodb

https://docs.djangoproject.com/en/2.1/ref/databases/#storage-engines

MySQL’s default storage engine is InnoDB 
. This 
engine is fully transactional and supports foreign key references. It’s the 
recommended choice.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed6092f3-0fb7-4731-8d7f-b5cb660de7fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Mysql Error : Unknown system variable 'innodb_strict_mode

2018-08-29 Thread Sonali Vighne
Models.py
from django.db import models
#from django_mysql.models import Model

class Category(models.Model):
name = models.CharField(max_length=128, unique=True)

def __unicode__(self):
return self.name

class Page(models.Model):
category = models.ForeignKey(Category, on_delete=models.CASCADE,)
title = models.CharField(max_length=128)
url = models.URLField()
views = models.IntegerField()

def __unicode__(self):
return self.title


setting.py


INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mysqlApp',
'django_mysql',
]



DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER': 'django_user',
'PASSWORD': 'root',
'HOST': 'localhost',
'PORT': '3306',
  'OPTIONS':{  
  'init_command': 'SET storage_engine=INNODB',
  },
 
}
}


below is traceback...


Traceback (most recent call last):
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 83, in _execute
return self.cursor.execute(sql)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
 
line 71, in execute
return self.cursor.execute(query, args)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 250, in execute
self.errorhandler(self, exc, value)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
 
line 50, in defaulterrorhandler
raise errorvalue
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 247, in execute
res = self._query(query)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 411, in _query
rowcount = self._do_query(q)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 374, in _do_query
db.query(q)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
 
line 277, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1193, "Unknown system variable 
'innodb_strict_mode'")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\EclipsePython\DjangoMysql\manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py",
 
line 381, in execute_from_command_line
utility.execute()
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py",
 
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 316, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 350, in execute
self.check()
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 379, in check
include_deployment_checks=include_deployment_checks,
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\migrate.py",
 
line 60, in _run_checks
issues.extend(super()._run_checks(**kwargs))
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 366, in _run_checks
return checks.run_checks(**kwargs)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\checks\registry.py",
 
line 71, in run_checks
new_errors = check(app_configs=app_configs)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django_mysql\checks.py",
 
line 23, in check_variables
@@character_set_connection""")
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 100, in execute
return super().execute(sql, params)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, 
executor=self._execute)
  File 
"C:\Users\sonali_v

Re: MySQL error when trying to run tests with utf8mb4 charset

2013-10-22 Thread tim
I think you may be barking up the wrong tree, see 
https://code.djangoproject.com/ticket/21196

On Friday, October 18, 2013 7:30:10 PM UTC-4, fle...@fletchowns.net wrote:
>
> Looks like this comes from custom_user.py in django.contrib.auth.tests:
>
> class CustomUser(AbstractBaseUser):
> email = models.EmailField(verbose_name='email address', 
> max_length=255, unique=True)
> is_active = models.BooleanField(default=True)
> is_admin = models.BooleanField(default=False)
> date_of_birth = models.DateField()
>
> I think this should have the same length as AbstractUser, where it does 
> not specify a max_length, so it defaults to 75 in 
> django.db.models.fields.EmailField. Should I submit a pull request for this 
> change?
>
> Thanks!
>
> On Wednesday, October 16, 2013 11:01:45 AM UTC-7, fle...@fletchowns.netwrote:
>>
>> Hello!
>>
>> I tried to run *./manage.py test *for the first time and I got the 
>> following error:
>>
>> *DatabaseError: (1071, 'Specified key was too long; max key length is 
>> 767 bytes')*
>>
>> Looking at the log in MySQL, it appears to be caused by this statement:
>>
>> CREATE TABLE `auth_customuser` (
>> `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
>> `password` varchar(128) NOT NULL,
>> `last_login` datetime NOT NULL,
>> `email` varchar(255) NOT NULL UNIQUE,
>> `is_active` bool NOT NULL,
>> `is_admin` bool NOT NULL,
>> `date_of_birth` date NOT NULL
>> )
>>
>>
>> So the email field of varchar(255) is causing me to go over the 
>> single-column index of 767 bytes in InnoDB when the charset is utf8mb4, 
>> that part I understand.
>>
>> Why is it trying to create this *auth_customuser* table anyways though? 
>> It doesn't exist in my application normally. The *email* field on my *
>> auth_user* table is varchar(75) so no error from that, not sure why it's 
>> a different length there though.
>>
>> To get around the issue temporarily I set the database engine to sqlite, 
>> but I'd like to be able to use MySQL for the tests, since that's what my 
>> application normally uses.
>>
>> Thanks in advance!
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1365ded5-dd5b-4259-ae1b-408ce135e212%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: MySQL error when trying to run tests with utf8mb4 charset

2013-10-18 Thread fletch
Looks like this comes from custom_user.py in django.contrib.auth.tests:

class CustomUser(AbstractBaseUser):
email = models.EmailField(verbose_name='email address', max_length=255, 
unique=True)
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
date_of_birth = models.DateField()

I think this should have the same length as AbstractUser, where it does not 
specify a max_length, so it defaults to 75 in 
django.db.models.fields.EmailField. Should I submit a pull request for this 
change?

Thanks!

On Wednesday, October 16, 2013 11:01:45 AM UTC-7, fle...@fletchowns.net 
wrote:
>
> Hello!
>
> I tried to run *./manage.py test *for the first time and I got the 
> following error:
>
> *DatabaseError: (1071, 'Specified key was too long; max key length is 767 
> bytes')*
>
> Looking at the log in MySQL, it appears to be caused by this statement:
>
> CREATE TABLE `auth_customuser` (
> `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
> `password` varchar(128) NOT NULL,
> `last_login` datetime NOT NULL,
> `email` varchar(255) NOT NULL UNIQUE,
> `is_active` bool NOT NULL,
> `is_admin` bool NOT NULL,
> `date_of_birth` date NOT NULL
> )
>
>
> So the email field of varchar(255) is causing me to go over the 
> single-column index of 767 bytes in InnoDB when the charset is utf8mb4, 
> that part I understand.
>
> Why is it trying to create this *auth_customuser* table anyways though? 
> It doesn't exist in my application normally. The *email* field on my *
> auth_user* table is varchar(75) so no error from that, not sure why it's 
> a different length there though.
>
> To get around the issue temporarily I set the database engine to sqlite, 
> but I'd like to be able to use MySQL for the tests, since that's what my 
> application normally uses.
>
> Thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/25d6e989-3784-4fcd-b3a4-0d2afc7354d5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


MySQL error when trying to run tests with utf8mb4 charset

2013-10-16 Thread fletch
Hello!

I tried to run *./manage.py test *for the first time and I got the 
following error:

*DatabaseError: (1071, 'Specified key was too long; max key length is 767 
bytes')*

Looking at the log in MySQL, it appears to be caused by this statement:

CREATE TABLE `auth_customuser` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`password` varchar(128) NOT NULL,
`last_login` datetime NOT NULL,
`email` varchar(255) NOT NULL UNIQUE,
`is_active` bool NOT NULL,
`is_admin` bool NOT NULL,
`date_of_birth` date NOT NULL
)


So the email field of varchar(255) is causing me to go over the 
single-column index of 767 bytes in InnoDB when the charset is utf8mb4, 
that part I understand.

Why is it trying to create this *auth_customuser* table anyways though? It 
doesn't exist in my application normally. The *email* field on my *auth_user
* table is varchar(75) so no error from that, not sure why it's a different 
length there though.

To get around the issue temporarily I set the database engine to sqlite, 
but I'd like to be able to use MySQL for the tests, since that's what my 
application normally uses.

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23d63241-40b6-4244-91c4-7f3e5495baba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: MySQL error

2010-12-01 Thread Tom Evans
On Wed, Dec 1, 2010 at 3:24 PM,   wrote:
> Thanks Tom, which one should I download for my django project?
> There are about 9 files.
>
> Kindly revert.
>
> Regards.
> Sent from my BlackBerry wireless device from MTN
>

I don't know; haven't used windows for ~10 years.

Google for 'python mysql windows howto' returns this top link..

http://stackoverflow.com/questions/645943/mysql-for-python-in-windows

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error

2010-12-01 Thread delegbede
Thanks Tom, which one should I download for my django project?
There are about 9 files. 

Kindly revert. 

Regards. 
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: Tom Evans 
Sender: django-users@googlegroups.com
Date: Wed, 1 Dec 2010 12:46:53 
To: 
Reply-To: django-users@googlegroups.com
Subject: Re: MySQL error

On Wed, Dec 1, 2010 at 10:09 AM,   wrote:
> I am starting out to learn django and I am using the book: Beginning Django 
> E-Commerce by Jim McGaw.
> I was able to create the database using mysql console but when I ran the 
> command:
> $ python manager.py dbshell
>
> I got the following error:
>
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No 
> mo
> dule named MySQLdb
>
> Please what am I doing wrong.
> Let me add that I installed wamp so the mysql I am using in bundled with 
> apache and php. I hope that is not the problem.
>
> I hope to get a feedback.
>

You need to install the python mysql driver. I have no idea what
'wamp' is, but I'm guessing it is some sort of bundled
apache/php/mysql stack? You will need to install the python mysql
driver in addition to that.

http://sourceforge.net/projects/mysql-python/

> Thank you.
> Sent from my BlackBerry wireless device from MTN
>

You wrote all that on a blackberry? Fair play..

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error

2010-12-01 Thread Tom Evans
On Wed, Dec 1, 2010 at 10:09 AM,   wrote:
> I am starting out to learn django and I am using the book: Beginning Django 
> E-Commerce by Jim McGaw.
> I was able to create the database using mysql console but when I ran the 
> command:
> $ python manager.py dbshell
>
> I got the following error:
>
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No 
> mo
> dule named MySQLdb
>
> Please what am I doing wrong.
> Let me add that I installed wamp so the mysql I am using in bundled with 
> apache and php. I hope that is not the problem.
>
> I hope to get a feedback.
>

You need to install the python mysql driver. I have no idea what
'wamp' is, but I'm guessing it is some sort of bundled
apache/php/mysql stack? You will need to install the python mysql
driver in addition to that.

http://sourceforge.net/projects/mysql-python/

> Thank you.
> Sent from my BlackBerry wireless device from MTN
>

You wrote all that on a blackberry? Fair play..

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



MySQL error

2010-12-01 Thread delegbede
I am starting out to learn django and I am using the book: Beginning Django 
E-Commerce by Jim McGaw. 
I was able to create the database using mysql console but when I ran the 
command: 
$ python manager.py dbshell

I got the following error:

ow...@dipo /c/python26/djangojobs/ecomstore
$ python manage.py dbshell
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\managem
ent\__init__.py", line 438, in execute_manager
utility.execute()
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\managem
ent\__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\managem
ent\__init__.py", line 257, in fetch_command
klass = load_command_class(app_name, subcommand)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\managem
ent\__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\utils\import
lib.py", line 35, in import_module
__import__(name)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\managem
ent\commands\dbshell.py", line 4, in 
from django.db import connections, DEFAULT_DB_ALIAS
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\__init__.
py", line 75, in 
connection = connections[DEFAULT_DB_ALIAS]
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\utils.py"
, line 91, in __getitem__
backend = load_backend(db['ENGINE'])
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\utils.py"
, line 32, in load_backend
return import_module('.base', backend_name)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\utils\import
lib.py", line 35, in import_module
__import__(name)
  File "c:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\backends\
mysql\base.py", line 14, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No mo
dule named MySQLdb

Please what am I doing wrong. 
Let me add that I installed wamp so the mysql I am using in bundled with apache 
and php. I hope that is not the problem. 

I hope to get a feedback. 

Thank you. 
Sent from my BlackBerry wireless device from MTN

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-29 Thread shacker
On Jul 29, 10:03 am, Dennis Kaarsemaker 
wrote:

> If you do 'select @@tmpdir', it'll probably say /tmp as that is the
> default. You can change this in /etc/my.cnf if you want.

Yep, that was the fix I applied (see above). So far everything's
working fine. Thanks for all the responses.

./s

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-29 Thread Dennis Kaarsemaker
On wo, 2010-07-28 at 22:25 -0700, shacker wrote:

> Well, I think I've got a culprit on this one. I was seeing occasional
> "/tmp is out of space" messages from the server lately as well, 

That is more than likely as mysql will store temporary tables there and
your error is one that can be seen if the server runs out of diskspace
for creating temporary tables.

If you do 'select @@tmpdir', it'll probably say /tmp as that is the
default. You can change this in /etc/my.cnf if you want.

-- 
Dennis K.

They've gone to plaid!


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-28 Thread shacker
Well, I think I've got a culprit on this one. I was seeing occasional
"/tmp is out of space" messages from the server lately as well, and
wondered whether these two things might be connected. It's a VPS and
the /tmp partition is locked at 100MBs - can't be made larger. So I
reconfigured mysql to use a separate directory for temp space, in /
home. The errors stopped happening immediately (knock wood).

It begs the question as to why this fairly low-traffic Django site
wanted so much /tmp space - there are dozens of WP sites on the same
server with more traffic, and it's never been an issue for them. So
I'm not sure about the cause, but I do seem to have found a fix.

Not sure it's still relevant but here's the output of "SHOW ENGINE
INNODB STATUS":

http://dpaste.com/223011/

Thanks guys.

./s

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-28 Thread Dennis Kaarsemaker
On wo, 2010-07-28 at 00:18 -0700, shacker wrote:
> On Jul 27, 2:49 pm, Dennis Kaarsemaker  wrote:
> > Are the tracebacks all the same? Can you share a traceback?
> 
> Sure, here's one (search/replaced to make it generic):
> 
> http://dpaste.com/222645/
> 
> It's happening on various (and unrelated) pages, but the tracebacks
> are all equally uninformative.

Indeed, very uninformative. Which database engine do you use, innodb? If
so, do a 'show engine innodb status'. The mysql errorlog may also show
relevant errors.

You could also try rebuilding tables by using 'alter table table_name
engine=innodb' (or myisam if you use that).

-- 
Dennis K.

They've gone to plaid!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-28 Thread Michael
On Wed, Jul 28, 2010 at 3:18 AM, shacker  wrote:

> On Jul 27, 2:49 pm, Dennis Kaarsemaker  wrote:
> > Are the tracebacks all the same? Can you share a traceback?
>
> Sure, here's one (search/replaced to make it generic):
>
> http://dpaste.com/222645/
>
> It's happening on various (and unrelated) pages, but the tracebacks
> are all equally uninformative.
>
> Thanks,
> Scot
>
> This is a strange error. Is there any mention in your mysql logs? Also,
have you tried destroying and recreating your database. It is looking like
something is corrupt or not installed properly.

Here is a link to someone else who might have gotten this error in the
past: http://forums.devshed.com/showthread.php?p=1259160#post1259160

Good Luck,

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-28 Thread shacker
On Jul 27, 2:49 pm, Dennis Kaarsemaker  wrote:
> Are the tracebacks all the same? Can you share a traceback?

Sure, here's one (search/replaced to make it generic):

http://dpaste.com/222645/

It's happening on various (and unrelated) pages, but the tracebacks
are all equally uninformative.

Thanks,
Scot

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-27 Thread Dennis Kaarsemaker
On di, 2010-07-27 at 13:49 -0700, shacker wrote:
> On Jul 27, 3:10 am, Dennis Kaarsemaker  wrote:
> 
> >
> > Start with checking/repairing the table that causes this error to be
> > thrown.
> 
> All tables analyzed, optimized, and repaired. No errors found. But the
> " error -1 from storage engine" reports continue a few minutes later
> (not for every page request - just a dozen or so per day, but I know
> those users are being served 500 pages and would like to get to the
> bottom of it).

Are the tracebacks all the same? Can you share a traceback?

-- 
Dennis K.

They've gone to plaid!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-27 Thread shacker
On Jul 27, 3:10 am, Dennis Kaarsemaker  wrote:

>
> Start with checking/repairing the table that causes this error to be
> thrown.

All tables analyzed, optimized, and repaired. No errors found. But the
" error -1 from storage engine" reports continue a few minutes later
(not for every page request - just a dozen or so per day, but I know
those users are being served 500 pages and would like to get to the
bottom of it).

Thanks,
Scot

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error -1

2010-07-27 Thread Dennis Kaarsemaker
On di, 2010-07-27 at 00:14 -0700, shacker wrote:
> One of my Django sites has been throwing occasional 500 errors, I
> believe related to mysql:
> 
> OperationalError: (1030, 'Got error -1 from storage engine')
> 
> I'm never able to catch it in the act - I just see the 500 email
> reports. This is not connected to any particular page - it seems to
> happen to random pages across the site.  The site is not busy at all
> (it does a fraction of the mysql traffic of other sites on the same
> server). The server itself is not overloaded.
> 
> I'm not sure where to begin with this one. Anyone seen similar?

Start with checking/repairing the table that causes this error to be
thrown.
-- 
Dennis K.

They've gone to plaid!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



MySQL error -1

2010-07-27 Thread shacker
One of my Django sites has been throwing occasional 500 errors, I
believe related to mysql:

OperationalError: (1030, 'Got error -1 from storage engine')

I'm never able to catch it in the act - I just see the 500 email
reports. This is not connected to any particular page - it seems to
happen to random pages across the site.  The site is not busy at all
(it does a fraction of the mysql traffic of other sites on the same
server). The server itself is not overloaded.

I'm not sure where to begin with this one. Anyone seen similar?

Thanks,
Scot

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQL error 1406 while running syncdb

2009-12-02 Thread chefsmart
Exactly. So people need to be aware of the varchar limits of django_
tables and also the contrib.auth tables.

On Dec 2, 5:11 pm, Jarek Zgoda  wrote:
> Wiadomo¶æ napisana w dniu 2009-12-02, o godz. 11:30, przez chefsmart:
>
>
>
> > Hi, I'm am getting MySQL error 1406 while running syncdb. (See link
> >http://pastebin.org/59605)
>
> > This happens after I create the superuser.
>
> > The error says _mysql_exceptions.DataError: (1406, "Data too long for
> > column 'name' at row 1")
>
> > I am not doing any pre-population of data. So I checked the tables
> > whose names start with "django_" and columns called "name" appear for
> > the django_content_type table and the django_site tables. The former
> > is varchar(100) and the latter is varchar(50).
>
> > I am definitely safe as far as the django_site table is concerned. And
> > I am also safe with the django_content_type table so I'm not sure why
> > this is happening.
>
> > Where does Django populate the django_content_type.name column from? I
> > am guessing it would take the model name or the verbose_name if
> > supplied.
>
> > All my models are named well within the varchar(100) limit.
>
> > Any idea what is going on? By the way, I'm also using contrib.auth.
>
> Here's the culprit:
>
> File "D:\Python25\lib\site-packages\django\contrib\auth\management
> \__init__.py", line 28, in create_permissions defaults={'name': name,  
> 'content_type': ctype})
>
> Do you have any custom-defined permissions for your models?
>
> --
> Artificial intelligence stands no chance against natural stupidity
>
> Jarek Zgoda, R&D, Redefine
> jarek.zg...@redefine.pl

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: MySQL error 1406 while running syncdb

2009-12-02 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-12-02, o godz. 11:30, przez chefsmart:

> Hi, I'm am getting MySQL error 1406 while running syncdb. (See link
> http://pastebin.org/59605)
>
> This happens after I create the superuser.
>
> The error says _mysql_exceptions.DataError: (1406, "Data too long for
> column 'name' at row 1")
>
> I am not doing any pre-population of data. So I checked the tables
> whose names start with "django_" and columns called "name" appear for
> the django_content_type table and the django_site tables. The former
> is varchar(100) and the latter is varchar(50).
>
> I am definitely safe as far as the django_site table is concerned. And
> I am also safe with the django_content_type table so I'm not sure why
> this is happening.
>
> Where does Django populate the django_content_type.name column from? I
> am guessing it would take the model name or the verbose_name if
> supplied.
>
> All my models are named well within the varchar(100) limit.
>
> Any idea what is going on? By the way, I'm also using contrib.auth.



Here's the culprit:

File "D:\Python25\lib\site-packages\django\contrib\auth\management 
\__init__.py", line 28, in create_permissions defaults={'name': name,  
'content_type': ctype})

Do you have any custom-defined permissions for your models?

-- 
Artificial intelligence stands no chance against natural stupidity

Jarek Zgoda, R&D, Redefine
jarek.zg...@redefine.pl

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




MySQL error 1406 while running syncdb

2009-12-02 Thread chefsmart
Hi, I'm am getting MySQL error 1406 while running syncdb. (See link
http://pastebin.org/59605)

This happens after I create the superuser.

The error says _mysql_exceptions.DataError: (1406, "Data too long for
column 'name' at row 1")

I am not doing any pre-population of data. So I checked the tables
whose names start with "django_" and columns called "name" appear for
the django_content_type table and the django_site tables. The former
is varchar(100) and the latter is varchar(50).

I am definitely safe as far as the django_site table is concerned. And
I am also safe with the django_content_type table so I'm not sure why
this is happening.

Where does Django populate the django_content_type.name column from? I
am guessing it would take the model name or the verbose_name if
supplied.

All my models are named well within the varchar(100) limit.

Any idea what is going on? By the way, I'm also using contrib.auth.

Regards.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Nick Arnett
On Tue, Nov 17, 2009 at 9:03 AM, Ilya Polosuhin wrote:

> I don't fully understood your question. Of course I have more than one row
> at test_mymodel2
> SQL query was formed by django-ORM. I just call
> print (MyModel.objects.filter(key_to_mymodel2 =
> MyModel2.objects.all()))._as_sql())
> and write here output.
>

Ah, sorry - I was confused... I thought you wrote the SQL yourself.  That
does seem to be a problem with the ORM.

Nick

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Ilya Polosuhin
I don't fully understood your question. Of course I have more than one row
at test_mymodel2
SQL query was formed by django-ORM. I just call
print (MyModel.objects.filter(key_to_mymodel2 =
MyModel2.objects.all()))._as_sql())
and write here output.
And I also googled for this MySQL error and found how to solve SQL-query
(add ANY to subquery). But I not need SQL, I need django-ORM code that will
do what I need ;)

So I think this is the issue of django-ORM and should I report about it?

On Tue, Nov 17, 2009 at 6:48 PM, Nick Arnett  wrote:

>
>
> On Tue, Nov 17, 2009 at 7:17 AM, Ilya  wrote:
>
>> I just developed some code like:
>>  MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all()))
>> This query produce SQL:
>> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id`
>> from `test_mymodel2`)
>>
>> It works fine on SQLLite, but in MySQL it produce error:
>> OperationalError: (1242, 'Subquery returns more than 1 row')
>> MySQL to work need query:
>> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id = ANY (select
>> `id` from `test_mymodel2`)
>
>
> With the same data?  It seems like a legitimate error unless test_mymodel2
> has just one row, which would be odd.  I would expect the subquery to have a
> WHERE or LIMIT clause that would restrict it to returning a single row, to
> be useful.
>
> If you really expect the subquery to return multiple rows, perhaps you mean
> something like this:
>
> SELECT * FROM `test_mymodel` t1, (SELECT `id` FROM `test_mymodel2`) t2
> WHERE t1.id = t2.id
>
> Nick
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=.
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Nick Arnett
On Tue, Nov 17, 2009 at 7:17 AM, Ilya  wrote:

> I just developed some code like:
>  MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all()))
> This query produce SQL:
> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id`
> from `test_mymodel2`)
>
> It works fine on SQLLite, but in MySQL it produce error:
> OperationalError: (1242, 'Subquery returns more than 1 row')
> MySQL to work need query:
> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id = ANY (select
> `id` from `test_mymodel2`)


With the same data?  It seems like a legitimate error unless test_mymodel2
has just one row, which would be odd.  I would expect the subquery to have a
WHERE or LIMIT clause that would restrict it to returning a single row, to
be useful.

If you really expect the subquery to return multiple rows, perhaps you mean
something like this:

SELECT * FROM `test_mymodel` t1, (SELECT `id` FROM `test_mymodel2`) t2 WHERE
t1.id = t2.id

Nick

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Ilya
M, thanks.
But should I create ticket on django trac about this issue?

On 17 ноя, 17:29, Tom Evans  wrote:
> On Tue, Nov 17, 2009 at 3:17 PM, Ilya  wrote:
> > I just developed some code like:
> >  MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all()))
> > This query produce SQL:
> > SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id`
> > from `test_mymodel2`)
>
> > It works fine on SQLLite, but in MySQL it produce error:
> > OperationalError: (1242, 'Subquery returns more than 1 row')
> > MySQL to work need query:
> > SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id = ANY (select
> > `id` from `test_mymodel2`)
>
> > Of course I can make something like:
> > list = MyModel2.objects.all()
> > res = []
> > for x in list:
> >  res += MyModel.objects.filter(key_to_mymodel2 = x)
>
> > It there any other path to solve this?
>
> > --
>
> This would also work:
>
> MyModel.objects.filter(key_to_mymodel2__in=MyModel2.objects.all().values_list('id',
> flat=True)))
>
> Cheers
>
> Tom

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:17 PM, Ilya  wrote:

> I just developed some code like:
>  MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all()))
> This query produce SQL:
> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id`
> from `test_mymodel2`)
>
> It works fine on SQLLite, but in MySQL it produce error:
> OperationalError: (1242, 'Subquery returns more than 1 row')
> MySQL to work need query:
> SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id = ANY (select
> `id` from `test_mymodel2`)
>
> Of course I can make something like:
> list = MyModel2.objects.all()
> res = []
> for x in list:
>  res += MyModel.objects.filter(key_to_mymodel2 = x)
>
> It there any other path to solve this?
>
> --
>

This would also work:

MyModel.objects.filter(key_to_mymodel2__in=MyModel2.objects.all().values_list('id',
flat=True)))

Cheers

Tom

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




MySQL error subquery returns more than 1 row

2009-11-17 Thread Ilya
I just developed some code like:
 MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all()))
This query produce SQL:
SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id`
from `test_mymodel2`)

It works fine on SQLLite, but in MySQL it produce error:
OperationalError: (1242, 'Subquery returns more than 1 row')
MySQL to work need query:
SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id = ANY (select
`id` from `test_mymodel2`)

Of course I can make something like:
list = MyModel2.objects.all()
res = []
for x in list:
  res += MyModel.objects.filter(key_to_mymodel2 = x)

It there any other path to solve this?

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.




Re: Help needed debugging a weird MySQL error!

2008-12-08 Thread bruno desthuilliers



On 8 déc, 14:28, taleinat <[EMAIL PROTECTED]> wrote:
> I have a Django application, and I wrote an external script which
> reads and writes to the Django database. I've started getting the
> following exception consistently:
>
> Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of
> sync; you can't run this command now") in  of > ignored

Most probably something to do with transaction handling, I'd say.

> Has anyone had similar problems?
>
> Otherwise, I need some help debugging this. Where do I start?

As usual : extract the minimum code required to reproduce the error,
and run it with pdb.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help needed debugging a weird MySQL error!

2008-12-08 Thread taleinat

I have a Django application, and I wrote an external script which
reads and writes to the Django database. I've started getting the
following exception consistently:

Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of
sync; you can't run this command now") in > ignored


Has anyone had similar problems?

Otherwise, I need some help debugging this. Where do I start? What
could be the cause of this?


Some technical details: mysql5 5.0.67, mysql-python 1.2.2, Python
2.5.2, Django 1.0, OSX 10.5.5

Thanks,
- Tal
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: mysql error

2007-10-01 Thread James Bennett

On 9/30/07, Jan Stavel <[EMAIL PROTECTED]> wrote:
> InternalError at /admin/store/storeitem/
> (1, "Can't create/write to file
> '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")

This is an error occurring internally in the MySQL database server,
not an error in Django or in your code.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: mysql error

2007-10-01 Thread Matt Davies
Hi Jan

I think you need a comma after the ('VHS','VHS') line in the ITEM_TYPE

Like this

ITEM_TYPES = ( ('VHS','VHS'),
   ('CD','CD'),
   ('VHS','VHS'),
   )

It might not fix all your problems, but it's a start



On 30/09/2007, Jan Stavel <[EMAIL PROTECTED]> wrote:
>
>  Hello,
> I tried to fill this Item with data (non english texts): (Django version
> 0.97-pre-SVN-unknown)
>
> class StoreItem(models.Model):
> ITEM_TYPES = ( ('VHS','VHS'),
>('CD','CD'),
>('VHS','VHS')
>)
> class Admin:
> list_display = ('name', 'code', 'cmat', 'specification',
> 'lowlimitquantity', 'highlimitquantity',
> 'quantity',
> 'itemtype',
> 'group',
> 'picture',
> 'producer',
> )
> list_filter = ('name', 'code',
>'producer'
>)
> search_fields = ('name', 'code', 'cmat')
> pass
>
> code = models.CharField(maxlength=12, unique=True)
> cmat = models.TextField()
> objversion = models.IntegerField()
> name = models.TextField()
> specification = models.TextField()
> datemodify = models.DateTimeField()
> lowlimitquantity = models.IntegerField()
> highlimitquantity = models.IntegerField()
> haslowlimit = models.BooleanField(default=False)
> quantity = models.IntegerField(default=0)
>
> itemtype = models.CharField('type',maxlength=16,choices=ITEM_TYPES)
> group = models.ForeignKey(Group)
> picture = models.ForeignKey(Picture)
> producer = models.ForeignKey(cdbazar.contacts.models.Firm)
>
> def __unicode__(self):
> return u"%s (%s)" % (self.name, self.code)
>
>
> The first attempt passed.
>
> But at the second item insertion I gave this error:
>  InternalError at /admin/store/storeitem/ (1, "Can't create/write to file
> '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")  Request Method: GET  
> Request
> URL: http://localhost:8000/admin/store/storeitem/  Exception Type:
> InternalError  Exception Value: (1, "Can't create/write to file
> '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")  Exception Location: 
> build/bdist.linux-i686/egg/MySQLdb/connections.py
> in defaulterrorhandler, line 35  Python Executable: /usr/bin/python  Python
> Version: 2.4.2
>  Template error
>
> In template
> /usr/local/lib/python2.4/site-packages/django/contrib/admin/templates/admin/filters.html,
> error at line *5*
> Caught an exception while rendering: (1, "Can't create/write to file
> '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")  1 {% load admin_list
> %}  2 {% load i18n %}  3 {% if cl.has_filters %} id="changelist-filter">  4 {% trans 'Filter' %}  5 {% for spec in
> cl.filter_specs %}  6 {% filter cl spec %}  7 {% endfor %}{% endif
> %}  8
>
> Now  I can neither insert new item nor list inserted items in storeitem.
>
> Please could you show me a way to find an error?
>
> Thanks,
> Jan Stavel
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



mysql error

2007-09-30 Thread Jan Stavel
Hello,
I tried to fill this Item with data (non english texts): (Django version 
0.97-pre-SVN-unknown)

class StoreItem(models.Model):
ITEM_TYPES = ( ('VHS','VHS'),
   ('CD','CD'),
   ('VHS','VHS')
   )
class Admin:
list_display = ('name', 'code', 'cmat', 'specification',
'lowlimitquantity', 'highlimitquantity',
'quantity',
'itemtype',
'group',
'picture',
'producer',
)
list_filter = ('name', 'code',
   'producer'
   )
search_fields = ('name', 'code', 'cmat')
pass
   
code = models.CharField(maxlength=12, unique=True)
cmat = models.TextField()
objversion = models.IntegerField()
name = models.TextField()
specification = models.TextField()
datemodify = models.DateTimeField()
lowlimitquantity = models.IntegerField()
highlimitquantity = models.IntegerField()
haslowlimit = models.BooleanField(default=False)
quantity = models.IntegerField(default=0)

itemtype = models.CharField('type',maxlength=16,choices=ITEM_TYPES)
group = models.ForeignKey(Group)
picture = models.ForeignKey(Picture)
producer = models.ForeignKey(cdbazar.contacts.models.Firm)
   
def __unicode__(self):
return u"%s (%s)" % (self.name, self.code)


The first attempt passed.

But at the second item insertion I gave this error:


  InternalError at /admin/store/storeitem/


(1, "Can't create/write to file '/var/lib/mysql/tmp/#sql_2182_0.MYI'
(Errcode: 2)")

Request Method: GET
Request URL:http://localhost:8000/admin/store/storeitem/
Exception Type: InternalError
Exception Value:(1, "Can't create/write to file 
'/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")
Exception Location: build/bdist.linux-i686/egg/MySQLdb/connections.py 
in defaulterrorhandler, line 35
Python Executable:  /usr/bin/python
Python Version: 2.4.2


Template error

In template 
|/usr/local/lib/python2.4/site-packages/django/contrib/admin/templates/admin/filters.html|,
 
error at line *5*


  Caught an exception while rendering: (1, "Can't create/write to
  file '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)")

1   {% load admin_list %}
2   {% load i18n %}
3   {% if cl.has_filters %}
4   {% trans 'Filter' %}
5   {% for spec in cl.filter_specs %}
6   {% filter cl spec %}
7   {% endfor %}{% endif %}
8   


Now  I can neither insert new item nor list inserted items in storeitem.

Please could you show me a way to find an error?

Thanks,
Jan Stavel


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Pagination causing mySQL error

2007-05-04 Thread Pashka R.

hm... you can check amount of the records before output... why not?


2007/5/4, Merric Mercer <[EMAIL PROTECTED]>:
>
> I have a template that has 3 non-contiguous areas.   I need to display
> the results of a query set across these three areas.
> My initial solution was to split up the query set in the template using
> "slice". For example:
>
> {% for object in object_list|slice:"1:6" %}area one {% endfor %}
> {% for object in object_list|slice:"6:9" %}area two {% endfor %}
> etc
>
> My problem is that this is not working with pagination correctly when
> the pagination returns less than the initial slice ( in this case 6).  I
> get the following errors (see below).
>
> Can anybody suggest how to avoid this? Many thanks
>
> MerMer
>
>
>
> Caught an exception while rendering.{% for object in
> object_listslice:"3:6" %}
> Exception Type: ProgrammingError
> Exception Value: (1064, "You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '-1' at line 1")
> Exception Location: C:\Python24\Lib\site-packages\MySQLdb\connections.py
> in defaulterrorhandler, line 35
>
> >
>


-- 
//wbr Pashka R. <[EMAIL PROTECTED]>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pagination causing mySQL error

2007-05-04 Thread Merric Mercer

I have a template that has 3 non-contiguous areas.   I need to display 
the results of a query set across these three areas.
My initial solution was to split up the query set in the template using 
"slice". For example:

{% for object in object_list|slice:"1:6" %}area one {% endfor %}
{% for object in object_list|slice:"6:9" %}area two {% endfor %}
etc

My problem is that this is not working with pagination correctly when 
the pagination returns less than the initial slice ( in this case 6).  I 
get the following errors (see below).

Can anybody suggest how to avoid this? Many thanks

MerMer



Caught an exception while rendering.{% for object in 
object_listslice:"3:6" %}
Exception Type: ProgrammingError
Exception Value: (1064, "You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near '-1' at line 1")
Exception Location: C:\Python24\Lib\site-packages\MySQLdb\connections.py 
in defaulterrorhandler, line 35

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MySQL error when running manage.py init on Mac OS X with Fink installed

2006-03-06 Thread Dmitry Medvedev

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

common problem, try upgrading your mysql libraries (mysql client itself)
or @server set password for your user like :


SET PASSWORD FOR some_user '@' some_host ' = OLD_PASSWORD(' newpwd ');


Ian wrote:
> I am trying to run django from svn under Mac OS X 10.4.5 using packages
> provided by Fink's unstable branch, namely python24, mysql and
> mysql-client 5.0.16-1, and mysql-python-py24 1.0.1-2.  I have followed
> directions found at http://cavedoni.com/2005/django-osx and am
> currently attempting the example app found at
> http://www.djangoproject.com/documentation/tutorial1/.  After I run
> `python manage.py init`, I get the following error:
> 
> Error: The database couldn't be initialized.
> (1251, 'Client does not support authentication protocol requested
> by server; consider upgrading MySQL client')
> 
> Fink's /sw/bin is first in my path, and I have symlinked the django dir
> obtained through svn to /sw/lib/python2.4/site-packages/django, peer to
> MySQLdb which is also installed there.  I changed settings.py in
> myproject dir to use the mysql database engine with a database and user
> that exist and are correct.  I have also tried setting and unsetting
> the DATABASE_HOST, but get the error message either way.
> 
> Any help would be appreciated.
> 
> thanks,
> ian.
> 
> 
> 

- --
best regards

dmitry medvedev
information systems support division
mailto:[EMAIL PROTECTED]
ph.: +7(095)728-4000 int.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEDAbaDsmP6s21mlMRAuA0AKCK/+QFay6cB2pQAwHlLlZUXj+34ACbBh9E
CpLofLi0gEM7YqJyVaJXd00=
=o4QB
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



MySQL error when running manage.py init on Mac OS X with Fink installed

2006-03-05 Thread Ian

I am trying to run django from svn under Mac OS X 10.4.5 using packages
provided by Fink's unstable branch, namely python24, mysql and
mysql-client 5.0.16-1, and mysql-python-py24 1.0.1-2.  I have followed
directions found at http://cavedoni.com/2005/django-osx and am
currently attempting the example app found at
http://www.djangoproject.com/documentation/tutorial1/.  After I run
`python manage.py init`, I get the following error:

Error: The database couldn't be initialized.
(1251, 'Client does not support authentication protocol requested
by server; consider upgrading MySQL client')

Fink's /sw/bin is first in my path, and I have symlinked the django dir
obtained through svn to /sw/lib/python2.4/site-packages/django, peer to
MySQLdb which is also installed there.  I changed settings.py in
myproject dir to use the mysql database engine with a database and user
that exist and are correct.  I have also tried setting and unsetting
the DATABASE_HOST, but get the error message either way.

Any help would be appreciated.

thanks,
ian.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---