Re: allow both edits and additions in form

2015-12-03 Thread sum abiut
You code is not very clear,

you could make your changes to your view as below:

views

def inventory(request,id):
if request.method =='POST':
staff=Inventory.objects.get(id=id)
form=InventoryForm(request.POST,instance=staff)
if form.is_valid():
form.save()
return render_to_response('display_successful_message.html')
   else:
staff=Inventory.objects.get(id=id)
form=InventoryForm(instance=staff)
return render_to_response('inventory.html')



Hope this helps.


Cheers,
Sum




On Fri, Dec 4, 2015 at 4:37 AM, Becka R.  wrote:

> Hi,
>
> I've been tryign to understand this for a while, and am pretty stuck.
> I've googled extensively.
>
> My form currently allows me to add items to teh datatable.
>
> I want to be able to, in the same template, edit each row.  I put a button
> in each table row, and I want to get the pk for the item in that row, and
> then edit that item.  I don't understand how this is done. I've tried
> declaring an instance, but I got lost in the fog after that.  Thanks so
> much.  Code is below.
>
> I have a basic modelform:
>
> *models:*
>
> class Inventory(models.Model):
> item = models.CharField(max_length=20, blank=True)
> needs_repairs = models.BooleanField(default=True)
> date = models.DateTimeField(auto_now_add=True, blank=True)
>
> def __str__(self):
> return '%s %s'%(self.item, self.needs_repairs)
>
> *views*
>
> def inventory(request):
> model = Inventory
> stuff = Inventory.objects.all()
>form = InventoryForm(data = request.POST)
> if request.method == "POST":
>
> if form.is_valid():
> obj = form.save(commit=False)
> obj.save()
>
> else:
> form = InventoryForm()
> context = RequestContext(request)
> return render_to_response('inventory.html', {
> 'form':form, 'stuff':stuff
> }, RequestContext(request))
>
>
> *forms*
>
> class InventoryForm(ModelForm):
> class Meta:
> model = Inventory
> fields = '__all__'
>
> *template*
>
> 
> 
>
> Truck Inventory 
> 
> 
> 
> 
> Whatcha got?
> Needs Repairs
> Change
> 
> 
> 
> {% for things in stuff %}
> 
> {{things.item}}
> {{things.needs_repairs}}
> 
> 
>{% csrf_token %}
>
>
>
> 
> {% endfor %}
> 
> 
> 
> 
>
>
> 
> Add stuff
> 
>  {% csrf_token %}
>   
>{{ form.as_ul}}
> 
>  
>  
> 
> 
>
> 
>
>
> --
> 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/074cef57-c0d2-4f21-82d7-87912ec0e334%40googlegroups.com
> 
> .
> 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/CAPCf-y6DJj9KPBRW7YgqL0ZOqFyVq51N%2B%3Dvq9vKxuV5pL4TOVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Video Erich Holschercom on django under the hood ?

2015-12-03 Thread Tim Graham
Here's a link with all the videos from this year's conference: 
https://opbeat.com/events/duth/

On Thursday, December 3, 2015 at 1:34:40 PM UTC-5, Carlos Leite wrote:
>
> Hello everyone, i'm brazilian django user, not so used to wirte here 
>
> last weekend I watched a video about DJango and Documentations Systems
> with Erick Holscher at the Django Under the hood conference. 
>
> But it seems the video just desapear. 
>
> Anyone has a link ?  
>
> thanks in advanced
>
>
> -
> Cadu Leite
>
> G+:  google.com/+CarlosLeite
> twitter: @cadu_leite
> site: http://people.python.org.br/
>

-- 
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/135d6b2a-a1f7-4673-8a78-2da869755e17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Video Erich Holschercom on django under the hood ?

2015-12-03 Thread Carlos Leite
Hello everyone, i'm brazilian django user, not so used to wirte here 

last weekend I watched a video about DJango and Documentations Systems
with Erick Holscher at the Django Under the hood conference.

But it seems the video just desapear.

Anyone has a link ?

thanks in advanced


-
Cadu Leite

G+:  google.com/+CarlosLeite
twitter: @cadu_leite
site: http://people.python.org.br/

-- 
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/CAEM6-QLgc3Vcik0rU8%2BGUM%3D%2BeKsUrnso9%2BDJAdG8-UYaEpDTEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


allow both edits and additions in form

