semvec/pypi-packages huggingface dataset:
django-voter 0.1.0
Application for Django framework that contains generic rating\vote system. Requires modifications in the model, that will be used for voting, to optimize number of database queries.
License: MIT

django-voter
##############

Application for Django framework that contains generic rating\vote system. Requires modifications in the model, that will be used for voting, to optimize number of database queries.

.. contents::

Quick overview
==============

More later.

Requirements
==============

- python >= 2.5
- pip >= 0.8
- django >= 1.2
- django-misc (https://github.com/ilblackdragon/django-misc)

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

**Django voter** should be installed using pip: ::

    pip install git+git://github.com/ilblackdragon/django-voter.git


Setup
============

- Add 'blog' to INSTALLED_APPS ::

    INSTALLED_APPS += ( 'ratings', )

- Add RatingField to models you want to allow voting for: ::


    from ratings.models import RatingField
    
    class SomeModle(models.Model):
       ...
       rating = RatingField()
    

Configure django-voter
===============

Will be later.

Contributing
============

Development of django-voter happens at github: https://github.com/ilblackdragon/django-voter
Please, if you have any insight how to patch existing models - let me know. At this point, having a rating field at model that this field will be required at is the best solution I see from point of number database queries.

License
============

Copyright (C) 2013 Illia Polosukhin
This program is licensed under the MIT License (see LICENSE)
rebecca.form 0.1
pyramid view components based on formalchemy
License: MIT

rebecca.form
====================

`pyramid <http://pypi.python.org/pyramid>`_ view components based on `FormAlchemy <http://pypi.python.org/Formalchemy>`_ .

Components
-------------------

- FormView
- AddFormView
- EditFormView
- DisplayView


Examples
--------------------

Model for Example ::

    class Item(Base):
        __tablename__ = 'items'
        id = sa.Column(sa.Integer, primary_key=True)
        name = sa.Column(sa.Unicode(255), nullable=False)
        value = sa.Column(sa.Integer, nullable=False)

        def __unicode__(self):
            return u"Item id={id}, name={name}, value={value}".format(id=self.id, name=self.name, value=self.value)

AddFormView ::

    class AddItemView(AddFormView):
        __x_model__ = Item
        __x_session__ = DBSession

EditFormView ::

    class EditItemView(EditFormView):
        __x_factory__ = item_finder

DisplayView ::

    class DisplayItemView(DisplayView):
        __x_factory__ = item_finder

`__x_factory__` is callable to find model from request.

Utilities
----------------------

`MatchDictFinder` queries for specified Model with conditions from `Request.matchdict`.

For example, create finder for ::

    item_finder = MatchDictFinder(Item, DBSession, [(Item.id, 'item_id')])

item_finder executes like this ::

    DBSession.query(Item).filter(Item.id==request.matchdict['item_id']).one()


Contributors
============


- Atsushi Odagiri, original author

Changelog
=========

0.1
-----------

- first release