autocomplete django template context variables
is there a way to autocomplete the variables passed into the template by the view in django?
For example, I'm passing a model into template 1 and I'd like to have pycharm show me the handy dropdown with all the model attributes when i type {{ mymodel.
the project structure looks like this
For example, I'm passing a model into template 1 and I'd like to have pycharm show me the handy dropdown with all the model attributes when i type {{ mymodel.
the project structure looks like this
project - apps - app1 - templates index.html about.html + migrations __init__.py views.py models.py manage.py
Please sign in to leave a comment.
class StudentReportCardView(View): template_name = "inquest/assessment/student_report_card.html" def get(self, request, student_id): student_profile = get_object_or_404(users_models.StudentProfile, uuid=student_id) taken_assessments = models.StudentAssessments.objects.filter(student=student_profile.user, score__gte=0.0) assessments_needing_graded = models.StudentAssessments.objects.filter(student=student_profile.user, score__lt=0.0) return render_to_response(self.template_name, RequestContext(request, { 'student_profile': student_profile, 'taken_assessments': taken_assessments, 'assessments_needing_graded': assessments_needing_graded, }))render_to_response("inquest/assessment/student_report_card.html", ...)I read that too early in the morning to realize it said "template". I will open a ticket as Django's class based views make use of the template_name variable
https://docs.djangoproject.com/en/dev/topics/class-based-views/