semvec/pypi-packages huggingface dataset:
django-improved-inlines 0.2.2
Inline object rendering for django, based on django-basic-apps + filters + templates
License: BSD

=======================
Django Improved Inlines
=======================

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


.. _django-basic-apps: http://github.com/nathanborror/django-basic-apps/
.. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/
aino-jstools 0.1.0.6
JavaScript tools for Django
License: BSD

============
aino-jstools
============

aino-jstools is a set of tools for working with JavaScript and Django.
Primarily it compiles javascripts.


Design background
-----------------
We wanted to make a tool that made including a bunch of JavaScripts in a
template easy and clean and compiling all those JavaScripts into packed pieces
in production for optimal performance. The other goal we wanted to achive was
to expose urls defined in ``urls.py``, ``MEDIA_URL``, ``DEBUG`` settings to
JavaScript code. Our future includes making a cleaner implementation for i18n
in JavaScript than the one provided by Django.


Requirements
------------
- Django 1.x
- Python 2.5+
- Java (for compiling JavaScripts)


Install
-------
Include ``jstools`` in ``INSTALLED_APPS`` in your project settings.
Optionally include the jstools/urls.py in your ``urls.py``::

   (r'^jstools/', include('jstools.urls'))


Template usage
--------------
First define your scripts in a template as follows::

    {% scripts "js/mysite-min.js" %}
        http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js
        js/a.js
        js/b.js
        {% url jshelper %}
    {% endscripts %}

When ``settings.DEBUG`` is ``True`` this will translate to::

    <script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>
    <script src="{{ MEDIA_URL }}js/a.js"></script>
    <script src="{{ MEDIA_URL }}js/b.js"></script>
    <script src="{% url jshelper %}"></script>

When ``settings.DEBUG`` is ``False`` this will translate to::

    <script src="{{ MEDIA_URL }}js/mysite-min.js?TIMESTAMP"></script>

where ``TIMESTAMP`` is based on modification date of
``{{ MEDIA_ROOT }}js/myste-min.js``


Compiling
---------
Compiling all defined scripts is as simple as running::

    python manage.py buildjs

If you are using the default ``filesystem`` and/or
``app_directories`` this management command will find all templates with
``{% scripts %}`` tags and compile its contents into the first argument of the
tag.


jshelper view
-------------
This view will output named urls, ``settings.MEDIA_URL``, ``settings.DEBUG``
(I suggest you override this in your template unless you want to recompile the
script when you change your ``DEBUG`` setting) for use in your JavaScript code. You
will have access to a JavaScript object named ``JSTOOLS`` by default, you can
change the name by setting ``JSTOOLS_NAMESPACE``.

``JSTOOLS.settings.MEDIA_URL``
    ``settings.MEDIA_URL``

``JSTOOLS.settings.DEBUG``
    ``settings.DEBUG``

``JSTOOLS.get_url``
    This function will get named urls defined in your ``urls.py``. First argument is
    the name of the named url, subsequent arguments are arguments passed to that
    pattern. Examples::

        JSTOOLS.get_url('jshelper');
        JSTOOLS.get_url('blog_entry', 2010, 04, 25, 'aino-jstools');