Code cleanup
This commit is contained in:
parent
5e0e165037
commit
ca62ed693a
@ -1,6 +1,6 @@
|
||||
from django import forms
|
||||
from crispy_forms.helper import FormHelper
|
||||
from crispy_forms.layout import Submit, HTML, Div
|
||||
from crispy_forms.layout import Submit, HTML
|
||||
from crispy_bulma.layout import FormGroup
|
||||
|
||||
from . import models, fields
|
||||
|
||||
@ -8,9 +8,7 @@ from byostorage.user import BYOStorage
|
||||
|
||||
import random
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import os.path
|
||||
from .utils import sign_data
|
||||
|
||||
MEDIA_TYPES = [
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
from django.test import TestCase, Client
|
||||
|
||||
from interface import models, utils
|
||||
from django.contrib.auth.models import User
|
||||
from interface import models
|
||||
|
||||
from . import AccessTestCase
|
||||
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
from whoosh.index import create_in, open_dir, EmptyIndexError, Index
|
||||
from whoosh.analysis import StemmingAnalyzer, CharsetFilter
|
||||
from whoosh.support.charset import accent_map
|
||||
from whoosh.fields import Schema, ID, TEXT, KEYWORD, STORED, NUMERIC
|
||||
from whoosh.fields import Schema, TEXT, KEYWORD, NUMERIC
|
||||
from whoosh.qparser import QueryParser
|
||||
from whoosh.query import Term, NullQuery
|
||||
|
||||
from library.models import Work
|
||||
|
||||
from typing import Any
|
||||
from django.conf import settings
|
||||
from django.db.models import QuerySet
|
||||
import os.path
|
||||
import shutil
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.core.management.base import BaseCommand
|
||||
import argparse
|
||||
import csv
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from library import models
|
||||
from library.indexer import model_search, index_works, indexer
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
from os import SCHED_OTHER
|
||||
from django.conf import settings
|
||||
from django.shortcuts import resolve_url
|
||||
from django.db import models
|
||||
from django.utils.text import slugify
|
||||
from django.utils.timezone import now
|
||||
from django.utils.functional import cached_property
|
||||
from django.db.models import Q, Count, Min, Max
|
||||
from django.db.models import Count, Min, Max
|
||||
|
||||
import re
|
||||
import os.path
|
||||
@ -365,7 +363,7 @@ class Work(models.Model):
|
||||
|
||||
def unassigned_instruments(self):
|
||||
assigned = set(self.assigned_instruments())
|
||||
return [x for x in self.orchestration.as_list() if not x[0] in assigned]
|
||||
return [x for x in self.orchestration.as_list() if x[0] not in assigned]
|
||||
|
||||
def music_tags(self):
|
||||
tags = dict(self.orchestration.as_list())
|
||||
|
||||
@ -2,7 +2,6 @@ from interface.tests import AccessTestCase
|
||||
|
||||
from byostorage.user import UserStorage
|
||||
from . import models
|
||||
from .views.api import WorkSerializer
|
||||
|
||||
import tempfile
|
||||
import json
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
from django.urls import path, include
|
||||
from django.contrib.auth import views as auth_views
|
||||
from rest_framework import routers
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
|
||||
@ -35,14 +35,13 @@ class WorkExportView(EnsembleMixin, WorkMixin, View):
|
||||
|
||||
from interface.views import AuthorizedResourceMixin
|
||||
|
||||
from rest_framework import routers, serializers, viewsets
|
||||
from rest_framework import serializers
|
||||
from rest_framework.exceptions import APIException
|
||||
|
||||
from library.models import Collection, Work, Document, Section, WorkMeta
|
||||
|
||||
|
||||
import requests
|
||||
from io import BytesIO
|
||||
import urllib
|
||||
import shutil
|
||||
import os.path
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user