Skip to content

Commit

Permalink
Merge pull request #7 from Skytek/dev
Browse files Browse the repository at this point in the history
Improve forms: better layout and allow file uplaods
  • Loading branch information
wlatanowicz authored Nov 18, 2023
2 parents 6aa6790 + 7a73723 commit b65977f
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% if tool.has_inline_form %}
{% url tools_view_name pk=object_id tool=tool.name as action_url %}
<div class="clear">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}" enctype="multipart/form-data">
{% csrf_token %}
<ul class="object-tools django-object-actions">
{{ tool.form.as_ul }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% if tool.has_inline_form %}
{% url tools_view_name tool=tool.name as action_url %}
<div class="clear">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}" enctype="multipart/form-data">
{% csrf_token %}
<ul class="object-tools django-object-actions">
{{ tool.form.as_ul }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

{% block content %}
<div id="content-main">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}">
<form name="{{ tool.name }}__form" method="post" action="{% add_preserved_filters action_url %}" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_table }}
{{ form.as_p }}
<div>
<input type="submit" value="Submit" name="modal_submit">
<input type="submit" value="Cancel" name="modal_cancel">
Expand Down
2 changes: 0 additions & 2 deletions example_project/polls/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def get_change_actions(self, request, object_id, form_url):


class CommentAdmin(DjangoObjectActions, admin.ModelAdmin):

# Object actions
################

Expand All @@ -192,7 +191,6 @@ def hodor(self, request, obj):


class RelatedDataAdmin(DjangoObjectActions, admin.ModelAdmin):

# Object actions
################

Expand Down
1 change: 0 additions & 1 deletion example_project/polls/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("polls", "0001_initial"),
]
Expand Down

0 comments on commit b65977f

Please sign in to comment.