Commit b19865f8 by Aider Ibragimov

fix typo in adding jquery string, update docs about detail page link for AdminRenderer

parent 68312cb0
...@@ -187,6 +187,15 @@ This renderer is suitable for CRUD-style web APIs that should also present a use ...@@ -187,6 +187,15 @@ This renderer is suitable for CRUD-style web APIs that should also present a use
Note that views that have nested or list serializers for their input won't work well with the `AdminRenderer`, as the HTML forms are unable to properly support them. Note that views that have nested or list serializers for their input won't work well with the `AdminRenderer`, as the HTML forms are unable to properly support them.
**Note**: To get proper links to detail page in `ListCreateAPIView` or `ListAPIView` you should implement `url` field in serializer which return correct link. For example here we use models `get_absolute_url` method:
class AccountSerializer(serializers.ModelSerializer):
url = serializers.CharField(source='get_absolute_url', read_only=True)
class Meta:
model = Account
**.media_type**: `text/html` **.media_type**: `text/html`
**.format**: `'.admin'` **.format**: `'.admin'`
......
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
{% endif %} {% endif %}
{% block script %} {% block script %}
<script src="{% static "rest_framework/js/jquery-1.11.3-min.js" %}"></script> <script src="{% static "rest_framework/js/jquery-1.11.3.min.js" %}"></script>
<script src="{% static "rest_framework/js/ajax-form.js" %}"></script> <script src="{% static "rest_framework/js/ajax-form.js" %}"></script>
<script src="{% static "rest_framework/js/csrf.js" %}"></script> <script src="{% static "rest_framework/js/csrf.js" %}"></script>
<script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script> <script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script>
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
</td> </td>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<td><a href="{{ row.url }}"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <td>
</a></td> <a href="{{ row.url }}"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment