--- /dev/null
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+ """Run administrative tasks."""
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tickle.settings')
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
+ execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+ main()
import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
-VERSION = '0.0.9'
+VERSION = '0.0.10.pre-alpha'
PACKAGE_NAME = 'django_predrill_tickle'
AUTHOR = 'David Kerkeslager'
AUTHOR_EMAIL = 'david@kerkeslager.com'
--- /dev/null
+# Generated by Django 3.1.7 on 2021-02-27 06:09
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('tickle', '0002_auto_20210226_0543'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='pitch',
+ options={'ordering': ('order',), 'verbose_name_plural': 'Pitches'},
+ ),
+ migrations.AlterField(
+ model_name='area',
+ name='parent',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='tickle.area'),
+ ),
+ migrations.AlterField(
+ model_name='attempt',
+ name='boulder',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attempts', to='tickle.boulder'),
+ ),
+ migrations.AlterField(
+ model_name='attempt',
+ name='route',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attempts', to='tickle.route'),
+ ),
+ migrations.AlterField(
+ model_name='boulder',
+ name='area',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='boulders', to='tickle.area'),
+ ),
+ migrations.AlterField(
+ model_name='route',
+ name='area',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='routes', to='tickle.area'),
+ ),
+ migrations.AlterField(
+ model_name='todo',
+ name='boulder',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='todos', to='tickle.boulder'),
+ ),
+ migrations.AlterField(
+ model_name='todo',
+ name='route',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='todos', to='tickle.route'),
+ ),
+ ]
user = models.ForeignKey(User, on_delete=models.CASCADE)
date = models.DateField()
notes = models.TextField(blank=True)
- boulder = models.ForeignKey('Boulder', null=True, on_delete=models.PROTECT, related_name='attempts')
- route = models.ForeignKey('Route', null=True, on_delete=models.PROTECT, related_name='attempts')
+ boulder = models.ForeignKey(
+ 'Boulder',
+ blank=True,
+ null=True,
+ on_delete=models.PROTECT,
+ related_name='attempts',
+ )
+ route = models.ForeignKey(
+ 'Route',
+ blank=True,
+ null=True,
+ on_delete=models.PROTECT,
+ related_name='attempts',
+ )
result = models.CharField(max_length=8, choices=ATTEMPT_RESULT_CHOICES)
prior_knowledge = models.BooleanField(default=True)
protection_used = models.CharField(max_length=8, choices=PROTECTION_CHOICES)
user = models.ForeignKey(User, on_delete=models.CASCADE)
notes = models.TextField(blank=True)
protection = models.CharField(max_length=8, choices=PROTECTION_CHOICES)
- boulder = models.ForeignKey('Boulder', null=True, on_delete=models.PROTECT, related_name='todos')
- route = models.ForeignKey('Route', null=True, on_delete=models.PROTECT, related_name='todos')
+ boulder = models.ForeignKey(
+ 'Boulder',
+ blank=True,
+ null=True,
+ on_delete=models.PROTECT,
+ related_name='todos',
+ )
+ route = models.ForeignKey(
+ 'Route',
+ blank=True,
+ null=True,
+ on_delete=models.PROTECT,
+ related_name='todos',
+ )
style = models.CharField(max_length=8, choices=STYLE_CHOICES)
class Meta:
--- /dev/null
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'b&-!%$%jyabi^e#9gz!^&=3#z7-c$zc0c#@o&q*-9z17pnbok8'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = [
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+
+ 'tickle',
+]
+
+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',
+]
+
+ROOT_URLCONF = 'tickle.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',
+ ],
+ },
+ },
+]
+
+#WSGI_APPLICATION = 'core.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': BASE_DIR / 'db.sqlite3',
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
+
+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',
+ },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/3.1/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/3.1/howto/static-files/
+
+STATIC_URL = '/static/'