Hi, all

i have used the command 'manage.py inspectdb' to generate code of
models.
then i want to use the code to create dbtable in mysql, and i got
errormessage:
    Traceback (most recent call last):
  File "C:\vincent\wd\django\mysite\mysite\manage.py", line 11, in
<module>
    execute_manager(settings)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\__init__.py", line 340, in execute_manager
    utility.execute()
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\__init__.py", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\base.py", line 192, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\base.py", line 219, in execute
    output = self.handle(*args, **options)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\base.py", line 348, in handle
    return self.handle_noargs(**options)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\core\m
anagement\commands\syncdb.py", line 80, in handle_noargs
    cursor.execute(statement)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\db\bac
kends\util.py", line 19, in execute
    return self.cursor.execute(sql, params)
  File "c:\python25\lib\site-packages\django-1.0.2_final-py2.5.egg
\django\db\bac
kends\mysql\base.py", line 83, in execute
    return self.cursor.execute(query, args)
  File "C:\Python25\lib\site-packages\MySQLdb\cursors.py", line 167,
in execute
    self.errorhandler(self, exc, value)
  File "C:\Python25\Lib\site-packages\MySQLdb\connections.py", line
35, in defau
lterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your
SQL syntax
; check the manual that corresponds to your MySQL server version for
the right s
yntax to use near '-127) NULL,\n    `MGSYXS` numeric(126, -127) NULL,
\n    `MGSY
KC` numeric(126, -127' at line 17")

the code of models:
    mgsyxs = models.DecimalField(decimal_places=-127, null=True,
max_digits=126, db_column='MGSYXS', blank=True) # Field name made
lowercase.

i appreciate for your suggestion.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to