diff --git a/serializedata.py b/serializedata.py index 80f112e..6d4400a 100644 --- a/serializedata.py +++ b/serializedata.py @@ -1,10 +1,18 @@ from django.core import serializers import os - +import json os.environ.setdefault("DJANGO_SETTINGS_MODULE", "amadeus.settings") from subjects.models import Subject +from users.models import User +from categories.models import Category + +subject_data = serializers.serialize("json", Subject.objects.all()) + + +users_data = serializers.serialize("json", User.objects.all()) +category_data = serializers.serialize("json", Category.objects.all()) -data = serializers.serialize("json", Subject.objects.all()) -print(data) \ No newline at end of file +with open('data.txt', 'w') as outfile: + json.dump(category_data, outfile) \ No newline at end of file diff --git a/subjects/templates/subjects/subject_card.html b/subjects/templates/subjects/subject_card.html index a03b02b..da5d86c 100644 --- a/subjects/templates/subjects/subject_card.html +++ b/subjects/templates/subjects/subject_card.html @@ -11,7 +11,7 @@
{{subject.description_brief|safe}}
{% if show_buttons %} - {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in category.coordinators.all %} + {% if request.user in subject.students.all or request.user in subject.professor.all or request.user.is_staff or request.user in subject.category.coordinators.all %} {% trans "Access Subject" %} {% else %} {% trans "Subscribe to Subject" %} diff --git a/subjects/templates/subjects/view.html b/subjects/templates/subjects/view.html index 4e402ae..7b9120d 100644 --- a/subjects/templates/subjects/view.html +++ b/subjects/templates/subjects/view.html @@ -10,7 +10,8 @@ {% block breadcrumbs %} {{ block.super }} - + {% breadcrumb 'Home' 'subjects:home' %} + {% endblock %} @@ -18,6 +19,6 @@ {% include "subjects/subject_card.html" %} - + {% endblock content %} \ No newline at end of file -- libgit2 0.21.2