* ui_ux: => 0
* easy: => 0
Comment:
Was this behavior intentionally reverted? In Django 2.1.7, I'm getting
the error:
> TypeError: int() argument must be a string, a bytes-like object or a
number, not 'Group'
It's coming from this code (because I can fix it by adding `.pk` to the
`get` call):
{{{
# Can't serialize lambdas in migrations, but functions are fine
def const_my_group():
return Group.objects.get(name=settings.MY_GROUP)
class Task(models.Model):
group = models.ForeignKey(Group, default=const_my_group,
on_delete=models.PROTECT)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/6445#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: => Uncategorized
* severity: => Normal
Comment:
Yes, you should use `.pk` -- see #25129.
--
Ticket URL: <https://code.djangoproject.com/ticket/6445#comment:6>