Skip to content

Commit

Permalink
docstring update
Browse files Browse the repository at this point in the history
  • Loading branch information
matijakolaric committed Jul 11, 2020
1 parent ef6b9cc commit c238ec0
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 55 deletions.
13 changes: 7 additions & 6 deletions docs/modules.rst
Expand Up @@ -43,20 +43,21 @@ music\_publisher.models module
:members:
:show-inheritance:

music\_publisher.admin module
-----------------------------
music\_publisher.cwr_templates module
-------------------------------------

.. automodule:: music_publisher.admin
.. automodule:: music_publisher.cwr_templates
:members:
:show-inheritance:

music\_publisher.cwr_templates module
-------------------------------------
music\_publisher.admin module
-----------------------------

.. automodule:: music_publisher.cwr_templates
.. automodule:: music_publisher.admin
:members:
:show-inheritance:


music\_publisher.data_import module
-----------------------------------

Expand Down
8 changes: 3 additions & 5 deletions music_publisher/__init__.py
@@ -1,8 +1,6 @@
"""
This Django app is holds metadata about musical works and recordings,
including songwriters, performing and recording artists, music library and
albums. It allows data exports in JSON and CWR formats.
Django Admin is the only frontend.
Django-Music-Publisher (DMP) is open source software for managing music
metadata, registration/licencing of musical works and royalty processing.
:mod:`music_publisher` app is the only Django app in this project.
"""
2 changes: 1 addition & 1 deletion music_publisher/apps.py
@@ -1,4 +1,4 @@
"""Django app definition for `music_publisher`."""
"""Django app definition for :mod:`music_publisher`."""

from django.apps import AppConfig

Expand Down
3 changes: 3 additions & 0 deletions music_publisher/base.py
Expand Up @@ -33,6 +33,9 @@ def __str__(self):
class PersonBase(models.Model):
"""Base class for all classes that contain people with first and last name.
This includes writers and artists. For bands, only the last name field is
used.
Attributes:
first_name (django.db.models.CharField): First Name
last_name (django.db.models.CharField): Last Name
Expand Down
2 changes: 2 additions & 0 deletions music_publisher/cwr_templates.py
Expand Up @@ -2,6 +2,7 @@
Attributes:
TEMPLATES_21 (dict): Record templates for CWR 2.1
TEMPLATES_30 (dict): Record templates for CWR 3.0
"""

from django.template import Template
Expand All @@ -13,6 +14,7 @@
'{{ publisher_name|ljust:45 }}01.10{{ creation_date|date:"Ymd" }}'
'{{ creation_date|date:"His" }}{{ creation_date|date:"Ymd" }}'
' \r\n{% endautoescape %}'),
# CWR 2.1 revision 8 "hack" - no sender type field, 11 digit IPI name
'HDR_8': Template(
'{% load cwr_filters %}{% autoescape off %}'
'HDR{{ publisher_ipi_name|rjust:11 }}'
Expand Down
21 changes: 13 additions & 8 deletions music_publisher/data_import.py
Expand Up @@ -3,22 +3,27 @@
"""

import csv
from collections import defaultdict, OrderedDict
from django.utils.text import slugify
from .models import (
Work, Artist, ArtistInWork, Writer, WriterInWork,
Library, LibraryRelease, Recording)
from .admin import WriterInWorkFormSet
import re
from django.conf import settings
from collections import defaultdict, OrderedDict
from decimal import Decimal
from django.forms import inlineformset_factory

from django.conf import settings
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE
from django.contrib.admin.options import get_content_type_for_model
from django.db import IntegrityError, transaction
from django.forms import inlineformset_factory
from django.utils.text import slugify

from .admin import WriterInWorkFormSet
from .models import (
Work, Artist, ArtistInWork, Writer, WriterInWork,
Library, LibraryRelease, Recording)


class DataImporter(object):
"""
"""
FLAT_FIELDS = [
'work_id', 'work_title', 'iswc', 'original_title',
'library', 'cd_identifier']
Expand Down

0 comments on commit c238ec0

Please sign in to comment.