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.

It's also worth mentioning that the design approach
of django-simple-history is completely wrong, and personally I wouldn't
recommend using it. Feel free to start a separate thread if you'd like to
discuss that further though as it's slightly off topic for this thread.

Let us know how you get on.

Cal


On Fri, Jul 4, 2014 at 4:47 PM, Aaron Reabow <rea...@gmail.com> wrote:

> Environment:
>
>
> Request Method: POST
> Request URL: upon request :)
>
> Django Version: 1.6.2
> Python Version: 2.7.5
> Installed 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_response
>   114.                     response = wrapped_callback(request,
> *callback_args, **callback_kwargs)
> File "/home/metadata/webapps/greenhouse/myproject/myproject/ngc/views.py"
> in leadManagementView
>   540.             model_instance.save()
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
> in save
>   545.                        force_update=force_update,
> update_fields=update_fields)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
> in save_base
>   582.                                    update_fields=update_fields,
> raw=raw, using=using)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/dispatch/dispatcher.py"
> in send
>   185.             response = receiver(signal=self, sender=sender, **named)
> File
> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py"
> in post_save
>   209.             self.create_historical_record(instance, created and '+'
> or '~')
> File
> "/home/metadata/.local/lib/python2.7/site-packages/simple_history/models.py"
> in create_historical_record
>   222.                        history_user=history_user, **attrs)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py"
> in create
>   157.         return self.get_queryset().create(**kwargs)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py"
> in create
>   319.         obj.save(force_insert=True, using=self.db)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
> in save
>   545.                        force_update=force_update,
> update_fields=update_fields)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/base.py"
> in save_base
>   573.             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_table
>   654.             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_insert
>   687.                                using=using, raw=raw)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/manager.py"
> in _insert
>   232.         return insert_query(self.model, objs, fields, **kwargs)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/models/query.py"
> in insert_query
>   1511.     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_sql
>   899.             cursor.execute(sql, params)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py"
> in execute
>   69.             return super(CursorDebugWrapper, self).execute(sql,
> params)
> File
> "/home/metadata/webapps/greenhouse/lib/python2.7/django/db/backends/util.py"
> in execute
>   53.                 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 execute
>   53.                 return self.cursor.execute(sql, params)
>
> Exception Type: DataError at /leads
> Exception 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 modelform
>>>
>>> smallint out of range
>>>
>>>
>>>
>>> But 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
>>>
>>>  --
>>> 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...@googlegroups.com.
>>> 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
>>> <https://groups.google.com/d/msgid/django-users/6af23e8d-9f15-477d-843f-dc9c33b7edf9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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/60c024db-2672-4b5b-ad0b-aeecd2d83aaf%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/60c024db-2672-4b5b-ad0b-aeecd2d83aaf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHKQagELdz5RAjpvXpvAss%3D9fGMWWLqkupnK9mWpvEJYC_h3Qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to