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 10 commits into
base: master
Choose a base branch
from
12 changes: 7 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ 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.2/faq/install/#what-python-version-can-i-use-with-django
matrix:
include:
- { django: "4.2", python: "3.8" }
- { django: "4.2", python: "3.9" }
- { django: "4.2", python: "3.12" }
- { django: "5.0", python: "3.10" }
- { django: "5.0", python: "3.12" }
- { django: "5.1", python: "3.10" }
- { django: "5.1", python: "3.12" }
- { django: "5.1", python: "3.13" }
- { django: "5.2", python: "3.10" }
- { django: "5.2", python: "3.13" }
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

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 <https://djangosnippets.org/snippets/1200/>`_.

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

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 @@ -45,20 +44,15 @@ def read(*rnames):
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
license="LGPL 3",
keywords="django,multiple,select,field,choices",
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,
)
16 changes: 5 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
[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{39,310,311,312}-django42,
python{310,311,312}-django50
python{310,311,312,313}-django{51,52}

[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
django51: django>=5.1,<5.2
django52: django>=5.2a1,<5.3