Hi,
I agree excluding it from the form is the way to go and setting it in one
of the save_* methods.
But, couldn't you also do _both_ of your methods :)
Collin
On Wednesday, December 10, 2014 3:38:48 AM UTC-5, Akshay Mukadam wrote:
>
> Hi,
> I just want to show the current logged in user in fo
Hmmm... why are you showing the user field in the first place? I would
exclude it from the form and set it programatically after the user as
submitted the form.
On Wed, Dec 10, 2014 at 5:38 AM, Akshay Mukadam
wrote:
> Hi,
> I just want to show the current logged in user in for foreign key in
> D
Hi,
I just want to show the current logged in user in for foreign key in Django
admin. Following are the approach used buy me:
1-> def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "user":
"set the current user as a default value for drop dow
3 matches
Mail list logo