Skip to content

Commit

Permalink
come on i know this works
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Apr 26, 2024
1 parent d2a23bd commit 69a1ae7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/meshapi/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class NonrelatedBuildingInline(BetterNonrelatedInline):
fields = ["primary_node", "bin", "street_address", "city", "zip_code"]
readonly_fields = fields

add_button = True

def get_form_queryset(self, obj):
return self.model.objects.filter(nodes=obj)

Expand Down
11 changes: 11 additions & 0 deletions src/meshapi/templates/admin/install_tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,16 @@ <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
</tbody>
</table>
</fieldset>
<div>
<p>test</p>
{% if inline_admin_formset.opts.add_button %}
<p>{{ inline_admin_formset.opts }}</p>
<p>{{ inline_admin_formset.opts.model }}</p>
<p>{{ inline_admin_form.opts.model }}</p>
<p>{% url 'request.get_host()' %}</p>
<p>{% url 'admin:meshapi_building_add' %}</p>
<a href="{{ inline_admin_formset.opts.model.add_url }}" class="addlink">Add</a>
{% endif %}
</div>
</div>
</div>

0 comments on commit 69a1ae7

Please sign in to comment.