semvec/pypi-packages huggingface dataset:
django-objectcounters 0.1
Associate counters with Django model records.
License: BSD License

Object Counters for Django
==========================

This is a simple app for associating named integer values with
arbitrary Django model objects.

Using counters allows you to keep scalar values out of your models.
Instead of this:

    class Person(models.Model):
        name = models.CharField(...)
        number_of_friends_total = models.IntegerField(...)
        number_of_friends_recent = models.IntegerField(...)
        number_of_friends_last_month = models.IntegerField(...)

You can do this:

    capt = Person.objects.get(name='Jean-Luc Picard')
    Counter.objects.create_for_object('friends_total', capt, 1014)

And:

    last = Counter.objects.get_for_object('friends_last_month', capt)
    last.value += -3 # lost the away team.
    last.save()

The approach of reading and writing values in a separate model allows
you to evolve some of your data without touching the models.  And it
keeps your models a bit more tidy.

Install
-------

Pull down the app:

    $ pip install django-objectcounters

Add it to your `INSTALLED_APPS`:

    INSTALLED_APPS = (
      ...
      'objectcounters'
    )

Sync your database:

    $ ./manage.py syncdb --migrate

To run the sample app, make sure you've got generic admin installed globally
(ugh), or better yet, create a new virtual env and install it there with the
sample.


Python Usage
-------------

The `Counter` model is a regular Django model, so you can create, read, update
and delete records in the usual way.  Additionally, the model provides a manager
with a few more methods:

1.  `Counter.get_for_object(name, instance, **kwargs)`

Use this method to get an existing counter for an object.  Pass in the name of
the counter, like 'total-holodeck-hours', and a model instance.  Keyword
arguments are passed thru to the `get()` call.

2.  `Counter.get_value_for_object(self, name, instance, default=0, **kwargs)`

Use this method when you need just the value of a counter and not the counter
record.  Keyword arguments are passed thru to the `get()` call.

3.  `Counter.create_for_object(self, name, instance, value=0)`

This is just like Django's `get_or_create` and returns the same kind of
two-tuple.  Use this when you need to get a counter and create it if necessary
in one step.



Template Usage
--------------

You can also enable counters inside of templates pretty easily.

In your templates, load the tag:

    `{% load counter_tags %}`

Then you can render values like this:

    <span>
      {% counter_for_object "monthly_shack_visits" user as visits %}
      I  went to Shake Shack {{ visits }} times this month.`
    </span>
django-contextlayers 0.1
Slather your templates with contextual data.
License: BSD License

Context Layers for Django
==========================

This app provides "context layers" for Django templates.  A context
layer is a model object that contributes data to a template during
rendering.

Context layers match on URL paths.  When a match is found, the model
record is asked for data to contribute, and that data is sent along to
the template context.

Context layers have activation dates.  You can set the layer to turn
on (become active) at a specific date/time, and also to turn off
(become inactive).

Context layers were originally developed to provide:

  * Additional CSS to a page; see the sample app for an implementation
  * Selective enabling or disabling of adverts
  * Conditional markup during a site beta period

This package doesn't provide any concrete models, so you still have to
provide your own models to specify what your layers do (in other
words, how your layers contribute to the context).  Again, see the
sample app for an implementation.


Install
-------

Pull down the app:

    $ pip install django-contextlayers

Add it to your `INSTALLED_APPS`:

    INSTALLED_APPS = (
      ...
      'contextlayers'
    )

Then include the context processor in your settings:

    TEMPLATE_CONTEXT_PROCESSORS = (
        ...
        'contextlayers.context_processors.layer_tool',
    )


Making Your Own Layers
----------------------

First you define a layer class.  You'll probably want to subclass
`LayerBase`, but it's not strictly necessary.  You must include a
`LayerMeta` property, and you must supply a `contribute_to_context`
method.  Example from the sample:

    from contextlayers.models import LayerBase

    class ThemeLayer(LayerBase):
        markup = models.TextField(...)

        class LayerMeta:
            pass

        def contribute_to_context(self, layer_context, global_context):
            layer_context.setdefault('theme', []).append(self.markup)

When this layer is matched, the content of the `markup` field will be added
to the template at `layers.theme`.

Next, sync your database:

    $ ./manage.py syncdb

The layers won't be visible until you add support to your templates.
For example:

    {% for css in layers.theme %}
      {{ css|safe }}
    {% endfor %}

What you do with `layers.*` depends on what the layer provides to the
context and how your templates should use it.

Finally, define the layer records in the Django admin.  Take note of
the help text for the dates and path values.
django-cms-simple-events 0.4.1
A django-cms application for managing an events calendar.
License: BSD License

=============================
Django CMS Simple Events
============================

Name: django-cms-simple-events
Description: A `Django CMS <http://www.django-cms.org/>`_ application for managing an events calendar.
Download: https://bitbucket.org/chucu/django-cms-simple-events


Dependancies
============

- django (tested with 1.5.1)
- django-cms (tested with 2.4)
- django-hvad


Installation
============

Download
--------

From PyPI
'''''''''

You can simply type into a terminal ``pip install django-cms-simple-events`` or ``easy_install django-cms-simple-events``.

Manually
''''''''

You can download from https://bitbucket.org/chucu/django-cms-simple-events.

Unzip the file you downloaded. Then go in your terminal and ``cd`` into the unpacked folder. 
Then type ``python setup.py install`` in your terminal.

Setup
-----

Put ``'simple_events'`` in your ``INSTALLED_APPS`` section in settings.py. 
Don't forget to syncdb your database or migrate if you're using South.

Example:

INSTALLED_APPS = ( 
    ...
    'hvad',
    'simple_events',
)