diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index accc50c..54d8c3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,11 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10'] - django-version: ['3.2', '4.0', '4.1', 'dev'] - + python-version: ['3.10', '3.11'] + django-version: ['4.1', '4.2', 'dev'] + exclude: + - python-version: '3.10' + django-version: 'dev' services: mysql: image: mysql:latest @@ -31,20 +33,19 @@ jobs: sudo apt-get -y update sudo apt-get install libcups2-dev wamerican - - uses: actions/checkout@v2 - + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Get pip cache dir id: pip-cache run: | - echo "::set-output name=dir::$(pip cache dir)" + echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - name: Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: @@ -64,7 +65,7 @@ jobs: env: DJANGO: ${{ matrix.django-version }} - - name: Upload coverage - uses: codecov/codecov-action@v1 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 with: name: Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d09a4e..718de57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,10 +10,10 @@ repos: - "-x *test*.py" - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black - language_version: python3.9 + language_version: python3.10 - repo: https://github.com/pycqa/flake8 rev: 6.0.0 @@ -42,7 +42,7 @@ repos: - id: detect-private-key - repo: https://github.com/adrienverge/yamllint - rev: v1.30.0 + rev: v1.31.0 hooks: - id: yamllint args: diff --git a/VERSION b/VERSION deleted file mode 100644 index 7ac4e5e..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.1.13 diff --git a/edc_pharmacy/admin/dispensing_history_admin.py b/edc_pharmacy/admin/dispensing_history_admin.py index 37c5f91..5311b42 100644 --- a/edc_pharmacy/admin/dispensing_history_admin.py +++ b/edc_pharmacy/admin/dispensing_history_admin.py @@ -13,7 +13,6 @@ @admin.register(DispensingHistory, site=edc_pharmacy_admin) class DispensingHistoryAdmin(ModelAdminMixin, admin.ModelAdmin): - form = DispensingHistoryForm fieldsets = ( diff --git a/edc_pharmacy/admin/dosage_guideline_admin.py b/edc_pharmacy/admin/dosage_guideline_admin.py index 4023861..7dcafc1 100644 --- a/edc_pharmacy/admin/dosage_guideline_admin.py +++ b/edc_pharmacy/admin/dosage_guideline_admin.py @@ -11,7 +11,6 @@ @admin.register(DosageGuideline, site=edc_pharmacy_admin) class DosageGuidelineAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True autocomplete_fields = ["medication"] diff --git a/edc_pharmacy/admin/formulation_admin.py b/edc_pharmacy/admin/formulation_admin.py index eedf58c..5e0744b 100644 --- a/edc_pharmacy/admin/formulation_admin.py +++ b/edc_pharmacy/admin/formulation_admin.py @@ -11,7 +11,6 @@ @admin.register(Formulation, site=edc_pharmacy_admin) class FormulationAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True autocomplete_fields = ["medication"] diff --git a/edc_pharmacy/admin/labels_admin.py b/edc_pharmacy/admin/labels_admin.py index 5493979..9ffaf29 100644 --- a/edc_pharmacy/admin/labels_admin.py +++ b/edc_pharmacy/admin/labels_admin.py @@ -10,7 +10,6 @@ @admin.register(Labels, site=edc_pharmacy_admin) class LabelsAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = LabelsForm diff --git a/edc_pharmacy/admin/list_filters.py b/edc_pharmacy/admin/list_filters.py index 4864b68..c51709c 100644 --- a/edc_pharmacy/admin/list_filters.py +++ b/edc_pharmacy/admin/list_filters.py @@ -5,7 +5,6 @@ class MedicationsListFilter(SimpleListFilter): - title = "Medication" parameter_name = "medication_name" diff --git a/edc_pharmacy/admin/medication_admin.py b/edc_pharmacy/admin/medication_admin.py index 01c54ef..3ebed39 100644 --- a/edc_pharmacy/admin/medication_admin.py +++ b/edc_pharmacy/admin/medication_admin.py @@ -11,7 +11,6 @@ @admin.register(Medication, site=edc_pharmacy_admin) class MedicationAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = MedicationForm diff --git a/edc_pharmacy/admin/medication_lot_admin.py b/edc_pharmacy/admin/medication_lot_admin.py index cb002c3..4c1189d 100644 --- a/edc_pharmacy/admin/medication_lot_admin.py +++ b/edc_pharmacy/admin/medication_lot_admin.py @@ -11,7 +11,6 @@ @admin.register(MedicationLot, site=edc_pharmacy_admin) class MedicationLotAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = MedicationLotForm diff --git a/edc_pharmacy/admin/order_admin.py b/edc_pharmacy/admin/order_admin.py index 0433d0c..d5c4cd9 100644 --- a/edc_pharmacy/admin/order_admin.py +++ b/edc_pharmacy/admin/order_admin.py @@ -8,7 +8,6 @@ @admin.register(Order, site=edc_pharmacy_admin) class OrderAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True # autocomplete_fields = ( diff --git a/edc_pharmacy/admin/product_admin.py b/edc_pharmacy/admin/product_admin.py index 1078044..6fccc54 100644 --- a/edc_pharmacy/admin/product_admin.py +++ b/edc_pharmacy/admin/product_admin.py @@ -9,7 +9,6 @@ @admin.register(Product, site=edc_pharmacy_admin) class ProductAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = ProductForm diff --git a/edc_pharmacy/admin/return_history_admin.py b/edc_pharmacy/admin/return_history_admin.py index 9b79729..44829bc 100644 --- a/edc_pharmacy/admin/return_history_admin.py +++ b/edc_pharmacy/admin/return_history_admin.py @@ -13,7 +13,6 @@ @admin.register(ReturnHistory, site=edc_pharmacy_admin) class ReturnHistoryAdmin(ModelAdminMixin, admin.ModelAdmin): - form = ReturnHistoryForm fieldsets = ( diff --git a/edc_pharmacy/admin/rx_admin.py b/edc_pharmacy/admin/rx_admin.py index 3db0405..0477229 100644 --- a/edc_pharmacy/admin/rx_admin.py +++ b/edc_pharmacy/admin/rx_admin.py @@ -12,7 +12,6 @@ @admin.register(Rx, site=edc_pharmacy_admin) class RxAdmin(ModelAdminSubjectDashboardMixin, admin.ModelAdmin): - show_object_tools = True form = RxForm diff --git a/edc_pharmacy/admin/rx_refill_admin.py b/edc_pharmacy/admin/rx_refill_admin.py index 4f76573..f74235a 100644 --- a/edc_pharmacy/admin/rx_refill_admin.py +++ b/edc_pharmacy/admin/rx_refill_admin.py @@ -19,7 +19,6 @@ @admin.register(RxRefill, site=edc_pharmacy_admin) class RxRefillAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True ordering: Tuple[str, ...] = ("refill_start_datetime",) @@ -210,7 +209,6 @@ def get_subject_dashboard_url_kwargs(self, obj): class RxRefillInlineAdmin(admin.StackedInline): - form = RxRefillForm model = RxRefill diff --git a/edc_pharmacy/admin/stock_admin.py b/edc_pharmacy/admin/stock_admin.py index e36d459..e25d692 100644 --- a/edc_pharmacy/admin/stock_admin.py +++ b/edc_pharmacy/admin/stock_admin.py @@ -9,7 +9,6 @@ @admin.register(Stock, site=edc_pharmacy_admin) class StockAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = StockForm diff --git a/edc_pharmacy/admin/stock_create_labels_admin.py b/edc_pharmacy/admin/stock_create_labels_admin.py index 2b1d890..8ce34d4 100644 --- a/edc_pharmacy/admin/stock_create_labels_admin.py +++ b/edc_pharmacy/admin/stock_create_labels_admin.py @@ -10,7 +10,6 @@ @admin.register(StockCreateLabels, site=edc_pharmacy_admin) class StockCreateLabelsAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = StockCreateLabelsForm diff --git a/edc_pharmacy/admin/stock_receiving_admin.py b/edc_pharmacy/admin/stock_receiving_admin.py index aaf2ca5..0f8cd43 100644 --- a/edc_pharmacy/admin/stock_receiving_admin.py +++ b/edc_pharmacy/admin/stock_receiving_admin.py @@ -9,7 +9,6 @@ @admin.register(StockReceiving, site=edc_pharmacy_admin) class StockReceivingAdmin(ModelAdminMixin, admin.ModelAdmin): - show_object_tools = True form = StockReceivingForm diff --git a/edc_pharmacy/approve_prescription.py b/edc_pharmacy/approve_prescription.py index 712037f..c99ac15 100644 --- a/edc_pharmacy/approve_prescription.py +++ b/edc_pharmacy/approve_prescription.py @@ -3,7 +3,6 @@ class PrescriptionApprovalValidatorError(Exception): class ApprovePrescription: - prescription_model = "edc_pharmacy.rx" def __init__(self, rx_model_obj=None): diff --git a/edc_pharmacy/dosage_calculator.py b/edc_pharmacy/dosage_calculator.py index c3b06e8..9ef2cc8 100644 --- a/edc_pharmacy/dosage_calculator.py +++ b/edc_pharmacy/dosage_calculator.py @@ -13,7 +13,6 @@ def __init__( formulation: Optional[Any] = None, weight_in_kgs: Optional[Union[float, Decimal]] = None, ) -> None: - self.dosage_guideline = dosage_guideline self.formulation = formulation if formulation.medication != dosage_guideline.medication: diff --git a/edc_pharmacy/forms/crf/study_medication_modelform_mixin.py b/edc_pharmacy/forms/crf/study_medication_modelform_mixin.py index 29bc07f..0ee5ea4 100644 --- a/edc_pharmacy/forms/crf/study_medication_modelform_mixin.py +++ b/edc_pharmacy/forms/crf/study_medication_modelform_mixin.py @@ -4,7 +4,6 @@ class StudyMedicationModelFormMixin: - form_validator_cls = StudyMedicationFormValidator def clean(self): diff --git a/edc_pharmacy/forms/dispensing_history_form.py b/edc_pharmacy/forms/dispensing_history_form.py index 696aa42..c244130 100644 --- a/edc_pharmacy/forms/dispensing_history_form.py +++ b/edc_pharmacy/forms/dispensing_history_form.py @@ -21,7 +21,6 @@ class Meta: class DispensingHistoryReadonlyForm(forms.ModelForm): - count = forms.DecimalField( label="Count", widget=forms.TextInput(attrs={"readonly": "readonly"}) ) diff --git a/edc_pharmacy/migrations/0001_initial.py b/edc_pharmacy/migrations/0001_initial.py index b0fbc7b..797679b 100644 --- a/edc_pharmacy/migrations/0001_initial.py +++ b/edc_pharmacy/migrations/0001_initial.py @@ -31,7 +31,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/edc_pharmacy/migrations/0002_alter_medication_unique_together.py b/edc_pharmacy/migrations/0002_alter_medication_unique_together.py index c8b3cb3..27fe18b 100644 --- a/edc_pharmacy/migrations/0002_alter_medication_unique_together.py +++ b/edc_pharmacy/migrations/0002_alter_medication_unique_together.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0001_initial"), ] diff --git a/edc_pharmacy/migrations/0003_alter_rxrefill_unique_together.py b/edc_pharmacy/migrations/0003_alter_rxrefill_unique_together.py index 532e72b..cd55630 100644 --- a/edc_pharmacy/migrations/0003_alter_rxrefill_unique_together.py +++ b/edc_pharmacy/migrations/0003_alter_rxrefill_unique_together.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0002_alter_medication_unique_together"), ] diff --git a/edc_pharmacy/migrations/0004_auto_20220414_1741.py b/edc_pharmacy/migrations/0004_auto_20220414_1741.py index b379234..9291ece 100644 --- a/edc_pharmacy/migrations/0004_auto_20220414_1741.py +++ b/edc_pharmacy/migrations/0004_auto_20220414_1741.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0003_alter_rxrefill_unique_together"), ] diff --git a/edc_pharmacy/migrations/0005_alter_rx_managers.py b/edc_pharmacy/migrations/0005_alter_rx_managers.py index ba5e516..0d1fe03 100644 --- a/edc_pharmacy/migrations/0005_alter_rx_managers.py +++ b/edc_pharmacy/migrations/0005_alter_rx_managers.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0004_auto_20220414_1741"), ] diff --git a/edc_pharmacy/migrations/0006_historicalrxrefill_roundup_divisible_by_and_more.py b/edc_pharmacy/migrations/0006_historicalrxrefill_roundup_divisible_by_and_more.py index fef3199..005a0f9 100644 --- a/edc_pharmacy/migrations/0006_historicalrxrefill_roundup_divisible_by_and_more.py +++ b/edc_pharmacy/migrations/0006_historicalrxrefill_roundup_divisible_by_and_more.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0005_alter_rx_managers"), ] diff --git a/edc_pharmacy/migrations/0007_auto_20220704_1841.py b/edc_pharmacy/migrations/0007_auto_20220704_1841.py index 1986e4e..ee9588e 100644 --- a/edc_pharmacy/migrations/0007_auto_20220704_1841.py +++ b/edc_pharmacy/migrations/0007_auto_20220704_1841.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0006_historicalrxrefill_roundup_divisible_by_and_more"), ] diff --git a/edc_pharmacy/migrations/0008_auto_20220706_2324.py b/edc_pharmacy/migrations/0008_auto_20220706_2324.py index dd61980..b6b4f08 100644 --- a/edc_pharmacy/migrations/0008_auto_20220706_2324.py +++ b/edc_pharmacy/migrations/0008_auto_20220706_2324.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0007_auto_20220704_1841"), ] diff --git a/edc_pharmacy/migrations/0009_auto_20220708_0805.py b/edc_pharmacy/migrations/0009_auto_20220708_0805.py index 00a5d50..f565cb6 100644 --- a/edc_pharmacy/migrations/0009_auto_20220708_0805.py +++ b/edc_pharmacy/migrations/0009_auto_20220708_0805.py @@ -19,7 +19,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("sites", "0002_alter_domain_unique"), diff --git a/edc_pharmacy/migrations/0010_auto_20220708_0813.py b/edc_pharmacy/migrations/0010_auto_20220708_0813.py index 227f032..7a8e9c4 100644 --- a/edc_pharmacy/migrations/0010_auto_20220708_0813.py +++ b/edc_pharmacy/migrations/0010_auto_20220708_0813.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0009_auto_20220708_0805"), ] diff --git a/edc_pharmacy/migrations/0011_auto_20220826_0406.py b/edc_pharmacy/migrations/0011_auto_20220826_0406.py index 1439a0a..c8ec69c 100644 --- a/edc_pharmacy/migrations/0011_auto_20220826_0406.py +++ b/edc_pharmacy/migrations/0011_auto_20220826_0406.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0010_auto_20220708_0813"), ] diff --git a/edc_pharmacy/migrations/0012_auto_20220907_0157.py b/edc_pharmacy/migrations/0012_auto_20220907_0157.py index 81b0e07..85adc22 100644 --- a/edc_pharmacy/migrations/0012_auto_20220907_0157.py +++ b/edc_pharmacy/migrations/0012_auto_20220907_0157.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0011_auto_20220826_0406"), ] diff --git a/edc_pharmacy/migrations/0013_auto_20220907_0202.py b/edc_pharmacy/migrations/0013_auto_20220907_0202.py index ed61b1d..43971b4 100644 --- a/edc_pharmacy/migrations/0013_auto_20220907_0202.py +++ b/edc_pharmacy/migrations/0013_auto_20220907_0202.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0012_auto_20220907_0157"), ] diff --git a/edc_pharmacy/migrations/0014_auto_20220907_0207.py b/edc_pharmacy/migrations/0014_auto_20220907_0207.py index 077111c..c095611 100644 --- a/edc_pharmacy/migrations/0014_auto_20220907_0207.py +++ b/edc_pharmacy/migrations/0014_auto_20220907_0207.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0013_auto_20220907_0202"), ] diff --git a/edc_pharmacy/migrations/0015_auto_20220913_2139.py b/edc_pharmacy/migrations/0015_auto_20220913_2139.py index a35790d..144148d 100644 --- a/edc_pharmacy/migrations/0015_auto_20220913_2139.py +++ b/edc_pharmacy/migrations/0015_auto_20220913_2139.py @@ -17,7 +17,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("edc_pharmacy", "0014_auto_20220907_0207"), diff --git a/edc_pharmacy/migrations/0016_auto_20220929_1742.py b/edc_pharmacy/migrations/0016_auto_20220929_1742.py index 7c0d694..1bdc01e 100644 --- a/edc_pharmacy/migrations/0016_auto_20220929_1742.py +++ b/edc_pharmacy/migrations/0016_auto_20220929_1742.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("edc_pharmacy", "0015_auto_20220913_2139"), ] diff --git a/edc_pharmacy/model_mixins/medication_order_model_mixin.py b/edc_pharmacy/model_mixins/medication_order_model_mixin.py index 9c62e5c..4819861 100644 --- a/edc_pharmacy/model_mixins/medication_order_model_mixin.py +++ b/edc_pharmacy/model_mixins/medication_order_model_mixin.py @@ -3,7 +3,6 @@ class MedicationOrderModelMixin(models.Model): - stock = models.ForeignKey( "edc_pharmacy.stock", null=True, diff --git a/edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py b/edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py index 4b37d3d..9590bbb 100644 --- a/edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py +++ b/edc_pharmacy/model_mixins/study_medication_crf_model_mixin.py @@ -22,7 +22,6 @@ class StudyMedicationCrfModelMixin(PreviousNextModelMixin, StudyMedicationRefill """Declare with field subject_visit using a CRF model mixin""" def save(self, *args, **kwargs): - if not self.formulation: raise StudyMedicationError( f"Formulation cannot be None. Perhaps catch this in the form. See {self}." diff --git a/edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py b/edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py index edd25e8..656ea82 100644 --- a/edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py +++ b/edc_pharmacy/model_mixins/study_medication_refill_model_mixin.py @@ -7,7 +7,6 @@ class StudyMedicationRefillModelMixin(models.Model): - refill = models.CharField( verbose_name="Will the subject receive study medication for this visit", max_length=15, diff --git a/edc_pharmacy/models/dispensing_history.py b/edc_pharmacy/models/dispensing_history.py index 3f036c7..02894f4 100644 --- a/edc_pharmacy/models/dispensing_history.py +++ b/edc_pharmacy/models/dispensing_history.py @@ -10,7 +10,6 @@ class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, rx_refill, dispensed_datetime): diff --git a/edc_pharmacy/models/dosage_guideline.py b/edc_pharmacy/models/dosage_guideline.py index 0bec60c..ebad542 100644 --- a/edc_pharmacy/models/dosage_guideline.py +++ b/edc_pharmacy/models/dosage_guideline.py @@ -9,7 +9,6 @@ class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, medication_name, dose, dose_units, dose_per_kg): diff --git a/edc_pharmacy/models/formulation.py b/edc_pharmacy/models/formulation.py index 753c58a..997a000 100644 --- a/edc_pharmacy/models/formulation.py +++ b/edc_pharmacy/models/formulation.py @@ -8,7 +8,6 @@ class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, name, strength, units, formulation_type): @@ -16,7 +15,6 @@ def get_by_natural_key(self, name, strength, units, formulation_type): class Formulation(edc_models.BaseUuidModel): - medication = models.ForeignKey(Medication, on_delete=PROTECT, null=True, blank=False) strength = models.DecimalField(max_digits=6, decimal_places=1) diff --git a/edc_pharmacy/models/medication.py b/edc_pharmacy/models/medication.py index 2e6e636..60ba82b 100644 --- a/edc_pharmacy/models/medication.py +++ b/edc_pharmacy/models/medication.py @@ -3,7 +3,6 @@ class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, name): @@ -11,7 +10,6 @@ def get_by_natural_key(self, name): class Medication(edc_models.BaseUuidModel): - name = models.CharField(max_length=35, unique=True) display_name = models.CharField(max_length=50, unique=True) diff --git a/edc_pharmacy/models/medication_lot.py b/edc_pharmacy/models/medication_lot.py index a7a39a4..fe90a4c 100644 --- a/edc_pharmacy/models/medication_lot.py +++ b/edc_pharmacy/models/medication_lot.py @@ -7,12 +7,10 @@ class Manager(models.Manager): - use_in_migrations = True class MedicationLot(BaseUuidModel): - lot_no = models.CharField(max_length=50, unique=True) assignment = EncryptedCharField(null=True) diff --git a/edc_pharmacy/models/order.py b/edc_pharmacy/models/order.py index c43b991..8d204dd 100644 --- a/edc_pharmacy/models/order.py +++ b/edc_pharmacy/models/order.py @@ -7,12 +7,10 @@ class Manager(models.Manager): - use_in_migrations = True class Order(NonUniqueSubjectIdentifierFieldMixin, BaseUuidModel): - order_datetime = models.DateTimeField(verbose_name="Order date/time") product = models.ForeignKey(Product, on_delete=PROTECT) diff --git a/edc_pharmacy/models/product.py b/edc_pharmacy/models/product.py index b093674..f93e4e0 100644 --- a/edc_pharmacy/models/product.py +++ b/edc_pharmacy/models/product.py @@ -11,12 +11,10 @@ class Manager(models.Manager): - use_in_migrations = True class Product(SiteModelMixin, edc_models.BaseUuidModel): - product_identifier = models.CharField(max_length=36, default=uuid4, unique=True) name = models.CharField(max_length=250, unique=True, editable=False) diff --git a/edc_pharmacy/models/return_history.py b/edc_pharmacy/models/return_history.py index d9b40c1..f73b201 100644 --- a/edc_pharmacy/models/return_history.py +++ b/edc_pharmacy/models/return_history.py @@ -11,7 +11,6 @@ class ReturnError(Exception): class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, prescription_item, return_datetime): @@ -19,7 +18,6 @@ def get_by_natural_key(self, prescription_item, return_datetime): class ReturnHistory(edc_models.BaseUuidModel): - rx_refill = models.ForeignKey(RxRefill, on_delete=PROTECT) return_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/models/rx_refill.py b/edc_pharmacy/models/rx_refill.py index 85cd65b..bf1c7b8 100644 --- a/edc_pharmacy/models/rx_refill.py +++ b/edc_pharmacy/models/rx_refill.py @@ -18,7 +18,6 @@ class Manager(models.Manager): - use_in_migrations = True def get_by_natural_key(self, prescription, medication, refill_start_datetime): @@ -31,7 +30,6 @@ class RxRefill( SiteModelMixin, edc_models.BaseUuidModel, ): - rx = models.ForeignKey(Rx, on_delete=PROTECT) refill_identifier = models.CharField(max_length=36, default=uuid4, editable=False) diff --git a/edc_pharmacy/models/stock.py b/edc_pharmacy/models/stock.py index f77929a..92794eb 100644 --- a/edc_pharmacy/models/stock.py +++ b/edc_pharmacy/models/stock.py @@ -9,12 +9,10 @@ class Manager(models.Manager): - use_in_migrations = True class Stock(SiteModelMixin, edc_models.BaseUuidModel): - stock_identifier = models.CharField(max_length=36, default=uuid4, unique=True) product = models.ForeignKey(Product, on_delete=PROTECT) diff --git a/edc_pharmacy/models/stock_create_labels.py b/edc_pharmacy/models/stock_create_labels.py index d8f18dc..04b061e 100644 --- a/edc_pharmacy/models/stock_create_labels.py +++ b/edc_pharmacy/models/stock_create_labels.py @@ -8,12 +8,10 @@ class Manager(models.Manager): - use_in_migrations = True class StockCreateLabels(edc_models.BaseUuidModel): - product = models.ForeignKey(Product, on_delete=PROTECT) qty = models.IntegerField(verbose_name="Number of labels to print") @@ -35,7 +33,6 @@ class Meta(edc_models.BaseUuidModel.Meta): class Labels(edc_models.BaseUuidModel): - stock_create_labels = models.ForeignKey(StockCreateLabels, on_delete=PROTECT) stock_identifier = models.CharField(max_length=36, default=uuid4, unique=True) diff --git a/edc_pharmacy/models/stock_receiving.py b/edc_pharmacy/models/stock_receiving.py index a42f1d7..151b790 100644 --- a/edc_pharmacy/models/stock_receiving.py +++ b/edc_pharmacy/models/stock_receiving.py @@ -6,12 +6,10 @@ class Manager(models.Manager): - use_in_migrations = True class StockReceiving(edc_models.BaseUuidModel): - product = models.ForeignKey(Product, on_delete=PROTECT) qty = models.IntegerField() diff --git a/edc_pharmacy/models/storage/box.py b/edc_pharmacy/models/storage/box.py index df9117f..b2b609d 100644 --- a/edc_pharmacy/models/storage/box.py +++ b/edc_pharmacy/models/storage/box.py @@ -8,7 +8,6 @@ class Box(BaseUuidModel): - box_identifier = models.CharField(max_length=36, default=uuid4, unique=True) box_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/models/storage/items/container_model_mixin.py b/edc_pharmacy/models/storage/items/container_model_mixin.py index 55a9679..ae5b0e6 100644 --- a/edc_pharmacy/models/storage/items/container_model_mixin.py +++ b/edc_pharmacy/models/storage/items/container_model_mixin.py @@ -8,7 +8,6 @@ class ContainerModelMixin(models.Model): - container_identifier = models.CharField(max_length=36, default=uuid4, unique=True) container_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/models/storage/items/pill_bottle_model_mixin.py b/edc_pharmacy/models/storage/items/pill_bottle_model_mixin.py index 13315b9..103a5a9 100644 --- a/edc_pharmacy/models/storage/items/pill_bottle_model_mixin.py +++ b/edc_pharmacy/models/storage/items/pill_bottle_model_mixin.py @@ -11,7 +11,6 @@ class PillBottleError(Exception): class PillBottleModelMixin(ContainerModelMixin, BaseUuidModel): - formulation = models.ForeignKey(Formulation, on_delete=models.PROTECT, blank=True) medication_lot = models.ForeignKey(MedicationLot, on_delete=models.PROTECT) diff --git a/edc_pharmacy/models/storage/items/subject_pill_bottle.py b/edc_pharmacy/models/storage/items/subject_pill_bottle.py index 111d541..c6646aa 100644 --- a/edc_pharmacy/models/storage/items/subject_pill_bottle.py +++ b/edc_pharmacy/models/storage/items/subject_pill_bottle.py @@ -5,7 +5,6 @@ class SubjectPillBottle(PillBottleModelMixin): - rando_sid = models.CharField(max_length=25) subject_identifier = models.CharField(max_length=50, null=True) diff --git a/edc_pharmacy/models/storage/location.py b/edc_pharmacy/models/storage/location.py index 98447b1..d8d225d 100644 --- a/edc_pharmacy/models/storage/location.py +++ b/edc_pharmacy/models/storage/location.py @@ -6,7 +6,6 @@ class Location(BaseUuidModel): - location_identifier = models.CharField(max_length=36, default=uuid4, unique=True) location_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/models/storage/room.py b/edc_pharmacy/models/storage/room.py index f176d67..0b2f3b9 100644 --- a/edc_pharmacy/models/storage/room.py +++ b/edc_pharmacy/models/storage/room.py @@ -8,7 +8,6 @@ class Room(BaseUuidModel): - room_identifier = models.CharField(max_length=36, default=uuid4, unique=True) room_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/models/storage/shelf.py b/edc_pharmacy/models/storage/shelf.py index 301315f..3a86677 100644 --- a/edc_pharmacy/models/storage/shelf.py +++ b/edc_pharmacy/models/storage/shelf.py @@ -8,7 +8,6 @@ class Shelf(BaseUuidModel): - shelf_identifier = models.CharField(max_length=36, default=uuid4, unique=True) shelf_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_pharmacy/tests/forms.py b/edc_pharmacy/tests/forms.py index 78e335d..dc7f621 100644 --- a/edc_pharmacy/tests/forms.py +++ b/edc_pharmacy/tests/forms.py @@ -14,7 +14,6 @@ def validate_demographics(self) -> None: class StudyMedicationForm(CrfModelFormMixin, forms.ModelForm): - form_validator_cls = StudyMedicationFormValidator def validate_against_consent(self): diff --git a/edc_pharmacy/tests/models.py b/edc_pharmacy/tests/models.py index 9b4c8da..6c169e1 100644 --- a/edc_pharmacy/tests/models.py +++ b/edc_pharmacy/tests/models.py @@ -36,7 +36,6 @@ class StudyMedication( CrfModelMixin, BaseUuidModel, ): - subject_visit = models.OneToOneField(SubjectVisit, on_delete=models.PROTECT) report_datetime = models.DateTimeField(default=get_utcnow) @@ -55,10 +54,8 @@ class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta): class OnSchedule(SiteModelMixin, OnScheduleModelMixin, BaseUuidModel): - pass class OffSchedule(SiteModelMixin, OffScheduleModelMixin, BaseUuidModel): - pass diff --git a/edc_pharmacy/tests/tests/test_stock.py b/edc_pharmacy/tests/tests/test_stock.py index dcb78fe..f52148b 100644 --- a/edc_pharmacy/tests/tests/test_stock.py +++ b/edc_pharmacy/tests/tests/test_stock.py @@ -41,7 +41,6 @@ def setUp(self): ) def test_build_location(self): - location = Location.objects.create(name="LOCATION_ONE") room = Room.objects.create(name="ROOM_ONE", location=location) shelf = Shelf.objects.create(name="SHELF_ONE", room=room) diff --git a/edc_pharmacy/tests/tests/test_study_medication_crf.py b/edc_pharmacy/tests/tests/test_study_medication_crf.py index 7d8303b..ce53681 100644 --- a/edc_pharmacy/tests/tests/test_study_medication_crf.py +++ b/edc_pharmacy/tests/tests/test_study_medication_crf.py @@ -38,7 +38,6 @@ @override_settings(SUBJECT_CONSENT_MODEL="edc_pharmacy.subjectconsent") class TestMedicationCrf(TestCase): - helper_cls = Helper @classmethod diff --git a/pyproject.toml b/pyproject.toml index 6f46ae7..23cb86d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,8 @@ exclude_lines = [ legacy_tox_ini = """ [tox] envlist = - py{310,311}-dj{41,dev}, + py{310}-dj{41,42}, + py{311}-dj{41,42,dev}, lint isolated_build = true @@ -48,7 +49,8 @@ python = [gh-actions:env] DJANGO = - 4.1: dj41, lint + 4.1: dj41 + 4.2: dj42, lint dev: djdev [testenv] @@ -58,6 +60,7 @@ deps = -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt dj41: Django>=4.1,<4.2 + dj42: Django>=4.2,<5.0 djdev: https://github.com/django/django/tarball/main commands = diff --git a/setup.cfg b/setup.cfg index ee43924..42c6061 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,6 @@ keywords = django Edc pharmacy, clinicedc, clinical trials classifiers= Environment :: Web Environment Framework :: Django - Framework :: Django :: 4.0 Framework :: Django :: 4.1 Intended Audience :: Developers Intended Audience :: Science/Research