Re: null datetime field and json fixtures

2016-02-25 Thread Malik Rumi
This will probably be very helpful. Thanks. On Wed, Feb 24, 2016 at 3:39 PM, James Schneider wrote: > > > On Wed, Feb 24, 2016 at 11:26 AM, Malik Rumi > wrote: > >> I am pursuing the debug option now to see what I can learn. >> >> >> > > Have

Re: null datetime field and json fixtures

2016-02-24 Thread James Schneider
On Wed, Feb 24, 2016 at 11:26 AM, Malik Rumi wrote: > I am pursuing the debug option now to see what I can learn. > > > Have you looked at enabling tracebacks (--traceback) and increasing the verbosity of the loaddata command (-v {0,1,2,3}, --verbosity {0,1,2,3})? $

Re: null datetime field and json fixtures

2016-02-24 Thread Malik Rumi
I am pursuing the debug option now to see what I can learn. On Fri, Feb 19, 2016 at 5:29 PM, Michal Petrucha < michal.petru...@konk.org> wrote: > On Fri, Feb 19, 2016 at 10:20:42AM -0600, Malik Rumi wrote: > > In [1]: import uuid > > > > In [2]:

Re: null datetime field and json fixtures

2016-02-24 Thread Malik Rumi
Sorry to have dropped out for a few days there. James, when I said I only have this one I should clarify. I had 90 records I wanted to put into one model, and 1 record to put into another. The 1 record is linked to by a fk from the other 90. For whatever reason, I was able to put the single record

Re: null datetime field and json fixtures

2016-02-19 Thread Michal Petrucha
On Fri, Feb 19, 2016 at 10:20:42AM -0600, Malik Rumi wrote: > In [1]: import uuid > > In [2]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74') > Out[2]: UUID('61877565-5fe5-4175-9f2b-d24704df0b74') > > BUT > > In [3]: uuid.UUID4('61877565-5fe5-4175-9f2b-d24704df0b74') >

Re: null datetime field and json fixtures

2016-02-19 Thread James Schneider
> > The only uuid currently in this fixture is the one I got from Django when > I put another model (only one row) in with a fixture (no date field) and it > worked. I needed the uuid of that object to put into the foreign key of the > model I am having trouble with now. > > > So I was sniffing

Re: null datetime field and json fixtures

2016-02-19 Thread Malik Rumi
In [1]: import uuid In [2]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74') Out[2]: UUID('61877565-5fe5-4175-9f2b-d24704df0b74') BUT In [3]: uuid.UUID4('61877565-5fe5-4175-9f2b-d24704df0b74') --- AttributeError

Re: null datetime field and json fixtures

2016-02-18 Thread James Schneider
On Thu, Feb 18, 2016 at 8:20 AM, Malik Rumi wrote: > James, > > I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the > csv to json. > Looks legit. I'll just assume it creates syntactically correct JSON, otherwise it probably wouldn't last long as a

Re: null datetime field and json fixtures

2016-02-18 Thread Malik Rumi
UPDATE: I went back and looked at the Python module documentation you referenced again. Although it is true that the examples at the top of the page don't strictly match the 8-4-4-4-12 format, those at the bottom of the page do. Furthermore, it seems clear that the uuid.UUID() function is a

Re: null datetime field and json fixtures

2016-02-18 Thread Michal Petrucha
On Thu, Feb 18, 2016 at 08:20:57AM -0800, Malik Rumi wrote: > James, > > I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the > csv to json. > > On Wednesday, February 17, 2016 at 7:05:59 PM UTC-6, James Schneider wrote: > > > > > >> The uuid.UUID() function is somewhat

Re: null datetime field and json fixtures

2016-02-18 Thread Malik Rumi
James, I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the csv to json. On Wednesday, February 17, 2016 at 7:05:59 PM UTC-6, James Schneider wrote: > > >> The uuid.UUID() function is somewhat forgiving when it comes to providing > values. See

Re: null datetime field and json fixtures

2016-02-17 Thread James Schneider
> > > Last night before posting I hacked serializers/python.py to make an > exception for sunsetdate, and that apparently worked, but now I have this: > Yeah...don't do that. Fix your data. > File >

Re: null datetime field and json fixtures

2016-02-17 Thread Malik Rumi
First, thank you to both Avraham and James. In my view, it isn't said often enough on the internet, and I've had many questions go without a response at all. So please understand that I mean it very much when I say I deeply appreciate the time you took to help me. Now as to the matter at hand:

Re: null datetime field and json fixtures

2016-02-17 Thread James Schneider
On Tue, Feb 16, 2016 at 4:35 PM, Malik Rumi wrote: > There are a ton of answers to this question out there - if you can wade > through all the ones that refer to forms and not models. The consensus > seems to be that datetime has to be set to both blank=true and

Re: null datetime field and json fixtures

2016-02-17 Thread Avraham Serour
Try not setting any value to the field, it should be saved with the default value On Wed, Feb 17, 2016, 2:35 AM Malik Rumi wrote: > There are a ton of answers to this question out there - if you can wade > through all the ones that refer to forms and not models. The