Skip to content

Commit 8250bc5

Browse files
committed
Initial commit
0 parents  commit 8250bc5

40 files changed

+561
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.coverage
2+
*.egg-info/
3+
*.pyc
4+
*coverage/
5+
.tox/
6+
app_media/
7+
app_static/
8+
db.sqlite
9+
dist/
10+
docs/_build/
11+
local_settings.py

.travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: python
2+
3+
python:
4+
- "2.7"
5+
- "3.5"
6+
7+
env:
8+
- DJANGO=django==1.4.*
9+
- DJANGO=django==1.5.*
10+
- DJANGO=django==1.6.*
11+
- DJANGO=django==1.7.*
12+
- DJANGO=django==1.8.*
13+
- DJANGO=django==1.9.*
14+
15+
install:
16+
- pip install -r test_requirements.txt --use-mirrors
17+
- pip install $DJANGO
18+
- pip install coveralls
19+
20+
script:
21+
- cd django_bootstrap_select/tests
22+
- ./runtests.py
23+
- mv .coverage ../../
24+
- cd ../../
25+
26+
matrix:
27+
exclude:
28+
- python: "3.4"
29+
env: DJANGO=django==1.4.*
30+
31+
after_success:
32+
- coveralls

AUTHORS

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Current or previous core committers
2+
3+
Özer Sahin
4+
5+
Contributors (in alphabetical order)
6+
7+
* Your name could stand here :)

CHANGELOG.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== 0.0.X (onggoing, to be released as 0.1) ===
2+
- Initial commit
3+
4+
5+
# Suggested file syntax:
6+
#
7+
# === (ongoing) ===
8+
# - this is always on top of the file
9+
# - when you release a new version, you rename the last `(ongoing)` to the new
10+
# version and add a new `=== (ongoing) ===` to the top of the file
11+
#
12+
# === 1.0 ===
13+
# - a major version is created when the software reached a milestone and is
14+
# feature complete
15+
#
16+
# === 0.2 ===
17+
# - a minor version is created when a lot of new features have bene added or
18+
# significant backwards incompatible changes have been made.

DESCRIPTION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Django Bootstrap Select widgets.

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2016 Özer Sahin
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
this software and associated documentation files (the "Software"), to deal in
6+
the Software without restriction, including without limitation the rights to
7+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8+
of the Software, and to permit persons to whom the Software is furnished to do
9+
so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.

