Django field validation .md .md

Django field validation are enabled for models that inherit the ValidateFields class.

# pip install lamindb
lamin init --storage ./test-django-validation
Hide code cell output
 initialized lamindb: testuser1/test-django-validation
import lamindb as ln
from lamindb.core.exceptions import FieldValidationError
Hide code cell output
 connected lamindb: testuser1/test-django-validation
/tmp/ipykernel_3770/3280737977.py:2: DeprecationWarning: `lamindb.core.exceptions` is deprecated, use `lamindb.errors` instead.
  from lamindb.core.exceptions import FieldValidationError
try:
    ln.Reference(name="my ref", doi="abc.ef", url="myurl.com")
except FieldValidationError as e:
    print(e)
Hide code cell output
  url: myurl.com is not valid
    → Enter a valid URL.
  doi: abc.ef is not valid
    → Must be a DOI (e.g., 10.1000/xyz123 or https://doi.org/10.1000/xyz123)
  
lamin delete --force test-django-validation