Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update requirements in readme and tests #160

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
# all supported django version on lowest/highest supported python
# see https://www.djangoproject.com/download/#supported-versions
# and https://docs.djangoproject.com/en/4.2/faq/install/#what-python-version-can-i-use-with-django
# and https://docs.djangoproject.com/en/5.0/faq/install/#what-python-version-can-i-use-with-django
matrix:
include:
- { django: "4.2", python: "3.8" }
Expand Down
134 changes: 0 additions & 134 deletions .travis.yml

This file was deleted.

20 changes: 7 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
django-multiselectfield
=======================

.. image:: https://travis-ci.org/goinnn/django-multiselectfield.png?branch=master
:target: https://travis-ci.org/goinnn/django-multiselectfield
.. image:: https://github.com/goinnn/django-multiselectfield/actions/workflows/tests.yaml/badge.svg
:target: https://github.com/goinnn/django-multiselectfield/actions/workflows/tests.yaml

.. image:: https://coveralls.io/repos/goinnn/django-multiselectfield/badge.png?branch=master
:target: https://coveralls.io/r/goinnn/django-multiselectfield
Expand All @@ -14,9 +14,9 @@ A new model field and form field. With this you can get a multiple select from a

This egg is inspired by this `snippet <http://djangosnippets.org/snippets/1200/>`_.

Supported Python versions: 2.7, 3.4+
Supported Python versions: 3.8+

Supported Django versions: 1.4-2.0+
Supported Django versions: 4.2+

Installation
============
Expand Down Expand Up @@ -116,15 +116,9 @@ Django REST Framework comes with a ``MultipleChoiceField`` that works perfectly
Known Bugs and Limitations
==========================

All tests pass on Django 1.4, 1.5, and 1.8+, so if you can, use a modern version of Django. However, if you must use Django 1.6 or 1.7 there are two known issues you will need to be aware of:
1. As of 0.1.13 ``MultiSelectFormField`` requires a `flat_choices` attribute

1. `Named groups <https://github.com/goinnn/django-multiselectfield/pull/30#issue-52149983>`_ do not render properly in Django 1.6. The workaround is to manually render the field in your form or use a custom widget. If your workaround is suitably generic, please submit a pull request with it.

2. Only in Django 1.6 and 1.7, due to `Django bug #9619 <https://code.djangoproject.com/ticket/9619>`_, passing a MultiSelectField to ``values()`` or ``values_list()`` will return the database representation of the field (a string of comma-separated values). The workaround is to manually call ``.split(',')`` on the result.

The Django bug was introduced in Django 1.6 and is fixed in Django 1.8 and onward, so ``values()`` and ``values_list()`` return a vanilla Python list of values for Django <= 1.5 and Django >= 1.8.

See `issue #40 <https://github.com/goinnn/django-multiselectfield/issues/40>`_ for discussion about this bug.
See `issue #155 <https://github.com/goinnn/django-multiselectfield/issues/155>`_ for discussion about this bug.


Development
Expand All @@ -145,6 +139,6 @@ There is a fully configured example project in the `example directory <https://g

.. code-block:: bash

python manage.py migrate # or python manage.py syncdb --noinput
python manage.py migrate
python manage.py loaddata app_data
python manage.py runserver
10 changes: 2 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2012 by Pablo Martín <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -41,6 +40,7 @@ def read(*rnames):
'Development Status :: 4 - Beta',
'Framework :: Django',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand All @@ -51,14 +51,8 @@ def read(*rnames):
url='https://github.com/goinnn/django-multiselectfield',
packages=find_packages(),
include_package_data=True,
tests_require=[
'django>=1.4',
'tox',
'coverage',
'flake8',
],
install_requires=[
'django>=1.4',
'django>=4.2',
],
zip_safe=False,
)
11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
[tox]
envlist =
python{36,37,38,39,310}-django32,
python{38,39,310}-django40,
python{38,39,310,311}-django41,
python{38,39,310,311,312}-django42,
python{310,311,312}-django50
python{310,311,312}-django51

[testenv]
usedevelop = True
setenv =
PYTHONPATH=.
commands =
python {envbindir}/flake8 --ignore=E501,W605
python {envbindir}/flake8 --ignore=E501
python {envbindir}/coverage run -p example/run_tests.py
python {envbindir}/coverage run -p example/run_tests.py example.settings_no_debug
install_command =
pip install {opts} {packages}
deps =
coveralls
flake8
pillow
PyYAML
django32: django~=3.2
django40: django~=4.0
django41: django~=4.1
django42: django~=4.2
django50: django~=5.0
django51: django>=5.1a1,<5.2
Loading