Python Forum
get_absolute_url function not working?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get_absolute_url function not working?
#4
Actually, since changing my form to the below, it now no longer works even though I have enctype="multipart/form-data"

{% extends 'music/base.html' %}

{% block title %}Add a New Album{% endblock %}
{% block body %}
	<form class="formContainer" method="post" enctype="multipart/form-data">
		{% csrf_token %}
		{% for field in form %}
			{% if field.label != 'Album logo' %}
				<label for="field{{ forloop.counter }}">{{ field.label }}</label>
				<input type="text" id="field{{ forloop.counter }}" name="" value="">
			{% else %}
				<label for="field{{ forloop.counter }}">{{ field.label }}</label>
				<input type="file" id="field{{ forloop.counter }}" name="" value="" accept="image/*">
			{% endif %}
			<br>
		{% endfor %}
		<input type="submit" id="submitBtn" name="" value="Add">
	</form>
{% endblock %}
Upon clicking the submit button in the form, it should take me to the details page for the Album that got created.
Does anyone have any idea please?
Reply


Messages In This Thread
get_absolute_url function not working? - by mp3909 - Jul-11-2020, 07:03 PM
RE: get_absolute_url function not working? - by mp3909 - Jul-15-2020, 07:11 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020