I am trying to render a ManyToManyField from a model that render a list of hotels with staff that belong to each hotel.
I am trying to display in the template the users that are inside the current hotel being shown but I get an error
auth.User.None
my template
{% for Hotel in object_list %}
{{ Hotel.collaborateurs }}
{% endfor %}
My models.py
class Hotel(models.Model):
collaborateurs = models.ManyToManyField(User, verbose_name="Liste des collaborateurs autorisés")
(....)
Thanks
Edit ;
I am able to rend users but I have an unesthetic code being render : .
I would like to render only the username.