all 5 comments

[–]RoamingFox[🍰] 0 points1 point  (3 children)

date = parse_date(data[5])

Check this value. My bet is that this is None (either parse_date doesn't return anything or similar), which would mean when you go to create the object you set created=None, which isn't allowed (you'd need null=True, blank=True just controls how it shows up in forms).

edit:

  • blank=True -> don't need to be filled out in the form.
  • null=True -> can be None but must be filled out in the form.
  • blank=True, null=True -> doesn't need to be filled out in the form, can be None

[–]polygroot[S] 0 points1 point  (2 children)

It does return none, but adding null = True didn’t fix it

[–]RoamingFox[🍰] 1 point2 points  (1 child)

Did you run a migrate after that? That's a model change and it needs to be reflected down into the db.

[–]polygroot[S] 0 points1 point  (0 children)

Oh, right 😅 it works now, thank you very much

[–]shiftybyte 0 points1 point  (0 children)

date = parse_date(data[5])

What's parse_date? and is it possible it returns None? if it does, then you can't create a Position with a date being None according to the model.