You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use a model FileBrowseField with django 1.9 + mezzanine 4.1.0.
I'm trying to create an abstract model used by various items :
classIllustrated(models.Model):
""" Model mixin to add an *illustration* to an item """classMeta:
abstract=True#: Illustration fileillustration=FileBrowseField(verbose_name=_('Illustration'),
null=True, blank=True,
extensions=ILLUSTRATION_FILE_TYPES,
directory='images'
)
#: Illustration credit short text (255 max)illustration_credit=models.CharField(max_length=255, verbose_name=_('image credit'), default=_('rights reserved'),
null=True, blank=True)
where ILLUSTRATION_FILE_TYPES is a list of extensions, and then I create a migration
$ ./manage.py makemigrations
When actualy migrating I've an error :
$ ./manage.py migrate
Operations to perform:
Apply all migrations: intrapubs
Running migrations:
Rendering model states... DONE
Applying intrapubs.0001_initial...Traceback (most recent call last):
File "./manage.py", line 14, in<module>
execute_from_command_line(sys.argv)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 92, in migrate
self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 121, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 198, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 123, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 59, in database_forwards
schema_editor.create_model(model)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 284, in create_model
self.execute(sql, params or None)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 110, in execute
cursor.execute(sql, params)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
File "/home/fguerin/Boulot/workspace/django/intranet_clear/virtualenv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 321, in execute
return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: near "None": syntax error
When I debugs, I can see that the datble creation attemps to create a VARCHAR columns for the illustration field with a length of "None", which can"t work :
Hi,
I'm trying to use a model FileBrowseField with django 1.9 + mezzanine 4.1.0.
I'm trying to create an abstract model used by various items :
where ILLUSTRATION_FILE_TYPES is a list of extensions, and then I create a migration
When actualy migrating I've an error :
When I debugs, I can see that the datble creation attemps to create a VARCHAR columns for the
illustration
field with a length of "None", which can"t work :I've seen too that in the code, there is a reference to a
oldforms
module, which does not seem to be imported in thefields
module.Thanks for your help !
The text was updated successfully, but these errors were encountered: