zip stringlengths 19 109 | filename stringlengths 4 185 | contents stringlengths 0 30.1M | type_annotations listlengths 0 1.97k | type_annotation_starts listlengths 0 1.97k | type_annotation_ends listlengths 0 1.97k |
|---|---|---|---|---|---|
archives/007MrNiko_Stepper.zip | about/urls.py | from django.urls import path
from about import views
#creating of section "about"
app_name = 'about'
urlpatterns = [
path('about_project', views.index, name='video'),
]
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | about/views.py | from django.shortcuts import render, redirect
from django.http import HttpResponse
#connecting of html file (section "about")
def index(request):
return render(request, 'index_about.html')
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | accounts/admin.py | from django.contrib import admin
# Register your models here.
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/forms.py | from django import forms
from django.contrib.auth.models import User
def widget_attrs(placeholder):
return {'class': 'u-full-width', 'placeholder': placeholder}
def form_kwargs(widget, label='', max_length=64):
return {'widget': widget, 'label': label, 'max_length': max_length}
#login form
class LoginForm(... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/migrations/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | accounts/models.py | from django.db import models
# Create your models here.
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/tests.py | from django.test import TestCase
from django.urls import reverse
from django.contrib.auth.models import User
from django import forms
from accounts.forms import RegistrationForm, LoginForm
class AccountsTests(TestCase):
def setUp(self):
self.register_data = {
'email': 'new@user.com',
... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/urls.py | from django.urls import path
from accounts import views
#connecting of authorisation form
app_name = 'auth'
urlpatterns = [
path('login/', views.login_view, name='login'),
path('logout/', views.logout_view, name='logout'),
path('register/', views.register, name='register'),
]
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | accounts/views.py | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from accounts.forms import LoginForm, RegistrationForm
from lists.forms import TodoForm
#login request
def login_view(request):
if request.method == 'POST':
... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | api/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | api/migrations/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | api/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from lists.models import TodoList, Todo
class UserSerializer(serializers.ModelSerializer):
todolists = serializers.PrimaryKeyRelatedField(
many=True, queryset=TodoList.objects.all()
)
class Meta:
model = ... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | api/tests.py | from django.urls import reverse
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from lists.models import TodoList
class UserTests(APITestCase):
def setUp(self):
User.objects.create_user('test', 'test@example.com', 'test')
... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | api/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from api import views
router = DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'todolists', views.TodoListViewSet)
router.register(r'todos', views.TodoViewSet)
#connecting of api
app_name = 'api'
url... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | api/views.py | from django.contrib.auth.models import User
from rest_framework import permissions, viewsets
from api.serializers import UserSerializer, TodoListSerializer, TodoSerializer
from lists.models import TodoList, Todo
class IsCreatorOrReadOnly(permissions.BasePermission):
"""
Object-level permission to only allow... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | lists/admin.py | from django.contrib import admin
# Register your models here.
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/forms.py | from django import forms
def widget_attrs(placeholder):
return {'class': 'u-full-width', 'placeholder': placeholder}
def form_kwargs(widget, label='', max_length=128):
return {'widget': widget, 'label': label, 'max_length': max_length}
class TodoForm(forms.Form):
description = forms.CharField(
... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/migrations/0001_initial.py | # Generated by Django 2.0 on 2017-12-02 17:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/migrations/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | lists/models.py | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class TodoList(models.Model):
title = models.CharField(max_length=128, default='List')
created_at = models.DateTimeField(auto_now=True)
creator = models.ForeignKey(User, null=True, related_name='tod... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/templatetags/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | lists/templatetags/lists_extras.py | from django import template
from datetime import datetime
register = template.Library()
@register.filter('humanize')
def humanize_time(dt, past_='ago', future_='from now', default='just now'):
"""
Returns string representing 'time since'
or 'time until' e.g.
3 days ago, 5 hours from now etc.
""... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/tests.py | from django.test import TestCase
from django.urls import reverse
from django.contrib.auth.models import User
from lists.forms import TodoForm, TodoListForm
from lists.models import Todo, TodoList
from unittest import skip
class ListTests(TestCase):
def setUp(self):
self.user = User.objects.create_user(... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/urls.py | from django.urls import path
from lists import views
#connecting of lists
app_name = 'lists'
urlpatterns = [
path('', views.index, name='index'),
path('todolist/<int:todolist_id>/', views.todolist, name='todolist'),
path('todolist/new/', views.new_todolist, name='new_todolist'),
path('todolist/add/', ... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | lists/views.py | from django.shortcuts import get_object_or_404, render, redirect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from lists.models import TodoList, Todo
from lists.forms import TodoForm, TodoListForm
def index(request):
return render(request, 'lists/index.html', {'f... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todolist.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | todolist/__init__.py | [] | [] | [] | |
archives/007MrNiko_Stepper.zip | todolist/settings.py | """
Django settings for todolist project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | todolist/urls.py | from django.urls import path, include
from django.contrib import admin
#connecting of urls
urlpatterns = [
path('', include('lists.urls')),
path('auth/', include('accounts.urls')),
path('api/', include('api.urls')),
path('api-auth/', include('rest_framework.urls')),
path('admin/', admin.site.urls),... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | todolist/wsgi.py | """
WSGI config for todolist project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "todolist.settings")
from django.core... | [] | [] | [] |
archives/007MrNiko_Stepper.zip | weather/urls.py | from django.urls import path
from weather import views
#creating of the weather_app
app_name = 'weather'
urlpatterns = [
path('your_weather', views.index, name='weather'),
]
| [] | [] | [] |
archives/007MrNiko_Stepper.zip | weather/views.py | from django.shortcuts import render, redirect
from django.http import HttpResponse
#connecting of html file (section "weather")
def index(request):
return render(request, 'index.html')
| [] | [] | [] |
archives/097475_hansberger.zip | config/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | config/settings/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | config/settings/base.py | """
Base settings to build other settings files upon.
"""
import environ
ASGI_APPLICATION = 'hansberger.routing.application'
DATA_UPLOAD_MAX_MEMORY_SIZE = 104857600
ROOT_DIR = (
environ.Path(__file__) - 3
) # (hansberger/config/settings/base.py - 3 = hansberger/)
APPS_DIR = ROOT_DIR.path("hansberger")
env = e... | [] | [] | [] |
archives/097475_hansberger.zip | config/settings/local.py | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... | [] | [] | [] |
archives/097475_hansberger.zip | config/settings/production.py | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | [] | [] | [] |
archives/097475_hansberger.zip | config/settings/test.py | """
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
# https://docs.djangoproject.com/en/dev/ref/settings/#se... | [] | [] | [] |
archives/097475_hansberger.zip | config/urls.py | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
path("", TemplateView.as_view(template_name="pages/home... | [] | [] | [] |
archives/097475_hansberger.zip | config/wsgi.py | """
WSGI config for HansBerger project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | [] | [] | [] |
archives/097475_hansberger.zip | docs/__init__.py | # Included so that Django's startproject comment runs against the docs directory
| [] | [] | [] |
archives/097475_hansberger.zip | docs/conf.py | # HansBerger documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that a... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/__init__.py | __version__ = "0.1.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/__init__.py | default_app_config = 'analysis.apps.AnalysisConfig'
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/admin.py | from django.contrib import admin
# Register your models here.
from .models import FiltrationAnalysis, MapperAnalysis
admin.site.register(FiltrationAnalysis)
admin.site.register(MapperAnalysis)
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/apps.py | from django.apps import AppConfig
class AnalysisConfig(AppConfig):
name = 'analysis'
def ready(self):
import analysis.signals # noqa
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/consumers.py | from channels.generic.websocket import WebsocketConsumer
import json
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
def anal... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/forms.py | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Field, Div
from django.urls import reverse_lazy
from .models import FiltrationAnalysis, MapperAnalysis, Bottleneck
from datasets.models import Dataset, DatasetKindChoice
def analysis_name_unique_check... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/migrations/0001_initial.py | # Generated by Django 2.0.13 on 2019-06-27 17:04
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('research', '0001_initial'),
('datasets', '0001_init... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/migrations/0002_auto_20190628_1222.py | # Generated by Django 2.0.13 on 2019-06-28 10:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analysis', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='filtrationwindow',
name='diagrams'... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/migrations/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/analysis/models/__init__.py | from .analysis import Analysis, MapperAnalysis, FiltrationAnalysis # noqa
from .window import Window, MapperWindow, FiltrationWindow # noqa
from .bottleneck import Bottleneck, Diagram # noqa | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/models/analysis.py | import math
import json
import gc
import matplotlib
import matplotlib.pyplot as plt
import mpld3
import pandas
from django.db import models
from django.utils.text import slugify
from django.contrib.postgres.fields import JSONField
import ripser
import kmapper
import sklearn.cluster
import sklearn.preprocessing
import s... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/models/bottleneck.py | import matplotlib
import matplotlib.pyplot as plt
import persim
import ripser
import base64
import numpy
import pandas
import gc
from io import BytesIO
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from ..consumers import StatusHolder, bottleneck_logger_decorator
matplotlib.use('Agg... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/models/window.py | import json
import matplotlib
import matplotlib.pyplot as plt
import ripser
import numpy
import math
import base64
from io import BytesIO
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.utils.text import slugify
from .bottleneck import Bottleneck
matplotlib.use('Agg')
def... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/routing.py | from django.conf.urls import url
from . import consumers
websocket_urlpatterns = [
# (http->django views is added by default)
url(r'^ws/analysis/', consumers.AnalysisConsumer),
]
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/signals.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/analysis/tests.py | from django.test import TestCase
# Create your tests here.
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/urls.py | from django.urls import path
from .views import (
AnalysisListView,
FiltrationAnalysisCreateView,
MapperAnalysisCreateView,
AnalysisDetailView,
AnalysisDeleteView,
WindowListView,
WindowDetailView,
MapperAnalysisView,
WindowBottleneckView,
AnalysisConsecutiveBottleneckView,
A... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/analysis/views.py | import numpy
import json
from itertools import chain
from django.shortcuts import redirect
from django.http import HttpResponse
from django_downloadview import VirtualDownloadView
from django.core.files.base import ContentFile
from django.shortcuts import get_object_or_404, render
from django.urls import reverse_lazy
f... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/conftest.py | import pytest
from django.conf import settings
from django.test import RequestFactory
from hansberger.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> settings.AUTH_USER_MODEL:
retu... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/__init__.py | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/sites/__init__.py | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/sites/migrations/0001_initial.py | import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Site",
fields=[
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/sites/migrations/0002_alter_domain_unique.py | import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sites", "0001_initial")]
operations = [
migrations.AlterField(
model_name="site",
name="domain",
field=models.CharField(
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/sites/migrations/0003_set_site_domain_and_name.py | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/contrib/sites/migrations/__init__.py | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/datasets/admin.py | from django.contrib import admin
from .models import TextDataset, EDFDataset
admin.site.register(TextDataset)
admin.site.register(EDFDataset)
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/apps.py | from django.apps import AppConfig
class DatasetsConfig(AppConfig):
name = 'datasets'
def ready(self):
import datasets.signals # noqa
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/forms.py | from django import forms
from .models import Dataset, TextDataset, EDFDataset
def dataset_name_unique_check(name, research):
return bool(Dataset.objects.filter(
research__slug=research.slug,
name=name
).first())
class DatasetCreationMixin:
def __init__(self, *args, **kwargs):
res... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/migrations/0001_initial.py | # Generated by Django 2.0.13 on 2019-06-27 17:04
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('research', '0001_initial'),
]
operations = [
migrations.CreateModel(
name=... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/migrations/0002_auto_20190628_2017.py | # Generated by Django 2.0.13 on 2019-06-28 18:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datasets', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='textdataset',
name='header_row_inde... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/migrations/0003_auto_20190628_2018.py | # Generated by Django 2.0.13 on 2019-06-28 18:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datasets', '0002_auto_20190628_2017'),
]
operations = [
migrations.AlterField(
model_name='textdataset',
name='head... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/migrations/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/datasets/models/__init__.py | from .dataset import Dataset, DatasetKindChoice # noqa
from .text_dataset import TextDataset # noqa
from .edf_dataset import EDFDataset # noqa
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/models/dataset.py | from enum import Enum
from abc import abstractmethod
import scipy.spatial.distance as distance
import numpy
from django.db import models
from django.utils.text import slugify
from django.urls import reverse_lazy
from research.models import Research
class DatasetKindChoice(Enum):
TEXT = "Text"
EDF = "EDF"
cl... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/models/edf_dataset.py | import numpy as np
import pyedflib
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
import mpld3
from .dataset import Dataset, DatasetKindChoice
def stackplot(marray, seconds=None, start_time=None, ylabels=None):
"""
will plot a stack of traces one above the other assuming
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/models/text_dataset.py | from django.db import models
import pandas as pd
import matplotlib.pyplot as plt
import mpld3
from .dataset import Dataset, DatasetKindChoice
class TextDataset(Dataset):
values_separator_character = models.CharField(max_length=5, default=',', help_text="""separator character of the
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/signals.py | from django.dispatch import receiver
from django.db.models import signals
from .models import Dataset
@receiver(signals.post_delete, sender=Dataset)
def submission_delete(sender, instance, **kwargs):
instance.source.delete(False)
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/urls.py | from django.urls import path
from .views import (
TextDatasetCreateView,
EDFDatasetCreateView,
DatasetListView,
DatasetDeleteView,
DatasetDetailView
)
app_name = 'datasets'
urlpatterns = [
path('', view=DatasetListView.as_view(), name='dataset-list'),
path('create/text/', view=TextDatasetCr... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/datasets/views.py | from django.views.generic import (
CreateView,
DetailView,
ListView,
DeleteView,
)
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from .models import Dataset, TextDataset, EDFDataset
from research.models import Research
from .forms import TextDatasetCreationForm, EDF... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/research/admin.py | from django.contrib import admin
from .models import Research
admin.site.register(Research)
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/apps.py | from django.apps import AppConfig
class ResearchConfig(AppConfig):
name = 'research'
def ready(self):
import research.signals # noqa
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/forms.py | from django import forms
from .models import Research
def research_name_unique_check(name):
return bool(Research.objects.filter(name=name).first())
class ResearchCreationForm(forms.ModelForm):
def clean(self):
cleaned_data = super(ResearchCreationForm, self).clean()
name = cleaned_data.get("... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/migrations/0001_initial.py | # Generated by Django 2.0.13 on 2019-06-27 17:04
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Research',
fields=[
('id', models.AutoFiel... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/migrations/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/research/models.py | from django.db import models
from django.utils.text import slugify
from django.urls import reverse_lazy
class Research(models.Model):
name = models.CharField(max_length=150)
slug = models.SlugField(db_index=True, unique=True, max_length=150)
description = models.TextField(max_length=500, blank=True, null=... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/signals.py | # TODO
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/tests.py | from django.test import TestCase
# Create your tests here.
| [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/urls.py | from django.urls import path
from .views import (
ResearchCreateView,
ResearchDeleteView,
ResearchDetailView,
ResearchListView
)
app_name = 'research'
urlpatterns = [
path("", view=ResearchListView.as_view(), name="research-list"),
path("create/", view=ResearchCreateView.as_view(), name="resea... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/research/views.py | from django.views.generic import (
CreateView,
DeleteView,
DetailView,
ListView,
)
from django.urls import reverse_lazy
from .models import (
Research
)
from .forms import (
ResearchCreationForm
)
class ResearchCreateView(CreateView):
model = Research
form_class = ResearchCreationForm
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/routing.py | from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import analysis.routing
application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
URLRouter(
analysis.routing.websocket_urlpatterns
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/users/__init__.py | [] | [] | [] | |
archives/097475_hansberger.zip | hansberger/users/adapters.py | from typing import Any
from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from django.conf import settings
from django.http import HttpRequest
class AccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request: HttpReques... | [
"HttpRequest",
"HttpRequest",
"Any"
] | [
310,
494,
520
] | [
321,
505,
523
] |
archives/097475_hansberger.zip | hansberger/users/admin.py | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from hansberger.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
... | [] | [] | [] |
archives/097475_hansberger.zip | hansberger/users/apps.py | from django.apps import AppConfig
class UsersAppConfig(AppConfig):
name = "hansberger.users"
verbose_name = "Users"
def ready(self):
try:
import users.signals # noqa F401
except ImportError:
pass
| [] | [] | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.