LayerMapError when saving shapefile with linear referencing in GeoDjango

TLDR: How do I save/read a LineStringZM / MultiLineStringZM type of geometry to PostGIS through GeoDjango?

I was following a tutorial to ingest shapefiles into GeoDjango & PostGIS and I encountered an error in the LayerMapping ingestion step when trying to ingest a shapefile with linear referencing.
The shapefile has a field type of MultiLineStringZM, and since it does not exist, I tried to use a MultiLineStringField(dim=4) instead since it simply is a MultiLineString with 4 dimensions, outputting this error:

>>> load.run()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/git/web-gis/linear_referencing/backend_django/django_gis/django_gis/roadnetwork/load.py", line 30, in run
    lm = LayerMapping(RoadNetwork, roadnetwork_shp, roadnetwork_mapping, transform=False)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ken/.cache/pypoetry/virtualenvs/django-gis-a4oOe18h-py3.11/lib/python3.11/site-packages/django/contrib/gis/utils/layermapping.py", line 132, in __init__
    self.check_layer()
  File "/home/ken/.cache/pypoetry/virtualenvs/django-gis-a4oOe18h-py3.11/lib/python3.11/site-packages/django/contrib/gis/utils/layermapping.py", line 259, in check_layer
    raise LayerMapError(
django.contrib.gis.utils.layermapping.LayerMapError: Invalid mapping geometry; model has MultiLineStringField, layer geometry type is LineStringZM.

Should I create a custom field and save function for this, then process the LineStringZM field there? Is there any documentation, code snippet or GitHub repo I can use as a reference for this endeavor?

PostGIS supports geometry(LINESTRINGZM) according to this: Chapter 4. Data Management

And LineStringZM / MultiLineStringZM is listed in geomtypes here: django/django/contrib/gis/gdal/geomtype.py at stable/5.1.x · django/django · GitHub

But I currently have no idea how to utilize this from a Django model field.

Unfortunately, I would say that Django currently doesn’t support the M dimension of geometries.

See #36036 (Support the 4th dimension (M) in the GEOS API) – Django, which is the ticket to follow regarding this feature. Still since 5.1 Django has partial support for the M dimension, but only in its gdal API, not yet in the geos API which is a hard requirement as soon as you want to put/get geometries to/from databases.

Hi, thank you for linking the pull request. I was able to figure out how to use it and be able to save/read 4-dimension geometry into a PostGIS backend. For now that is all I need.

I will be eagerly waiting for when this feature is officially released. Thank you very much!