Re: edit model properties in the admin

2018-02-14 Thread Melvyn Sopacua
On woensdag 14 februari 2018 15:01:15 CET Andy wrote: > Well, i know this and the related entry is accessible even without > explicitly defining the related_name. You can change defaults defining the > related_name, tho. > But still trying to add a UserInline to the ProfileAdmin wont work due to

Re: edit model properties in the admin

2018-02-14 Thread Andy
Am Mittwoch, 14. Februar 2018 14:45:49 UTC+1 schrieb Adler Neves: > > You can have an OneToOneField in the profile referencing Django's User > model with `related_name='profile'`, Well, i know this and the related entry is accessible even without explicitly defining the related_name. You

Re: edit model properties in the admin

2018-02-14 Thread Adler Neves
You can have an OneToOneField in the profile referencing Django's User model with `related_name='profile'`, so you can access information from there as `user.profile.birthday`. An useful link: https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html About

Re: edit model properties in the admin

2018-02-14 Thread Andy
As an example i wanted to have the username editable inside the profile. Since the Django default user doesnt have a foreign key to profile i cant just use an inline admin for the user model, so my next idea was to solve it with properties just getting from and saving to the related user model.

Re: edit model properties in the admin

2018-02-14 Thread Gonzalo Delgado
On 14/2/18 08:05, Andy wrote: > Im trying to have a custom admin that is also able to edit some model > properties, but putting those properties into my fieldsets its complaining What would mean to edit a property (assuming this means an attribute that isn't a model field) in your app? Where

edit model properties in the admin

2018-02-14 Thread Andy
Im trying to have a custom admin that is also able to edit some model properties, but putting those properties into my fieldsets its complaining Unknown field(s) (foo, bar) specified for Profile. Check fields/fieldsets/exclude attributes of class ProfileAdmin. The properties work in