Skip to content

Commit

Permalink
Style - Apply black, isort, fix trailing whitespace, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Dec 12, 2018
1 parent 6de7a42 commit 4e78f1a
Show file tree
Hide file tree
Showing 87 changed files with 1,480 additions and 999 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

*.py text
*.py3 text

2 changes: 1 addition & 1 deletion dev/templates/registration/logged_out.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h2>Login again ?</h2>
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion dev/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ <h2>Login</h2>
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}
{% endblock %}
22 changes: 11 additions & 11 deletions doc/models.plantuml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@startuml
package models {

note as N
note as N
There is a circular import that is causing
a lot of import problems. It would
probably be logical to make sure that answer
in a Response all come from the same survey
and remove the foreign key to the survey
in response.

Answer is also more complicated than that :
Getting the real answer child class is a
real pain.
end note

class Survey{
+String name
+String description
Expand All @@ -22,35 +22,35 @@ package models {
+Boolean display_by_question
+String template
}

class Question {
+String text
+int order
+Boolean required
+String type
+String choices
}

class Response {
Time created
Time updated
Uuid interview_uuid
Uuid interview_uuid
}

class Category {
String name
int order
String description
}

class Answer {
Time created
Time updated
String body
}

class django.contrib.auth.models.User

django.contrib.auth.models.User "1" -- "n" Response
Category "0" -- "n" Question
Survey "1" -- "n" Question
Expand All @@ -59,4 +59,4 @@ package models {
Answer "n" -- "1" Question
Answer "n" -- "1" Response
}
@enduml
@enduml
84 changes: 39 additions & 45 deletions example_project/example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hs!cby8c=^5up3v#j#cl#x$rg35_f!g8^@^dme(6b-0v2b%rsk'
SECRET_KEY = "hs!cby8c=^5up3v#j#cl#x$rg35_f!g8^@^dme(6b-0v2b%rsk"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand All @@ -31,54 +31,54 @@
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrapform',
'survey',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"bootstrapform",
"survey",
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = 'example_project.urls'
ROOT_URLCONF = "example_project.urls"

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
]
},
},
}
]

WSGI_APPLICATION = 'example_project.wsgi.application'
WSGI_APPLICATION = "example_project.wsgi.application"


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}

Expand All @@ -88,26 +88,20 @@

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = "en-us"

TIME_ZONE = 'UTC'
TIME_ZONE = "UTC"

USE_I18N = True

Expand All @@ -119,4 +113,4 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'
STATIC_URL = "/static/"
8 changes: 3 additions & 5 deletions example_project/example_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls import include


urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^survey/', include('survey.urls'))
url(r"^admin/", admin.site.urls),
url(r"^survey/", include("survey.urls")),
]
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
3 changes: 3 additions & 0 deletions new_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python setup.py sdist
cd example_project
pip install ../dis
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ PyYAML==3.12
matplotlib==2.1.0rc1
seaborn==0.8.1
numpy==1.13.3

Loading

0 comments on commit 4e78f1a

Please sign in to comment.