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