Backwards incompatible changes made in version 0.2.2
COMBINE_STRING is now used to build the template list when using PositionContent.render or render_content template tag.
Before:
/positions/my_position/<app>__<model>.html
New:
/positions/my_position/<app> <combine_string> <model>.html
Installation
Using PIP:
pip install django-kamasutra
or download the app here
python setup.py install
Add positions to your settings INSTALLED_APPS:
INSTALLED_APPS = (
...
'positions',
...
)
Add positions to your URLS:
import positions.urls
urlpatterns += patterns('',
url(r'^positions/', include(positions.urls)),
)
Run syncdb:
>>> ./manage.py syncdb
Getting Started
Creating your first position
The minimum required arguments to create a positions is a name, which is a SlugField.
from positions.models import Position position = Position.objects.create(name="MyPosition")
Add something to your Position
The position manager has a add_object method that takes, at minimum, 2 arguments, position and obj
position should be a positions.Position instance
obj can be any model instance
from myapp.models import MyApp obj = MyApp.objects.get_latest() Position.objects.add_object(position=position, obj=obj)
Retrieve your position content
The position manager has a get_content method that takes at least 1 argument, position.
position should be a positions.Position instance
position = Position.objects.get(name="MyPosition") content = Position.objects.get_content(position=position)
Retrieve your position content via templatetag
{% get_position_content position as content %}
get_position_content expects [position] [as] [varname]
position can be a positions.Position instance or a name of a position
Position {{ position }} has the following content:<br/>
<ul>
{% for obj in content %}
<li>{{ obj }}</li>
{% endfor %}
</ul>
Metadata
Release files for django-kamasutra 0.2.11
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 | Actions |
|---|---|---|---|---|
| django-kamasutra-0.2.11.tar.gz | 533.6 kB | Without provenance | Details for django-kamasutra-0.2.11.tar.gz |
Release files / django-kamasutra-0.2.11.tar.gz
| Download URL | django-kamasutra-0.2.11.tar.gz |
|---|---|
| Size | 533.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdd3ae895fc87c728a8c89a863fbeedd0d80cd3eaafb2e7af8a622cc484df3cd
|
|
BLAKE2b-256 checksum How to use checksums |
e236086537bc9b7afd5ad4b1d61d01e19864a23b4db9eb81163e6d7f72f8e3c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-kamasutra 0.2.11
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.