How to use the datacite.models.DOI.objects function in datacite

To help you get started, we’ve selected a few datacite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-machine-learning / mldata / datacite / __init__.py View on Github external
def get_doi(data):
    """
        Generate doi for a given dataset
    """
    from datacite.models import DOI
    doi, c = DOI.objects.get_or_create(slug=settings.DATACITE_FORMAT % {'slug': data.slug.__str__().upper(),
                                       'version': data.version},
        data=data)
    return doi