:target: https://travis-ci.org/axant/tgapp-categories
.. image:: https://coveralls.io/repos/github/axant/tgapp-categories/badge.svg?branch=master
:target: https://coveralls.io/github/axant/tgapp-categories?branch=master
About tgapp-categories
-------------------------
This pluggable allow you to manage (create, read, update, delete)
categories on a website.
The categories cannot be nested.
There are 2 images associated to every category
This plugin works with both sqlalchemy and ming
Installing
-------------------------------
tgapp-categories can be installed both from pypi or from github::
pip install tgappcategories
should just work for most of the users
Plugging tgapp-categories
----------------------------
In your application *config/app_cfg.py* import **plug**::
from tgext.pluggable import plug
Then at the *end of the file* call plug with tgappcategories::
plug(base_config, 'tgappcategories', 'categories')
You will be able to access the plugged application at
*http://localhost:8080/categories*.
Permissions
-----------
This pluggable creates a Permission named 'tgappcategories', that has to be assigned
to the categories management users group.
You can assign it with a migration or evolution, using alembic or tgext.evolve
example of an evolution with tgext.evolve and ming::
class TgappCategories(Evolution):
"""Assigns the tgappcategories permission to Managers"""
evolution_id = 'tgapp-categories'
def evolve(self):
log.info('TgappCategories migration running')
g_managers = model.Group.query.find({'group_name': 'managers'}).one()
p_tgappcategories = model.Permission.query.find(
{'permission_name': 'tgappcategories'}).one()
p_tgappcategories.groups = [g_managers]
model.DBSession.flush_all()
Depot
-----
This pluggable **needs** depot in order to work
you can find depot at https://github.com/amol-/depot
after you inserted depot into your project configure a storage called ``category_images``
example::
app_cfg['depot_backend_type'] = 'depot.io.memory.MemoryFileStorage'
app_cfg['depot.category_images.backend'] = 'depot.io.memory.MemoryFileStorage'
app_cfg['depot.category_images.prefix'] = 'category_images/'
storages = {
'category_images': 'category_image',
}
for storage in storages:
prefix = 'depot.%s.' % storage
print('Configuring Storage %s*' % prefix)
DepotManager.configure(storage, app_cfg, prefix)
DepotManager.alias(storages[storage], storage)
Available Hooks
---------------
tgapp-cateogries exposes some hooks to configure it's behavior, The hooks that can be used with TurboGears2 register_hook are:
* **categories.after_update(category, kwargs) -> Runs after a category is updated.
Metadata
Release files for tgapp-categories 0.3.1
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 |
|---|---|---|---|---|
| tgapp-categories-0.3.1.tar.gz | 14.7 kB | Without provenance | Details for tgapp-categories-0.3.1.tar.gz |
Release files / tgapp-categories-0.3.1.tar.gz
| Download URL | tgapp-categories-0.3.1.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24dc41b1a92c6bb8ab6e81aa07929476de4a12ce6f08e2a25efbc69fd83cd808
|
|
BLAKE2b-256 checksum How to use checksums |
d76371a5b2090e081a0bbfb255d70204b4dd53481fd0e4f2fc7caa7ec6dfce60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for tgapp-categories 0.3.1
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.