Skip to main content

MNSI form/model for the clinicedc/edc and other django projects

Project description

pypi actions codecov downloads

edc-mnsi

Django classes for the Michigan Neuropathy Screening Instrument (MNSI).

MNSI scores are calculated in signals.py through a call to the MnsiCalculator and stored in two calculated fields on the model. The two calculated fields can also be viewed as read only on the form in Admin.

See also:

Sample usage:

# models.py
from edc_mnsi.model_mixins import MnsiModelMixin
from edc_model import models as edc_models

class Mnsi(
    MnsiModelMixin,
    edc_models.BaseUuidModel,
):
    class Meta(MnsiModelMixin.Meta, edc_models.BaseUuidModel.Meta):
        verbose_name = "Michigan Neuropathy Screening Instrument (MNSI)"
        verbose_name_plural = "Michigan Neuropathy Screening Instrument (MNSI)"
# forms.py
from django import forms
from edc_form_validators import FormValidatorMixin
from edc_mnsi.form_validator import MnsiFormValidator

from .models import Mnsi


class MnsiForm(FormValidatorMixin, forms.ModelForm):

    form_validator_cls = MnsiFormValidator

    class Meta:
        model = Mnsi
        fields = "__all__"
# admin.py
from edc_mnsi.admin import MnsiModelAdminMixin
from edc_mnsi.fieldsets import get_fieldsets

from .forms import MnsiForm

@admin.register(Mnsi, site=admin)
class MnsiAdmin(
    MnsiModelAdminMixin,
    SimpleHistoryAdmin,
):

    form = MnsiForm

    fieldsets = get_fieldsets()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

edc_mnsi-0.1.3-py3-none-any.whl (28.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page