Skip to main content

Inline object rendering for django, based on django-basic-apps + filters + templates

Project description

Django improved inlines is a version of the inlines app from django-basic-apps that has two specific features that I needed:

  • filter=”” instead of just ids= and id=

  • template=”” instead of just inlines/<app>_<model>.html

That’s it. Thanks to nathanborror for the initial code.

Dependancies

Usage

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>” />

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 }}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-improved-inlines-0.1.4a.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file django-improved-inlines-0.1.4a.tar.gz.

File metadata

File hashes

Hashes for django-improved-inlines-0.1.4a.tar.gz
Algorithm Hash digest
SHA256 8f763402e045407cd4f88c0a159e9cb7a5af33ff18be5a040346c4f4793ec580
MD5 2bcae4a22c1d8dc625d26bcc6d00beb2
BLAKE2b-256 494a9c227bee35554c479e4f9c75998ec1c45d4c1ecc41c07193810f246844c4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page