2015-12-03 Thread Becka R.
Hi,

I've been tryign to understand this for a while, and am pretty stuck.  I've 
googled extensively.

My form currently allows me to add items to teh datatable.

I want to be able to, in the same template, edit each row.  I put a button 
in each table row, and I want to get the pk for the item in that row, and 
then edit that item.  I don't understand how this is done. I've tried 
declaring an instance, but I got lost in the fog after that.  Thanks so 
much.  Code is below. 

I have a basic modelform:

*models:*

class Inventory(models.Model):
item = models.CharField(max_length=20, blank=True)
needs_repairs = models.BooleanField(default=True)
date = models.DateTimeField(auto_now_add=True, blank=True)

def __str__(self):
return '%s %s'%(self.item, self.needs_repairs)

*views*

def inventory(request):
model = Inventory
stuff = Inventory.objects.all()
   form = InventoryForm(data = request.POST)
if request.method == "POST":

if form.is_valid(): 
obj = form.save(commit=False)
obj.save() 

else:
form = InventoryForm()
context = RequestContext(request)
return render_to_response('inventory.html', {
'form':form, 'stuff':stuff
}, RequestContext(request))


*forms*

class InventoryForm(ModelForm):
class Meta:
model = Inventory
fields = '__all__'

*template*




Truck Inventory 

 


Whatcha got?
Needs Repairs
Change



{% for things in stuff %}

{{things.item}}
{{things.needs_repairs}}


   {% csrf_token %}
   
   
   

{% endfor %}







Add stuff

 {% csrf_token %}
  
   {{ form.as_ul}}

 
 






-- 
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/074cef57-c0d2-4f21-82d7-87912ec0e334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrating from OneToOneField to ForeignKey in Django models

2015-12-03 Thread Simon Charette
Hi Cajetan,

You can visit the ticket [1] and have a look and the
commit messages. In this case the fix have been
backported to 1.7.4[2] and should be part of Django 1.8+.

Simon

[1] https://code.djangoproject.com/ticket/24163
[2] 
https://github.com/django/django/commit/db2a97870d74bc689428d9c2a942115ef799f2d2

