semvec/pypi-packages huggingface dataset:
django-multipleimageinput 0.0.2
Django widget for multiple image input
License: MIT
Requires Python: >=3.7.0
Keywords: python3 django widget imageinput multipleimageinput python-library

# Django MultipleImageInput

Widget for multiple image fields. Works good with PostgreSQL array fields.


## Example

In this example i use [crispy_forms](https://github.com/django-crispy-forms/django-crispy-forms)

settings.py

```python
import pathlib
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

MEDIA_URL = '/media/'
MEDIA_ROOT = pathlib.Path(BASE_DIR) / 'common' / 'media'
```

model.py

```python
from django.contrib.postgres.fields import ArrayField
from django.db import models


class Product(models.Model):
    class Meta:
        db_table = 'product'
        verbose_name = 'товар'
        verbose_name_plural = 'товары'

    IMAGE_PATH = 'common/image/product'

    title = models.TextField('заголовок', null=True, blank=True)
    description = models.TextField('описание', null=True, blank=True)
    price = models.IntegerField('цена')
    youtube_url = models.URLField('видео youtube', null=True, blank=True)
    image_list = ArrayField(models.TextField("картинки"), default=list, verbose_name='картинки', blank=True)
```

view.py
```python
from settings import MEDIA_ROOT
from models import Product
import django_multipleimageinput

class UploadImageView(django_multipleimageinput.UploadImageView):
    media_root = MEDIA_ROOT
    image_path = Product.IMAGE_PATH
```

forms.py
```python
from django import forms
from models import Product
from django_multipleimageinput import MultipleImageInput
from django.urls import reverse_lazy
from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, Submit, Layout


class ProductForm(forms.ModelForm):
    class Meta:
        model = Product
        fields = ["title", "description", "price", "youtube_url", "image_list"]
        widgets = {
            "title": forms.TextInput(),
            "description": forms.Textarea(attrs={'rows': 4, 'cols': 15}),
            "image_list": MultipleImageInput(reverse_lazy('common:product/upload-image'), MEDIA_URL)
        }

    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()

        self.helper.layout = Layout(
            'title',
            'description',
            'price',
            'youtube_url',
            'image_list',
            ButtonHolder(
                Submit('submit', 'Сохранить')
            )
        )
        super(ProductForm, self).__init__(*args, **kwargs)

```

urls.py
```python
from django.urls import path
from django.conf.urls.static import static as sttc
import views
import settings

app_name = 'common'

urlpatterns = [
    path('product/upload-image', views.UploadImageView.as_view(), name='product/upload-image'),
] + sttc(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
```
pycoercer 0.1.2
Fast Python JSON schema validation and normalization
License: MIT
Keywords: validation,schema,json,normalization,coercion

Pycoercer
=========

Fast Python JSON schema validation and normalization

.. code-block:: python

  v = Validator({
    'User': {
      'items': {
        'name': {'coerce': 'str'},
        'gender': {
          'map': {
            'woman': 'female',
            'man': 'male',
            None: 'other'  # Map everything else
          },
          'synonyms': ['sex']
        },
        'country': {
          'default': '{GEOIP2_COUNTRY}'
        }
      }
    }
  })

  args = {'GEOIP2_COUNTRY': 'UK'}

  v['User']({
    'name': 123,
    'sex': 'woman'
  }, args)

  # Returns:
  # 
  # ({
  #    'name': '123',
  #    'gender': 'female',
  #    'country': 'UK'
  #  },
  #  None)  # Error description


Features
--------

Pycoercer was created to meet the actual production needs for web apps
development - inspired by `jsonschema`_ and `Cerberus`_,
it also implements additional features:
- Can validate, normalize (or coerce) dicts and lists
- Fast - the schema is compiled into python code
- Clean `rules system`_ with a predictable order of execution
- Parametric `default` and `if_null` values
- Keywords for data coercion: `synonyms`, `map`, and `post_coerce`
- Check `examples` against the schema definition


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

.. code-block:: console

  $ pip install pycoercer


Documentation
-------------

Complete documentation will be [sometime][docs]


Testing
-------

.. code-block:: console

  $ pytest


.. _jsonschema: https://json-schema.org/
.. _Cerberus: https://python-cerberus.org/
.. _rules system: docs/index.md
django-admin-rangefilter-jalali 0.4.3.0
django-admin-rangefilter app, add the filter by a custom date range on the admin UI.
License: MIT
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*

.. image:: https://travis-ci.org/silentsokolov/django-admin-rangefilter.svg?branch=master
   :target: https://travis-ci.org/silentsokolov/django-admin-rangefilter

.. image:: https://codecov.io/gh/silentsokolov/django-admin-rangefilter/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/silentsokolov/django-admin-rangefilter

django-admin-rangefilter-jalali
===============================================================

# Note django 1.8 not working pls w8 to fix it 

django-admin-rangefilter-jalali app, add the filter by a custom jdate / jdatetime range on the admin UI.

.. image:: https://raw.githubusercontent.com/silentsokolov/django-admin-rangefilter/master/docs/images/screenshot.png


Requirements
------------

* Python 2.7+ or Python 3.4+
* Django 1.8+


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

Use your favorite Python package manager to install the app from PyPI, e.g.

Example:

``pip install django-admin-rangefilter-jalali``


Add ``rangefilter_jalali`` to ``INSTALLED_APPS``:

Example:

.. code:: python

    INSTALLED_APPS = (
        ...
        'django_jalali',
        'rangefilter_jalali',
        ...
    )


Example usage
-------------

In admin
~~~~~~~~

.. code:: python

    from django.contrib import admin
    from rangefilter_jalali.filter import DateRangeFilter, DateTimeRangeFilter

    from .models import Post


    @admin.register(Post)
    class PostAdmin(admin.ModelAdmin):
        list_filter = (
            ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter),
        )
num-shorty 1.0.1
Converts an integer to a hexdigest like string - except not 16 length but provided alphabet length
License: MIT

matousgit/num_shorty
====================

.. image:: https://img.shields.io/pypi/v/num-shorty.svg
    :target: https://pypi.org/project/num-shorty/
    :alt: Latest Version

``num_shorty`` converts an integer to a hexdigest like string - except not 16 length but provided alphabet length

**Example**:

.. code-block:: pycon

    >>> from import num_shorty
    >>> num_shorty.short(123456789)
    '8m0Kx'
    >>> num_shorty.expand('8m0Kx')
    123456789

**You can implement your own alphabet set**

.. code-block:: pycon

    >>> from import num_shorty
    >>> num_shorty.short(123456789, alphabet='abcdefgABCDEFG-*!:_')
    'cE!geD-'
    >>> num_shorty.expand('cE!geD-', alphabet='abcdefgABCDEFG-*!:_')
    123456789