semvec/pypi-packages huggingface dataset:
django_extra_migrations 0.0.7
Extra migration classes for django
License: MIT
Keywords: django migrations permissions models

pip install django_extra_migrations

# Resave

*Resave all records with calling save and signals events*

Create empty migration - ```./manage.py makemigrations %APP_NAME% --empty```

Open migration file ./%APP_NAME%/migrations/%MIGRATION_NAME%.py

###Import

    from django_extra_migrations.migrations import Resave
    
###Operation

    Resave("%APP_NAME%.%MODEL_NAME%"),
    
###Example:
  
    from __future__ import unicode_literals
    from django.db import models, migrations
    from django_extra_migrations.migrations import Resave, GrantPermissions


    class Migration(migrations.Migration):
        dependencies = [
            ('tree', '0078_auto_20151014_1500'),
        ]

    operations = [
        Resave("tree.Resource"),
    ]

---

#GrantPermissions

*Grant permissions to groups*

Create empty migration - ```./manage.py makemigrations %APP_NAME% --empty```

Open migration file ./%APP_NAME%/migrations/%MIGRATION_NAME%.py

###Import

    from django_extra_migrations.migrations import GrantPermissions
    
###Operation
    
    GrantPermissions(["%GROUP_NAME%"], (
        ("%APP_NAME%.%MODEL_NAME%", True), # IF true - grant ALL perms for this content type
        ("%APP_NAME%.%MODEL_NAME%", ["add_%LOWER_MODEL_NAME%"]),
        ("%APP_NAME%.%MODEL_NAME%", ["change_%LOWER_MODEL_NAME%"]),
        ("%APP_NAME%.%MODEL_NAME%", ["delete_%LOWER_MODEL_NAME%"]),
    )),
    
    
###Example:
  
    from __future__ import unicode_literals
    
    from django.db import models, migrations
    from django_extra_migrations.migrations import GrantPermissions
    
    
    class Migration(migrations.Migration):
        dependencies = [
            ('tree', '0078_auto_20151014_1500'),
        ]
    
        operations = [
            GrantPermissions(["Admins"], (
                ("tree.Resource", True),
                ("tree.ResourceFile", ["add_resourcefile"]),
            )),
        ]
similar_text 0.2.0
Calculates the similarity between two strings
License: MIT
Keywords: similar_text,similar,text

similar_text
============

.. image:: https://img.shields.io/pypi/v/similar_text.svg
    :target: https://pypi.python.org/pypi/similar_text


:code:`similar_text` can calculate the similarity between two strings

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

The tool works with Python 2 and Python 3. It can be installed with `pip` :

::

    pip install similar_text


Usage
-----

.. code-block:: python

    >>> from similar_text import similar_text
    >>> similar_text('luosicheng', 'lsc')
    46
    >>> similar_text('lsc', 'luosicheng')
    46