models.py
class AppUser(models.Model):
name = models.CharField(max_length=30)
last_logon = models.DateTimeField(auto_now=True)
views.py
class SomeView(View):
def get(self, request, *args, **kwargs):
appuser = AppUser(name="Some Person").save()
works perfectly!
So im just not sure if this is working as intended. But if I use the code shown above the python appuser object = None
However if I break it down into 2 statements like this ;
appuser = AppUser(name="Some Person")
appuser.save()
so it seems like simply instantiating the object will returns as expected but the save() does not return or returns None.
Is this by design? Took me forever to find this bug hidden is the bowels of my code