I have a many-to-one relationship defined between 2 models. When I associate data from the many side model to the one sided model and click save in the Admin area, the database does not reflect this save.
How should I investigate this?
I was asking if it is the same reason that some situations many-to-many doesn’t save in admin, but that is probably unnecessary information. I really only care about getting my many-to-one to save right now.
Thanks again, I do appreciate all the insights those on here can share
That first post is dangerously out-of-date, and from SO, so I put no value in it at all. I can’t tell where that other post comes from.
If you’re having a specific issue with your implementation, I’d suggest you post your models and your model admin classes here for us to be able to assist you.
Side note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then the code then another line of ```. (Do this for each file.)
I have data in Team (say Team 1) and a Teammember who is also a user.
When I try to assign the Teammember in the Teammember model in Admin to a Team (Team 1) in Admin, I click the save button, it appears to save, but opening up Teammember again, and it is not saved.
I am not using ModelAdmin.
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
# Register your models here.
from .models import Teammember, Team