semvec/pypi-packages huggingface dataset:
django-slugger 1.1.2
Automatic slug field for Django.
License: MIT
Keywords: django field slug auto

django-slugger
==============

.. image:: https://gitlab.com/dspechnikov/django-slugger/badges/master/pipeline.svg
    :alt: build status
    :target: https://gitlab.com/dspechnikov/django-slugger/commits/master

.. image:: https://gitlab.com/dspechnikov/django-slugger/badges/master/coverage.svg
    :alt: code coverage
    :target: https://gitlab.com/dspechnikov/django-slugger/commits/master

.. image:: https://img.shields.io/pypi/v/django-slugger.svg
    :alt: pypi version
    :target: https://pypi.python.org/pypi/django-slugger

.. image:: https://img.shields.io/pypi/l/django-slugger.svg
    :alt: license
    :target: https://opensource.org/licenses/MIT

.. image:: https://img.shields.io/pypi/pyversions/django-slugger.svg
    :alt: python versions
    :target: https://www.python.org/

.. image:: https://img.shields.io/badge/django-1.11,%202.0-blue.svg
    :alt: django versions
    :target: https://www.djangoproject.com/

Automatic slug field for your Django models.

Features
--------

* One query to rule them all. No database spam on model save.
* Supports all standard "unique_for" field attributes like *unique_for_date*.
* Supports model meta *unique_together*.
* Supports custom "slugify" functions.

How it works
------------

django-slugger provides ``AutoSlugField`` which value is automatically
generated if it is not filled manually. If the field has any "uniqueness"
constraint (``unique=True``, for example), numerical suffix will be used if
necessary to prevent constraint violation.

If generated slug exceeds field ``max_length``, slug value will be cut to
fit in. This does not apply to suffixed slugs. Increase ``max_length``
attribute value or use `custom slug template`_ if you need more space to
ensure slug uniqueness.

Installation
------------

.. code-block:: bash

    pip install django-slugger

Usage
-----

.. code-block:: python

    from slugger import AutoSlugField

    class AutoSlugModel(models.Model):
        title = models.CharField(max_length=255)
        slug = AutoSlugField(populate_from='title')

Custom slug template
++++++++++++++++++++

By default, django-slugger will use Django slugify_ function
(combined with unidecode_ to handle non-ASCII characters). To use your own function,
specify it in ``slugify`` argument.

.. code-block:: python

    def custom_slugify(value):
        return 'custom-%s' % value

    class CustomAutoSlugModel(models.Model):
        title = models.CharField(max_length=255)
        slug = AutoSlugField(populate_from='title', slugify=custom_slugify)

.. note::

    ``slugify`` argument must be top-level named function.

.. _slugify: https://docs.djangoproject.com/en/2.0/ref/utils/#django.utils.text.slugify
.. _unidecode: https://pypi.python.org/pypi/Unidecode
ostree 0.1.1
Pulls containers and turns them into OS trees for systemd-nspawn.
License: MIT



You can pull a Docker container:
```bash
pip install ostree
ostree pull python:3.7-alpine ./alpine
```

And run it with systemd-nspawn:
```bash
sudo systemd-nspawn --directory ./alpine python

Spawning container alpine on /home/denis/alpine.
Press ^] three times within 1s to kill container.
Timezone UTC does not exist in container, not updating container timezone.
Python 3.7.0 (default, Aug 22 2018, 20:39:59)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

## Warning

This is alpha-quality software. Things are intended to break.

## Supported Registries

The following registries are currently supported:

* Docker (public registry only)
* Google Container Registry (public, private with service account and json keyfile)

## Requirements

* POSIX
* Python 3.6+

## Run the Tests

```bash
pip install -e '.[test]'
py.test ostree
```

## Conventions

Ostree follows [PEP8](https://www.python.org/dev/peps/pep-0008/) as closely as possible. To validate it run:

```bash
pip install -e '.[test]'
flake8 ostree
```

Ostree uses [Semantic Versioning](http://semver.org/).

## License

Ostree is released under the MIT license

Changelog
=========

0.1.1 (2018-09-07)
------------------

- Adds environment variables for OSTREE_AUTH, OSTREE_CACHE and OSTREE_PROTOCOL.
  [href]

0.1.0 (2018-09-06)
------------------

- Adds support for Google Container Registry.
  [href]

- Implements cache purging.
  [href]

- Shows an error if no protocol is given.
  [href]

- Changes the cache path to `~/.cache/seantis/ostree` for non-root users.
  [href]

0.0.0 (2018-08-24)
------------------

- Initial Release.
  [href]