MANIFEST.in

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
include AUTHORS
2+
include LICENSE
3+
include DESCRIPTION
4+
include CHANGELOG.txt
5+
include README.md
6+
include tox.ini
7+
include runtests.py
8+
include requirements.txt
9+
include test_requirements.txt
10+
graft django_bootstrap_select
11+
global-exclude *.orig *.pyc *.log *.swp local_settings.py
12+
prune django_bootstrap_select/tests/coverage
13+
prune django_bootstrap_select/.ropeproject

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
develop: setup-git
2+
pip install "file://`pwd`#egg=django_bootstrap_select[dev]"
3+
pip install -e .
4+
pip install -r test_requirements.txt
5+
6+
setup-git:
7+
git config branch.autosetuprebase always
8+
cd .git/hooks && ln -sf ../../hooks/* ./
9+
10+
lint-python:
11+
@echo "Linting Python files"
12+
PYFLAKES_NODOCTEST=1 flake8 django_bootstrap_select
13+
@echo ""

README.rst

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Django Bootstrap Select
2+
============
3+
4+
Django Bootstrap Select widgets.
5+
6+
Installation
7+
------------
8+
9+
To get the latest stable release from PyPi
10+
11+
.. code-block:: bash
12+
13+
pip install django-bootstrap-select
14+
15+
To get the latest commit from GitHub
16+
17+
.. code-block:: bash
18+
19+
pip install -e git+git://github.com/oesah/django-bootstrap-select.git#egg=django_bootstrap_select
20+
21+
TODO: Describe further installation steps (edit / remove the examples below):
22+
23+
Add ``django_bootstrap_select`` to your ``INSTALLED_APPS``
24+
25+
.. code-block:: python
26+
27+
INSTALLED_APPS = (
28+
...,
29+
'django_bootstrap_select',
30+
)
31+
32+
Add the ``django_bootstrap_select`` URLs to your ``urls.py``
33+
34+
.. code-block:: python
35+
36+
urlpatterns = [
37+
url(r'^django-bootstrap-select/', include('django_bootstrap_select.urls')),
38+
]
39+
40+
Before your tags/filters are available in your templates, load them by using
41+
42+
.. code-block:: html
43+
44+
{% load django_bootstrap_select_tags %}
45+
46+
47+
Don't forget to migrate your database
48+
49+
.. code-block:: bash
50+
51+
./manage.py migrate django_bootstrap_select
52+
53+
54+
Usage
55+
-----
56+
57+
TODO: Describe usage or point to docs. Also describe available settings and
58+
templatetags.
59+
60+
61+
Contribute
62+
----------
63+
64+
If you want to contribute to this project, please perform the following steps
65+
66+
.. code-block:: bash
67+
68+
# Fork this repository
69+
# Clone your fork
70+
mkvirtualenv -p python2.7 django-bootstrap-select
71+
make develop
72+
73+
git co -b feature_branch master
74+
# Implement your feature and tests
75+
git add . && git commit
76+
git push -u origin feature_branch
77+
# Send us a pull request for your feature branch
78+
79+
In order to run the tests, simply execute ``tox``. This will install two new
80+
environments (for Django 1.8 and Django 1.9) and run the tests against both
81+
environments.

django_bootstrap_select/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
__version__ = '0.1' # pragma: no cover

django_bootstrap_select/admin.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Admin classes for the django_bootstrap_select app."""
2+
# from django.contrib import admin
3+
4+
# from . import models
5+
6+
7+
# class YourModelAdmin(admin.ModelAdmin):
8+
# list_display = ['some', 'fields', ]
9+
# search_fields = ['some', 'fieds', ]
10+
11+
# admin.site.register(models.YourModel, YourModelAdmin)

django_bootstrap_select/management/__init__.py

Whitespace-only changes.

django_bootstrap_select/management/commands/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.core.management.base import BaseCommand
2+
3+
4+
class Command(BaseCommand):
5+
args = '<name name ..>'
6+
help = 'Say hello to <name(s)>'
7+
8+
def handle(self, *args, **options):
9+
for name in args:
10+
self.stdout.write('Hello %s.' % name)

django_bootstrap_select/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Models for the django_bootstrap_select app."""

django_bootstrap_select/static/.empty

Whitespace-only changes.

django_bootstrap_select/static/django_bootstrap_select/.empty

Whitespace-only changes.

django_bootstrap_select/templates/django_bootstrap_select/.empty

Whitespace-only changes.

django_bootstrap_select/templatetags/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Templatetags for the django_bootstrap_select app."""
2+
from django import template
3+
4+
register = template.Library()
5+
6+
# @register.filter
7+
# def lower(value):
8+
# """
9+
# Converts a string into all lowercase
10+
#
11+
# """
12+
# return value.lower()

django_bootstrap_select/tests/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Tests for the models of the django_bootstrap_select app."""
2+
# from django.test import TestCase
3+
4+
# from mixer.backend.django import mixer
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
These settings are used by the ``manage.py`` command.
3+
4+
With normal tests we want to use the fastest possible way which is an
5+
in-memory sqlite database but if you want to create South migrations you
6+
need a persistant database.
7+
8+
Unfortunately there seems to be an issue with either South or syncdb so that
9+
defining two routers ("default" and "south") does not work.
10+
11+
"""
12+
from distutils.version import StrictVersion
13+
14+
import django
15+
16+
from .test_settings import * # NOQA
17+
18+
19+
DATABASES = {
20+
'default': {
21+
'ENGINE': 'django.db.backends.sqlite3',
22+
'NAME': 'db.sqlite',
23+
}
24+
}
25+
26+
django_version = django.get_version()
27+
if StrictVersion(django_version) < StrictVersion('1.7'):
28+
INSTALLED_APPS.append('south', )

django_bootstrap_select/tests/test_app/__init__.py

Whitespace-only changes.

django_bootstrap_select/tests/test_app/models.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ERROR: 400
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ERROR: 500
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""Settings that need to be set in order to run the tests."""
2+
import os
3+
4+
5+
DEBUG = True
6+
SITE_ID = 1
7+
8+
APP_ROOT = os.path.abspath(
9+
os.path.join(os.path.dirname(__file__), '..'))
10+
11+
12+
DATABASES = {
13+
'default': {
14+
'ENGINE': 'django.db.backends.sqlite3',
15+
'NAME': ':memory:',
16+
}
17+
}
18+
19+
ROOT_URLCONF = 'django_bootstrap_select.tests.urls'
20+
21+
STATIC_URL = '/static/'
22+
STATIC_ROOT = os.path.join(APP_ROOT, '../app_static')
23+
MEDIA_ROOT = os.path.join(APP_ROOT, '../app_media')
24+
STATICFILES_DIRS = (
25+
os.path.join(APP_ROOT, 'static'),
26+
)
27+
28+
TEMPLATES = [{
29+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
30+
'APP_DIRS': True,
31+
'DIRS': [os.path.join(APP_ROOT, 'tests/test_app/templates')],
32+
'OPTIONS': {
33+
'context_processors': (
34+
'django.contrib.auth.context_processors.auth',
35+
'django.template.context_processors.request',
36+
)
37+
}
38+
}]
39+
40+
EXTERNAL_APPS = [
41+
'django.contrib.admin',
42+
'django.contrib.admindocs',
43+
'django.contrib.auth',
44+
'django.contrib.contenttypes',
45+
'django.contrib.messages',
46+
'django.contrib.sessions',
47+
'django.contrib.staticfiles',
48+
'django.contrib.sitemaps',
49+
'django.contrib.sites',
50+
]
51+
52+
INTERNAL_APPS = [
53+
'django_bootstrap_select',
54+
'django_bootstrap_select.tests.test_app',
55+
]
56+
57+
INSTALLED_APPS = EXTERNAL_APPS + INTERNAL_APPS
58+
59+
MIDDLEWARE_CLASSES = [
60+
'django.middleware.common.CommonMiddleware',
61+
'django.middleware.csrf.CsrfViewMiddleware',
62+
]
63+
64+
SECRET_KEY = 'foobar'

django_bootstrap_select/tests/urls.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""URLs to run the tests."""
2+
from compat import include, url
3+
from django.contrib import admin
4+
5+
6+
admin.autodiscover()
7+
8+
urlpatterns = [
9+
url(r'^admin/', include(admin.site.urls)),
10+
]

django_bootstrap_select/urls.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""URLs for the django_bootstrap_select app."""
2+
# from compat import url
3+
4+
# from . import views
5+
6+
7+
# urlpatterns = [
8+
# url(r'^$',
9+
# views.YourView.as_view(),
10+
# name='django_bootstrap_select_default'),
11+
# ]

django_bootstrap_select/views.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""Views for the django_bootstrap_select app."""
2+
# from django.views.generic import TemplateView
3+
4+
# from . import models
5+
6+
7+
# class YourView(TemplateView):
8+
# template_name = 'django_bootstrap_select/default.html'

0 commit comments

Comments
 (0)