Django improved inlines is a version of the inlines app from django-basic-apps that has a few specific features that I needed:
filter=”” instead of just ids= and id=
template=”” instead of just inlines/<app>_<model>.html
Support for non-<inline> tags by prefixing “data-inline-” to type, ids, id, filter
Thanks to nathanborror for the initial code.
Dependancies
BeautifulSoup is required to use the inlines app.
Usage
Install in INSTALLED_APPS so the templates can be found
“improved_inlines”
Inlines is a template filter that can be used in conjunction with inline markup to insert content objects into other pieces of content. An example would be inserting a photo into a blog post body.
Drop-in replacement for django-basic-inlines/inlines
- An example of the markup is::
<inline type=”calendar.event” filter=”date__gte=datetime.date.today()” template=”calendar/event_inline.html” />
- other attribute options are::
<inline type=”app.model” id=”<some pk>” class=”some_class_passed_to_template”/> <inline type=”app.model” ids=”<some pk>,<some other pk>” />
- examples with other tags::
<div data-inline-type=”app.model” data-inline-id=”<some pk>”></div> <ul data-inline-type=”app.model” data-inline-ids=”<some pk>,<some other pk>”></ul> <p data-inline-type=”app.model” data-inline-filter=”title__containts=’title-string’”></p>
The type attribute is app_name.model_name and the id is the object id. Pretty simple.
- In your template you would say::
{% load inlines %} {{ post.body|render_inlines }}
Metadata
Release files for django-improved-inlines 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-improved-inlines-0.2.2.tar.gz | 5.5 kB | Without provenance | Details |
Release files / django-improved-inlines-0.2.2.tar.gz
| Download URL | django-improved-inlines-0.2.2.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48cd382de88510e4632b50ff8406858c6651deea48c5436934b8ffad37f0dd74
|
|
BLAKE2b-256 checksum How to use checksums |
52b301b77ab5136f486c51e0dd236bee269ef166fcf2f2e012b1aef9ff18e4eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-improved-inlines 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.