Update develop to Python 3, Django 2.2

Merged
#337 · Created  · Last updated

Merged pull request

Merged in p3django2.2 (pull request #337)

  • 1fc70f2
  • Author:
  • Closed by:
  • 2019-11-12

Description

  • Changing imports to work with Python 3. Refs #404 [skip ci] as known to fail

  • Imports for local_settings in Python3. Refs #404 [skip ci] not ready for tests

  • Filter views now display, f.queryset instead of f in paginator, but filter doesn't display. MethodFilter replaced with CharFilter(method=. Refs #404, #437 [skip ci] not ready for tests

  • Basic working implementation of the DX filter. Refs #404, #437 [skip ci] not ready for tests

  • Starting to reinstate and update DXSummaryListFilter. Age gt not currently working. Might continue upgrade to later Django and version 2 of django_filter before attempting to fix. Refs #404, #437 [skip ci] not ready for tests

  • Global replace of lookup_type with lookup_expr to ease updating filters. Refs #437, #404 [skip ci] not ready for testing

  • Minor change to template to get number of studies. Refs #437, #404 [skip ci] not ready for testing

  • DX summary filtered page now working with all filters except age with django_filters 1.1, Python 3.6, Django 1.8. Need to repeat for other modalities, then move onto Django 1.9 I think. Refs #437, #404 [skip ci] not ready for testing

  • Fixing patient name matching refs #404, #777 [skip ci] not for testing yet

  • Starting to fix up the CT filters. Refs #404, #437 [skip ci] not for testing yet

  • Overcome lookup error by being more explicit; DX now has age, same for CT plus one DLP. Refs #437

  • Not sure why .code_meaning required all of a sudden...

  • Added all the other CT filters, all nominally working. Haven't looked at the order_by stuff. Refs #437

  • RF working as per CT, DX. Refs #437 [skip ci] - not ready for testing

  • MG working as per CT, DX, RF. Refs #437 [skip ci] - not ready for testing

  • max_events is Decimal, Python 3 can't treat this as an int... Refs #404 [skip ci] - not ready for testing

  • Commented out requirements so OpenREM could be 'installed' in this env without old list of packages. Refs #404 [skip ci] - not ready for testing

  • Name of filter has changed, test needs to change. Refs #437 [skip ci] - not ready for testing

  • Starting to get the ordering filters working. Required for tests to pass!. Refs #437 [skip ci] - not ready for testing

  • CT Ordering in place, but without date+time modification. Prob need https://django-filter.readthedocs.io/en/1.1.0/ref/filters.html#adding-custom-filter-choices. Also no default yet. Refs #437 [skip ci] - not ready for testing

  • Changed back to 'o' from 'ordering'. Added "o": "-study_date" to each of the ct export filters. Refs #437 [skip ci] - not ready for testing

  • Code meaning now needs to be explicit for some reason, plus other Python 2/3 string related changes. mammo csv export tests now work. Refs #404 [skip ci] - not ready for testing

  • Got test export rf xlsx working. Issue was needing to add .code_meaning. Refs #404 [skip ci] - not ready for testing

  • Enables PersonName3 values to be listed in a string as per P2. Refs #404 [skip ci] - not ready for testing

  • 'UN' VRs are now read in as byte strings, so need decoding before conversion to Decimal. Must be better method with newer pydicom. Refs #404 [skip ci] - not ready for testing

  • Fixed mistake in mod_filters for CT, updated tests with new filter names. Refs #404, #437 [skip ci] - not ready for testing

  • Fixing display_name filtered links from homepage, code_meaning changes to rfdetail. Refs #404, #437 [skip ci] - not ready for testing

  • CodeMeaning changes, this time for mgdetail. Refs #404 [skip ci] - not ready for testing

  • Corrected filter arg, switched from reverse_lazy to reverse due to https://code.djangoproject.com/ticket/18776. Refs #404, #437 [skip ci] - not ready for testing

  • Added decode for byte reading of name, changed rdsr to use pydicom to be consistent with DX. Refs #404 [skip ci] - not ready for testing

  • Convert to int for range. Refs #404 [skip ci] - not ready for testing

  • Not sure why some mam image values are bytes that need decoding before casting to Decimal, others are float or int. Hence try:except:. Also corrected mod_filters test and reverse_lazy. refs #404, #437 [skip ci] - not ready for testing

  • Change to reflect rounding of filter thickness. Second test currently failing. refs #404, #437 [skip ci] - not ready for testing

  • Now deals with Kodak comma thicknesses with pydicom 1+. Could be neater, old _fix_kodak_filters probably now redundant. Refs #404, #777 [skip ci] docs only.

  • Fixing filter name and another reverse/lazy. Refs #404, #437 [skip ci] docs only.

  • More reverse/lazy. Refs #404 [skip ci] docs only.

  • Appears that names read from DICOM are byte strings, so reflecting that in test. Need to investigate more thoroughly with pydicom. Refs #404, #777 [skip ci] docs only.

  • Improving name handling. No more byte strings. Attempt to replicate original_string in unicode. Refs #404, #777 [skip ci] docs only.

  • Changed method of handling Kodak comma multival thicknesses. fix_kodak still redundant probably. Refs #404, #777 [skip ci] docs only.

  • Need to encode unicode strings before using hashlib, but fixed as hash strings from Python 2 so we know pre/post upgrade hashes will match. Refs #404 [skip ci] docs only.

  • Fix call to rdsr.rdsr, another reverse/lazy. Down to 2 failures 3 errors... Refs #404 [skip ci] Not ready for testing (not just docs!)

  • pydicom doesn't raise ValueError, get TypeError instead as list. Refs #404, #777 [skip ci] Not ready for testing

  • Tests find the root by going up until no init.py is found. There shouldn't be an init.py at the same level as manage.py. Refs #404 [skip ci] Not ready for testing

  • Specified ordering, now works. Refs #404 [skip ci] Not ready for testing

  • Disabled pynetdicom testing for now. All other tests pass. Need to work out Python 3 testing rig on bitbucket. Refs #404, #777, #457, #530 [skip ci] Not ready for testing. Next task - move to Django 1.9...

  • Attempt to run tests on bitbucket with Python 3.6, Django 1.8. Refs #404, #457

  • Hadn't copied changes to local_settings to the example. Refs #404, #457

  • Pipeline failed during coverage due to 025 that looked like an invalid (for Py3) octal. Sourcecode suggests it should be 25 int. Also stopped imports from complaining. Refs #404

  • Django 1.9, added new --parallel switch to test. Refs #404, #457

  • Attempt to use postgres in pipeline. Refs #404

  • Correcting syntax to allow for colon in text. Refs #404

  • Missed the input file. Refs #404

  • Search was too broad, caught ALLOWED_HOSTS. Refs #404

  • Moved install of psycopg2-binary to later in the process

  • Wrongly set hostname to test_user_password! Refs #404

  • See if setting host and port explicitly fixes it Refs #404

  • Attempting to allow access to postgres - not convinced this is the right thing to do. Refs #404

  • Adding explicit user/pass/db instead. Refs #404

  • Want to check if makemigrations completes. Refs #404

  • Issue is Django 1.9 evaluating urls.py before doing the migrations. Refs #404

  • See if this moves the pipeline on further... Refs #404, #457

  • Updating rdsr to use dcmread. Refs #777

  • Migration now works. Not sure whether this will cause further problems. References issue #457.

  • Skin dose map form now working. References issue #457

  • Fixed all broken CreateView and UpdateView methods in views.py. References issue #457

  • Dropping urls.patterns as deprecated. Refs #457

  • Replaced django.db.models.sql.aggregates with django.db.aggregates as per deprecation warning. Refs #457

  • Pycharm doesn't like it, but it works and the deprecation warnings go away.... Refs #457

  • Allow initial migrations for SQLite3 databases - seems to use a different error. Refs #457

  • Old way of enabling admin site deprecated. Refs #457

  • Onto django 1.10. Refs #457

  • render_to_response removed deprecated. Refs #457

  • Admin site for not-patient-indicators syntax no longer working, but not being used so removed. Refs #457

  • Setup for Django 1.11. Refs #457

  • Migrated django-filter to version 2 now we have Django 1.11. Refs #437, #457

  • See if this is still necessary. If it is, then get_solo() will work better. Refs #457

  • SkinDOseCalcSettings not required, so removed. Need to sort out default ordering for filtered pages next. Refs #404, #457

  • Added ordering filters approx as before. Needs time/date modification, needs default ordering. Refs #437

  • AAdding on_delete to ForeignKey and OneToOneField. Refs #457 RemovedInDjango20Warning: on_delete will be a required arg for ForeignKey in Django 2.0. Set it to models.CASCADE on models and in existing migrations if you want to maintain the current default behavior. See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete

  • Importing from django.core.urlresolvers is deprecated. Refs #457

  • Chnage to how admin site urls are included - still need to fix namespace not being unique. Refs #457

  • assertAlmostEquals deprecated for assertAlmostEqual. Refs #457

  • MIDDLEWARE_CLASSES deprecated for MIDDLEWARE. Refs #457

  • assignment_tag deprecated in favour of simple_tag. Tested with RF alerts. Refs #457

  • Replaced all uses of admin in remapp/urls.py due to namespace admin not being unique - turns out was duplicate import in openremproject/urls.py. Refs #457 Remaining fix before moving to 2.0 is ordered queryset in pagination.

  • Default ordering now time and date from newest; order_by choices now use time and date too. Refs #457, #437

  • Bumping Django version to 2.0. Refs #457

  • user.is_authenticated no longer a method, now a property. Refs #457

  • Python 3 only now, so need to remove encoding to utf-8. Seems all values in database might be bytes though... Refs #457

  • Changed everything from dicom to pydicom. Attempted to remove all byte warnings - elements with VR UN are imported as bytes. Existing db data might be bytes too. Refs #457, #404, #777

  • Starting to tidy up urls.py using the new path syntax. Refs #457

  • Finished moving to path for urls.py. Refs #457

  • Fixes to auth views for Django 2.1, bumping version number. Nothing in deprecation warnings for OpenREM. Refs #457

  • Bump to 2.2! Hoorah! Fixed issue with multiplication between float and Decimal. Refs #457

 

0 attachments

Loading commits...