This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from mbdata import models | |
from sqlalchemy.orm import joinedload | |
from brainzutils import cache | |
from critiquebrainz.frontend.external.musicbrainz_db import mb_session, DEFAULT_CACHE_EXPIRATION | |
# Function to return aggregate rating and rating count from the database | |
def get_rating_by_id(id): | |
key = cache.gen_key(id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from mbdata import models | |
from sqlalchemy.orm import joinedload | |
from brainzutils import cache | |
from critiquebrainz.frontend.external.musicbrainz_db import mb_session, DEFAULT_CACHE_EXPIRATION | |
"""Example Function to get information related to recording""" | |
def get_recording_by_id(id, relations=None): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from mbdata import models | |
from sqlalchemy.orm import joinedload | |
from brainzutils import cache | |
from critiquebrainz.frontend.external.musicbrainz_db import mb_session, DEFAULT_CACHE_EXPIRATION | |
"""Example Function to get information related to work""" | |
def get_work_by_id(id, relations=None): | |