[Answer]-Get by id is generating error in Django/Mezzanine

1👍

You shouldn;t use your _id property to retrieve Models connected via a Foreign Key.
Do this instead:

user = models.ForeignKey(User)

And, in your view:

object_AllUsers = AllUsers.objects.get(user = request.user)

Also, you may want to use a OneToOneField, instead of ForeignKey.
See more about this here: https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey

Leave a comment