Le jeudi 3 décembre 2015 11:06:33 UTC-5, Cajetan Rodrigues a écrit :
>
> Hi,
>
> I faced this issue recently and stumbled onto this thread.
>
> I see that the ticket has been fixed and closed already.
> How do I see which Django release has the fix shipped with?
>
> Thanks for your help.
> Cajetan.
>
> On Saturday, 17 January 2015 04:07:21 UTC+5:30, Łukasz Harasimowicz wrote:
>>
>> It's me again.
>>
>> I have managed to reproduce the problem and I have created a ticket: 
>> https://code.djangoproject.com/ticket/24163.
>>
>> W dniu poniedziałek, 12 stycznia 2015 23:32:54 UTC+1 użytkownik Łukasz 
>> Harasimowicz napisał:
>>>
>>> Hi Colin.
>>>
>>> On behalf of my colleague I will answer your question:
>>>
>>> We did not have time (at this moment) to investigate this problem any 
>>> further. We've added a raw sql commands to disable foreign key checks 
>>> during this migration. We could do it since we are still learning Django 
>>> (and it's new migrations) and in the end we will probably remove all 
>>> current migrations altogether (just before initial deployment). However we 
>>> also think that this might be a bug and we will try to reproduce this 
>>> problem with a fresh project. Hopefully sometime this week.
>>>
>>> W dniu poniedziałek, 12 stycznia 2015 21:32:39 UTC+1 użytkownik Collin 
>>> Anderson napisał:

 Hi,

 Did you figure it out? This seems like a bug. Can you reproduce it with 
 a fresh project?

 Thanks,
 Collin

 On Friday, January 9, 2015 at 8:49:56 AM UTC-5, Maciej Szopiński wrote:
>
> Hi everyone,
>
> I've encountered an issue when working with django and I can't seem to 
> find a way out of this..
>
> I am using django 1.7.2 and a MySQL database. 
> I have a model that was using a One-to-One relationship with two other 
> models. At first I thought, the One-to-One relationship will be enough, 
> but 
> as things changed in the project I had to change the relationship to 
> Many-to-One.
>
> I changed only two lines in my code, in my model I had:
>
> product = models.OneToOneField(Product)
> category = models.OneToOneField(Category)
>
> and changed it to:
>
> product = models.ForeignKey(Product)
> category = models.ForeignKey(Category)
>
> I created the db migrations using ./manage.py makemigrations, but when 
> I run the migration with 'migrate' it keeps throwing this error. 
>
> django.db.utils.OperationalError: (1553, "Cannot drop index 
> 'product_id': needed in a foreign key constraint")
>
> I tried to check what sql operations are executed in this case and it 
> seems that django tries to run 
> ALTER TABLE 'xxx' DROP INDEX 'yyy' and
> ALTER TABLE `xxx` DROP FOREIGN KEY `xxx_yyy_id_{some_hash}_fk_yyy_id`;
>
> I am not sure if this is the right order for these operations, when 
> running it manually on the database in the reverse order (first the DROP 
> FOREIGN KEY then DROP INDEX) it works correctly. 
>
> Have you encountered this issue before? Have you got any suggestions 
> on how to resolve this situation? 
> I would like to avoid any manual SQL changes outside of django 
> migrations. 
>
> Thanks in advance. 
>
> Best regards, 
> Maciej Szopiński
>


-- 
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/060b605a-8220-4a76-bdf6-90956d0da533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: am new to django and at a dead end or so i think

2015-12-03 Thread Andrew Farrell
Hi Emanuel,

That syntax error is getting raised from here:
https://github.com/django/django/blob/master/django/apps/registry.py#L89

To check the validity of that syntax, I created a file with the following
code:
```
class AppLabel(object):
def __init__(self):
self.label = 'herring'
app_config = AppLabel()
if True:
raise Exception(
"Application labels aren't unique, "
"duplicates: %s" % app_config.label)
```
And ran it. It did not raise a syntax error. Could you try saving that code
to a file, naming it testsyntax.py and then running it with

C:\Users\LENOVO> python testsyntax.py

I'm running on OSx. I don't know why the syntax should fail in one case and
succeed in the other, but it is worth a try.

-- Andrew Farrell

On Thu, Dec 3, 2015 at 7:56 AM, Emmanuel Olodun 
wrote:

> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>
> C:\Users\LENOVO>django-admin.py
> Traceback (most recent call last):
>   File "C:\Python27\Scripts\django-admin.py", line 2, in 
> from django.core import management
>   File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
> line
> 10, in 
> from django.apps import apps
>   File "C:\Python27\lib\site-packages\django\apps\__init__.py", line 2, in
>  le>
> from .registry import apps  # NOQA
>   File "C:\Python27\lib\site-packages\django\apps\registry.py", line 89
> duplicates: %s" % app_config.label)
>  ^
> SyntaxError: invalid syntax
>
> C:\Users\LENOVO>
>
> this is th error message i've been getting for like 2weeks now pls
> somebody help
>
> --
> 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/2cb7ed54-35ab-4b0c-8d4d-5fb88071d097%40googlegroups.com
> 
> .
> 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/CA%2By5TLZiX8pX8Tyj8Y2Qgrh6ap_N7g2UsUC4Y2EpGEuVQ5TNcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrating from OneToOneField to ForeignKey in Django models

2015-12-03 Thread Cajetan Rodrigues
Hi,

I faced this issue recently and stumbled onto this thread.

I see that the ticket has been fixed and closed already.
How do I see which Django release has the fix shipped with?

Thanks for your help.
Cajetan.

On Saturday, 17 January 2015 04:07:21 UTC+5:30, Łukasz Harasimowicz wrote:
>
> It's me again.
>
> I have managed to reproduce the problem and I have created a ticket: 
> https://code.djangoproject.com/ticket/24163.
>
> W dniu poniedziałek, 12 stycznia 2015 23:32:54 UTC+1 użytkownik Łukasz 
> Harasimowicz napisał:
>>
>> Hi Colin.
>>
>> On behalf of my colleague I will answer your question:
>>
>> We did not have time (at this moment) to investigate this problem any 
>> further. We've added a raw sql commands to disable foreign key checks 
>> during this migration. We could do it since we are still learning Django 
>> (and it's new migrations) and in the end we will probably remove all 
>> current migrations altogether (just before initial deployment). However we 
>> also think that this might be a bug and we will try to reproduce this 
>> problem with a fresh project. Hopefully sometime this week.
>>
>> W dniu poniedziałek, 12 stycznia 2015 21:32:39 UTC+1 użytkownik Collin 
>> Anderson napisał:
>>>
>>> Hi,
>>>
>>> Did you figure it out? This seems like a bug. Can you reproduce it with 
>>> a fresh project?
>>>
>>> Thanks,
>>> Collin
>>>
>>> On Friday, January 9, 2015 at 8:49:56 AM UTC-5, Maciej Szopiński wrote:

 Hi everyone,

 I've encountered an issue when working with django and I can't seem to 
 find a way out of this..

 I am using django 1.7.2 and a MySQL database. 
 I have a model that was using a One-to-One relationship with two other 
 models. At first I thought, the One-to-One relationship will be enough, 
 but 
 as things changed in the project I had to change the relationship to 
 Many-to-One.

 I changed only two lines in my code, in my model I had:

 product = models.OneToOneField(Product)
 category = models.OneToOneField(Category)

 and changed it to:

 product = models.ForeignKey(Product)
 category = models.ForeignKey(Category)

 I created the db migrations using ./manage.py makemigrations, but when 
 I run the migration with 'migrate' it keeps throwing this error. 

 django.db.utils.OperationalError: (1553, "Cannot drop index 
 'product_id': needed in a foreign key constraint")

 I tried to check what sql operations are executed in this case and it 
 seems that django tries to run 
 ALTER TABLE 'xxx' DROP INDEX 'yyy' and
 ALTER TABLE `xxx` DROP FOREIGN KEY `xxx_yyy_id_{some_hash}_fk_yyy_id`;

 I am not sure if this is the right order for these operations, when 
 running it manually on the database in the reverse order (first the DROP 
 FOREIGN KEY then DROP INDEX) it works correctly. 

 Have you encountered this issue before? Have you got any suggestions on 
 how to resolve this situation? 
 I would like to avoid any manual SQL changes outside of django 
 migrations. 

 Thanks in advance. 

 Best regards, 
 Maciej Szopiński

>>>

-- 
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/6cc802bc-75e4-446d-9812-1f10488483cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


am new to django and at a dead end or so i think

2015-12-03 Thread Emmanuel Olodun
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\LENOVO>django-admin.py
Traceback (most recent call last):
  File "C:\Python27\Scripts\django-admin.py", line 2, in 
from django.core import management
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", 
line
10, in 
from django.apps import apps
  File "C:\Python27\lib\site-packages\django\apps\__init__.py", line 2, in 

from .registry import apps  # NOQA
  File "C:\Python27\lib\site-packages\django\apps\registry.py", line 89
duplicates: %s" % app_config.label)
 ^
SyntaxError: invalid syntax

C:\Users\LENOVO>

this is th error message i've been getting for like 2weeks now pls somebody 
help

-- 
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/2cb7ed54-35ab-4b0c-8d4d-5fb88071d097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Testing if app has automatically logged out.

2015-12-03 Thread Meg Bledsoe
My teammates copy and pasted this code into an app for our project.
lass AutoLogout:
  def process_request(self, request):
if not request.user.is_authenticated() :
  #Can't log out if not logged in
  return

try:
  if datetime.now() - request.session['last_touch'] > timedelta( 0, 
settings.AUTO_LOGOUT_DELAY * 60, 0):
auth.logout(request)
del request.session['last_touch']
return
except KeyError:
  pass

request.session['last_touch'] = datetime.now()


I'm trying to write a test to make sure this works. So far I've tried a lot 
of things, but I don't have much experience with testing. This is what I 
have, but I don't know how to fix it.

class AutoLogoutTest(unittest.TestCase):

def setUp(self):
self.loggedout = AutoLogout()
self.request = Mock()
self.client = Client()
self.user = User.objects.create_user(username='testuser', 
password='pass')
self.client.login(username='testuser', password='pass')

def test_auto_logout(self):
session['last_touch'] = timedelta(31*60)
response = self.client.get('/logout/', follow=True)
self.assertRedirects(response, '/')
message = list(response.context['messages'])
self.assertEqual(str(message[0]), 'You have successfully logged 
out.')
self.assertNotIn('_auth_user_id', self.client.session)

Any help would be appreciated.

-- 
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/9b85e5e7-fe00-4b46-977b-d1217d3abb35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best approach to write unit tests involving rest apis.

2015-12-03 Thread Xavier Ordoquy

> Le 3 déc. 2015 à 08:08, learn django  > a écrit :
> 
>  On Wednesday, December 2, 2015 at 10:48:52 PM UTC-8, Xavier Ordoquy wrote:
> Hi, 
> 
> > Le 3 déc. 2015 à 00:12, learn django  
> > a écrit : 
> > 
> > My app uses rest framework. 
> > I am writing test cases which involve standard requests like 
> > GET/POST/DELETE/PUT. 
> > What is the best approach to write the test cases ? 
> 
> Django REST framework comes with a test client named APIClient. 
> It will go through the middleware and urls before calling your API entry 
> points which seems to be what you’re looking for. 
> The documentation about it is available at 
> http://www.django-rest-framework.org/api-guide/testing/#apiclient 
>  
> 
> 
> Hi Linovia,
> 
> Yes, I started with that.
> Initially I was getting 403 (auth failure) since my backend handlers have 
> @login_required decorator.

This may be an issue since a Django REST framework view shouldn’t use this 
decorator.
If it is a regular Django view that returns a JSON response, then you should 
consider using the Django client directly.

> To overcome that i created a super user (python manage.py superuser) &
> used those credentials as below.
> 
> # url = '/orca/api/v2/customer/'
> # data = {'c_name':'Pnc', 'c_role':'API-Admin'}
> # client = APIClient()
> # client.login(username='admin', password='admin')
> # response = client.post(url, data, format='json') 
> 
> After this I started was getting 302 (redirects).
> Have you encountered similar issue before ?

Where does it redirects you to ? If it’s the login page, it means that somehow 
the login call didn’t work.

Regards,
Xavier,
Linovia.

-- 
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/1E2EC51D-42E8-4654-8ABE-57D5F5479128%40linovia.com.
For more options, visit https://groups.google.com/d/optout.


Re: DataError on get_or_create with nullable fields

2015-12-03 Thread mccc
Well turns out it was actually the `master_id` foreign key that was being 
set to garbage, hence the DataError;
everything besides me is working as intended.

cheers

On Wednesday, December 2, 2015 at 6:03:22 PM UTC+1, mccc wrote:
>
> (this is mostly copied/pasted from my comment on an eight-years-old issue 
> here )
>
> I cannot get the get_or_create operation to create non-existing object 
> with nullable field, getting a `DataError: integer out of range` error.
>
> The query goes like so: 
> `Test.objects.get_or_create(**{u'device_preference__isnull': True, 
> u'test_type': u'TextTest', u'master_id': 1234, u'testset_id__isnull': 
> True})` where `device_preference` is a nullable PositiveIntegerField and 
> `testset_id` is a ForeignKey.
>
> Attached traceback shows that the issue happens on creation, I believe.
>
> {{{
> Traceback (most recent call last):
>   File "", line 1, in 
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/manager.py",
>  
> line 127, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 407, in get_or_create
> return self._create_object_from_params(lookup, params)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 439, in _create_object_from_params
> obj = self.create(**params)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 348, in create
> obj.save(force_insert=True, using=self.db)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/base.py",
>  
> line 734, in save
> force_update=force_update, update_fields=update_fields)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/base.py",
>  
> line 762, in save_base
> updated = self._save_table(raw, cls, force_insert, force_update, 
> using, update_fields)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/base.py",
>  
> line 846, in _save_table
> result = self._do_insert(cls._base_manager, using, fields, update_pk, 
> raw)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/base.py",
>  
> line 885, in _do_insert
> using=using, raw=raw)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/manager.py",
>  
> line 127, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/query.py",
>  
> line 920, in _insert
> return query.get_compiler(using=using).execute_sql(return_id)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>  
> line 974, in execute_sql
> cursor.execute(sql, params)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/backends/utils.py",
>  
> line 79, in execute
> return super(CursorDebugWrapper, self).execute(sql, params)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/backends/utils.py",
>  
> line 64, in execute
> return self.cursor.execute(sql, params)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/utils.py", 
> line 98, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/Users/mccc/Dev/venvs/tools/lib/python2.7/site-packages/django/db/backends/utils.py",
>  
> line 64, in execute
> return self.cursor.execute(sql, params)
> DataError: integer out of range
> }}}
>
> I have not reopened the issue, just because, but I'd welcome any possible 
> comment.
> Thank you.
>

-- 
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/c27fdf3b-ecc4-4245-b551-e7b28be7b90a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.