last day (15 days later) » 

3:39 PM
Can we continue here?
 
Unfortunately my answer is still the same. I need to see the template to give you a definitive answer.
 
That's fine, just wanted to ask one thing
Sice the User is managed by the django.auth
And user groups are added by me from django admin
Which template do you need to see?
 
The one where you're doing the comparison and / or the one that defines the two things being compared.
 
Calendar group are also made manually from django admin
 
I'm guessing the problem is that the groups you're comparing aren't the same type as you're implying. auth.Group != CalendarGroups
 
3:49 PM
I didn't make any comparing since I cant figure it out
I'm logged in as Admin user btw
I suppose I need something like {% if request.user.groups in cal.calendar_master.group %}
 
Yeah, cal.calendar_master.group is a CalendarGroups instance. request.user.groups is an auth.Group instance. You can't compare them directly like you're trying.
 
Oh
 
No, you can't even do what you have there either.
 
Didn't knew that
So is there any way to check if the user is in a same group as calendar?
 
Install the django debug toolbar. It'll help you see what the template is being rendered with. It would have shown you that your assumption about those types being the same was incorrect.
If there's a relationship between User and CalendarGroups, yes. If not, then no.
 
3:53 PM
Is there a way to relate user groups with calendar groups?
I need that because only matching user group can see the same calendar group
I need to add another field in the calendar groups which will be related to user groups?
 
Exactly.
You need to consider the requirements though. Should it be a OneToOneField, ForeignKeyField or ManyToManyField. Only you can answer it and it is dependent on what you all need to support or limit.
Anyway, I need to go. Good luck.
 
Thanks
Bb
 

last day (15 days later) »