mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Merge pull request #386 from jazzband/improve-makefile
Improve Makefile to handle VENV creation if needed.
This commit is contained in:
commit
82dfed6a84
4 changed files with 33 additions and 21 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -9,3 +9,4 @@ htmlcov/
|
|||
docs/_build/
|
||||
.idea/
|
||||
.eggs/
|
||||
.venv/
|
||||
|
|
|
|||
37
Makefile
37
Makefile
|
|
@ -1,21 +1,32 @@
|
|||
VIRTUALENV = virtualenv --python=python3
|
||||
PYTHON = $(VENV)/bin/python
|
||||
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
|
||||
INSTALL_STAMP = $(VENV)/.install.stamp
|
||||
|
||||
all: init docs test
|
||||
|
||||
init:
|
||||
python setup.py develop
|
||||
pip install tox coverage Sphinx
|
||||
init: $(INSTALL_STAMP)
|
||||
$(INSTALL_STAMP): $(PYTHON) setup.py
|
||||
$(VENV)/bin/pip install -e .
|
||||
$(VENV)/bin/pip install tox coverage Sphinx
|
||||
touch $(INSTALL_STAMP)
|
||||
|
||||
test:
|
||||
coverage erase
|
||||
tox
|
||||
coverage html
|
||||
virtualenv: $(PYTHON)
|
||||
$(PYTHON):
|
||||
$(VIRTUALENV) $(VENV)
|
||||
|
||||
test: init
|
||||
$(VENV)/bin/coverage erase
|
||||
$(VENV)/bin/tox
|
||||
$(VENV)/bin/coverage html
|
||||
|
||||
docs: documentation
|
||||
|
||||
documentation:
|
||||
python setup.py build_sphinx
|
||||
documentation: init
|
||||
$(PYTHON) setup.py build_sphinx
|
||||
|
||||
messages:
|
||||
python translations.py make
|
||||
messages: init
|
||||
$(PYTHON) translations.py make
|
||||
|
||||
compilemessages:
|
||||
python translations.py compile
|
||||
compilemessages: init
|
||||
$(PYTHON) translations.py compile
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ field changes:
|
|||
(A ``MonitorField`` can monitor any type of field for changes, not only a
|
||||
``StatusField``.)
|
||||
|
||||
If a list is passed to the ``when`` parameter, the field will only
|
||||
If a list is passed to the ``when`` parameter, the field will only
|
||||
update when it matches one of the specified values:
|
||||
|
||||
.. code-block:: python
|
||||
|
|
@ -159,16 +159,16 @@ be the excerpt. This number can be customized by setting the
|
|||
UUIDField
|
||||
----------
|
||||
|
||||
A ``UUIDField`` subclass that provides an UUID field. You can
|
||||
add this field to any model definition.
|
||||
A ``UUIDField`` subclass that provides an UUID field. You can
|
||||
add this field to any model definition.
|
||||
|
||||
With the param ``primary_key`` you can set if this field is the
|
||||
With the param ``primary_key`` you can set if this field is the
|
||||
primary key for the model, default is True.
|
||||
|
||||
Param ``version`` is an integer that set default UUID version.
|
||||
Param ``version`` is an integer that set default UUID version.
|
||||
Versions 1,3,4 and 5 are supported, default is 4.
|
||||
|
||||
If ``editable`` is set to false the field will not be displayed in the admin
|
||||
If ``editable`` is set to false the field will not be displayed in the admin
|
||||
or any other ModelForm, default is False.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ UUIDModel
|
|||
This abstract base class provides ``id`` field on any model that inherits from it
|
||||
which will be the primary key.
|
||||
|
||||
If you dont want to set ``id`` as primary key or change the field name, you can be override it
|
||||
with our `UUIDField`_
|
||||
If you dont want to set ``id`` as primary key or change the field name, you can be override it
|
||||
with our `UUIDField`_
|
||||
|
||||
Also you can override the default uuid version. Versions 1,3,4 and 5 are now supported.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue