It sounds like you haven't applied the table changes to the cloned table which it creates to track changes.
I'd advice using something like South to manage your schema changes, and this should work out of the box with django-simple-history.
For now, you can delete the cloned table and re-sync, you will naturally lose the historical data but if you deleted the original then this probably won't matter.
Let us know how you get on.
Cal
On Fri, Jul 4, 2014 at 4:47 PM, Aaron Reabow <reabow@gmail.com> wrote:
Environment:Request Method: POSTRequest URL: upon request :)Django Version: 1.6.2Python Version: 2.7.5Installed Applications:('django.contrib.admin','django.contrib.admindocs','django.contrib.auth','django.contrib.sites','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','myproject.ngc','registration','crispy_forms','floppyforms','simple_history')Installed Middleware:('django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware')Traceback:File "/home/metadata/webapps/greenhouse/lib/python2.7/django/core/handlers/base.py" in get_response114. response = wrapped_callback(request, *callback_args, **callback_kwargs)File "/home/metadata/webapps/greenhouse/myproject/myproject/ngc/views.py" in leadManagementView540. model_instance.save()File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in save545. force_update=force_update, update_fields=update_fields)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in save_base582. update_fields=update_fields, raw=raw, using=using)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/dispatch/dispatcher.py" in send185. response = receiver(signal=self, sender=sender, **named)File "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" in post_save209. self.create_historical_record(instance, created and '+' or '~')File "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py" in create_historical_record222. history_user=history_user, **attrs)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py" in create157. return self.get_queryset().create(**kwargs)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py" in create319. obj.save(force_insert=True, using=self.db)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in save545. force_update=force_update, update_fields=update_fields)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in save_base573. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in _save_table654. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py" in _do_insert687. using=using, raw=raw)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py" in _insert232. return insert_query(self.model, objs, fields, **kwargs)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py" in insert_query1511. return query.get_compiler(using=using).execute_sql(return_id)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/sql/compiler.py" in execute_sql899. cursor.execute(sql, params)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" in execute69. return super(CursorDebugWrapper, self).execute(sql, params)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" in execute53. return self.cursor.execute(sql, params)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/utils.py" in __exit__99. six.reraise(dj_exc_type, dj_exc_value, traceback)File "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py" in execute53. return self.cursor.execute(sql, params)Exception Type: DataError at /leadsException Value: smallint out of range
On Friday, 4 July 2014 17:43:50 UTC+2, Cal Leeming [Simplicity Media Ltd] wrote:Can you please paste the full clear text stacktrace?
Cal
On Fri, Jul 4, 2014 at 3:49 PM, Aaron Reabow <rea...@gmail.com> wrote:
Hi all,I am getting this error on a modelformsmallint out of rangeBut the form is actually submitting just fine and being stored in the DB. I used to have a positive small int, but have changed it (dropped the offending table, resync'ed, restarted the server...)I have history = HistoricalRecords() as one of the fields (ie am tracking changes with django-simple-history), and I wonder if this is effecting my ability to make changes to the model.My other thought is that it is a caching problem somewhere.has anyone come across this problem and have any idea how to fix?many thanks,Aaron--To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@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/6af23e8d-9f15-477d-843f-dc9c33b7edf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60c024db-2672-4b5b-ad0b-aeecd2d83aaf%40googlegroups.com.
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+unsubscribe@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.
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+unsubscribe@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/CAHKQagELdz5RAjpvXpvAss%3D9fGMWWLqkupnK9mWpvEJYC_h3Qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment