I am trying to create my own Learning Management System (LMS) as a project to learn a range of programming languages. So far users can login/logout and register.
However what i want the system to do is to return a post to the user specific to the group I have assigned to them in the admin page.
EXAMPLE user:'Steve' is assigned to group:'Maths' When 'Steve' logs in, if there are any posts assigned to 'Maths' then i want only those posts to be shown on their homepage. Further to this, if 'steve' is in other groups, I want posts from those groups to also be displayed.
Below is html of the homepage which i have created. with this i can only show all posts to a user if they are in a very specific group.
I understand that somewhere i will need to do some python programming to get this to work. If you need to see any more of my code I will be more than happy to provide. Thank You :)
<div class="row">
{% for group_for in request.user.groups.all %}
{% if group_for.name == "Science" %}
{% for work in homework %}
<div class="row">
<div class="col s12 m6 14">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">{{work.homework_title}}</span>
<p>{{work.homework_description | safe}}</p>
<p>{{work.homework_deadline}}</p>
<p>{{work.homework_issued_by}}</p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
<a href="#">This is a link</a>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endfor %}