0๐
โ
Iโve resolved it in a less elegant way, but it worked for me.
Iโve created a sort of singleton in my User
defined class, with a property that i set in every view i need it.
The property is User.current
.
Then, inside the models, where i need that i get the current user looking in User.current
.
๐คapelliciari
1๐
Write custom template tags that take the user and set a context variable to indicate presence or absence of the criterion.
- [Answer]-Create a User Object with a Call to TastyPie API
- [Answer]-Django Mongoengine concurrent saves are failing
- [Answer]-Validation fails when customizing django form in template
Source:stackexchange.com