Re: Trying to replace a char field with a forgein key feild

2018-08-29 Thread 'Matthew Stroud' via Django users
Thanks for the reply. Sadly in the process of me messing around with, I somehow fixed it. I'm not sure how, but when I get a chance I'll look through my changes and see what did it. In the meantime, I'm going to claim user error until I can figure it out. Thanks, Matthew Stroud On 8/29/18,

Re: Trying to replace a char field with a forgein key feild

2018-08-29 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Mon, Aug 27, 2018 at 09:37:03AM -0700, mattstroud via Django users wrote: > So when we started the database, it was good enough to have a char field > with choices. But as time progressed I need to convert that field to a > foreign key field.

Re: Trying to replace a char field with a forgein key feild

2018-08-28 Thread 'Matthew Stroud' via Django users
Thanks for the reply. This is a perfect coverage of steps 1 through 3 in what I'm doing, but it will break when I do step 4. I basically need to extend the model temporarily so the code doesn't break (I just thought of this so I'll try to implement it). Thanks, Matthew Stroud On 8/28/18,

Trying to replace a char field with a forgein key feild

2018-08-28 Thread Codewise IO
You are going to want to create an empty migrations file and edit it to make your data transformations. See this article. https://simpleisbetterthancomplex.com/tutorial/2017/09/26/how-to-create-django-data-migrations.html -- You received this message because you are subscribed to the Google

Trying to replace a char field with a forgein key feild

2018-08-27 Thread mattstroud via Django users
So when we started the database, it was good enough to have a char field with choices. But as time progressed I need to convert that field to a foreign key field. The follow I'm trying to take is such: 1. rename to tmp_ 2. create a new field with 3. have a RunPython fill the data