lafrech: LGTM. Thanks.

While investigating #1357, I realized there are not tests to check that `_bind_to_schema` is called on inner from all container fields.

Adding those tests as I proposed in https://github.com/marshmallow-code/marshmallow/issues/1357#issuecomment-523493231 can be done later on. No need to block this.
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 661f0288..3755e8b3 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,14 @@
 Changelog
 ---------
 
+3.0.1 (unreleased)
+++++++++++++++++++
+
+Bug fixes:
+
+- Fix bug when nesting ``fields.DateTime`` within ``fields.List()`` or ``fields.Tuple`` (:issue:`1357`).
+  This bug was introduced in 3.0.0rc9. Thanks :user:`zblz` for reporting.
+
 3.0.0 (2019-08-18)
 ++++++++++++++++++
 
diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index 0b18e7dd..55e36e26 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -1114,7 +1114,7 @@ class DateTime(Field):
         super()._bind_to_schema(field_name, schema)
         self.format = (
             self.format
-            or getattr(schema.opts, self.SCHEMA_OPTS_VAR_NAME)
+            or getattr(self.root.opts, self.SCHEMA_OPTS_VAR_NAME)
             or self.DEFAULT_FORMAT
         )
 

3.0: DateTime fields cannot be used as inner field for List or Tuple fields
Between releases 3.0.0rc8 and 3.0.0rc9, `DateTime` fields have started throwing an error when being instantiated as inner fields of container fields like `List` or `Tuple`. The snippet below works in <=3.0.0rc8 and throws the error below in >=3.0.0rc9 (and, worryingly, 3.0.0):

```python
from marshmallow import fields, Schema

class MySchema(Schema):
    times = fields.List(fields.DateTime())

s = MySchema()
```

Traceback:
```
Traceback (most recent call last):
  File "test-mm.py", line 8, in <module>
    s = MySchema()
  File "/Users/victor/.pyenv/versions/marshmallow/lib/python3.6/site-packages/marshmallow/schema.py", line 383, in __init__
    self.fields = self._init_fields()
  File "/Users/victor/.pyenv/versions/marshmallow/lib/python3.6/site-packages/marshmallow/schema.py", line 913, in _init_fields
    self._bind_field(field_name, field_obj)
  File "/Users/victor/.pyenv/versions/marshmallow/lib/python3.6/site-packages/marshmallow/schema.py", line 969, in _bind_field
    field_obj._bind_to_schema(field_name, self)
  File "/Users/victor/.pyenv/versions/marshmallow/lib/python3.6/site-packages/marshmallow/fields.py", line 636, in _bind_to_schema
    self.inner._bind_to_schema(field_name, self)
  File "/Users/victor/.pyenv/versions/marshmallow/lib/python3.6/site-packages/marshmallow/fields.py", line 1117, in _bind_to_schema
    or getattr(schema.opts, self.SCHEMA_OPTS_VAR_NAME)
AttributeError: 'List' object has no attribute 'opts'
```

It seems like it's treating the parent field as a Schema without checking that it is indeed a schema, so the `schema.opts` statement fails as fields don't have an `opts` attribute.
diff --git a/tests/test_fields.py b/tests/test_fields.py
index b0a5a777..f79a54ca 100644
--- a/tests/test_fields.py
+++ b/tests/test_fields.py
@@ -169,6 +169,20 @@ class TestParentAndName:
         assert schema2.fields["foo"].key_field.root == schema2
         assert schema2.fields["foo"].value_field.root == schema2
 
+    # Regression test for https://github.com/marshmallow-code/marshmallow/issues/1357
+    def test_datetime_list_inner_format(self, schema):
+        class MySchema(Schema):
+            foo = fields.List(fields.DateTime())
+            bar = fields.Tuple((fields.DateTime(),))
+
+            class Meta:
+                datetimeformat = "iso8601"
+                dateformat = "iso8601"
+
+        schema = MySchema()
+        assert schema.fields["foo"].inner.format == "iso8601"
+        assert schema.fields["bar"].tuple_fields[0].format == "iso8601"
+
 
 class TestMetadata:
     @pytest.mark.parametrize("FieldClass", ALL_FIELDS)

pip install -e .[dev]
parse_log_pytest
requirements.txt
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aspy.yaml==1.3.0
attrs==24.2.0
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
cfgv==3.3.1
chardet==5.2.0
colorama==0.4.6
distlib==0.3.9
entrypoints==0.3
exceptiongroup==1.2.2
filelock==3.12.2
flake8==3.7.8
flake8-bugbear==19.8.0
identify==2.5.24
importlib-metadata==6.7.0
iniconfig==2.0.0
-e git+https://github.com/marshmallow-code/marshmallow.git@b40a0f4e33823e6d0f341f7e8684e359a99060d1#egg=marshmallow
mccabe==0.6.1
nodeenv==1.9.1
packaging==24.0
platformdirs==4.0.0
pluggy==1.2.0
pre-commit==1.21.0
pycodestyle==2.5.0
pyflakes==2.1.1
pyproject-api==1.5.3
pytest==7.4.4
pytz==2025.2
PyYAML==6.0.1
simplejson==3.20.1
six==1.17.0
toml==0.10.2
tomli==2.0.1
tox==4.8.0
typing_extensions==4.7.1
virtualenv==20.26.6
zipp==3.15.0

name: marshmallow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aspy-yaml==1.3.0
      - attrs==24.2.0
      - cachetools==5.5.2
      - cfgv==3.3.1
      - chardet==5.2.0
      - colorama==0.4.6
      - distlib==0.3.9
      - entrypoints==0.3
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - flake8==3.7.8
      - flake8-bugbear==19.8.0
      - identify==2.5.24
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - marshmallow==3.0.0
      - mccabe==0.6.1
      - nodeenv==1.9.1
      - packaging==24.0
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pre-commit==1.21.0
      - pycodestyle==2.5.0
      - pyflakes==2.1.1
      - pyproject-api==1.5.3
      - pytest==7.4.4
      - pytz==2025.2
      - pyyaml==6.0.1
      - simplejson==3.20.1
      - six==1.17.0
      - toml==0.10.2
      - tomli==2.0.1
      - tox==4.8.0
      - typing-extensions==4.7.1
      - virtualenv==20.26.6
      - zipp==3.15.0
prefix: /opt/conda/envs/marshmallow

tests/test_fields.py::TestParentAndName::test_datetime_list_inner_format
tests/test_fields.py::test_field_aliases[Integer-Integer] tests/test_fields.py::test_field_aliases[String-String] tests/test_fields.py::test_field_aliases[Boolean-Boolean] tests/test_fields.py::test_field_aliases[Url-Url] tests/test_fields.py::TestField::test_repr tests/test_fields.py::TestField::test_error_raised_if_uncallable_validator_passed tests/test_fields.py::TestField::test_error_raised_if_missing_is_set_on_required_field tests/test_fields.py::TestField::test_custom_field_receives_attr_and_obj tests/test_fields.py::TestField::test_custom_field_receives_data_key_if_set tests/test_fields.py::TestField::test_custom_field_follows_data_key_if_set tests/test_fields.py::TestParentAndName::test_simple_field_parent_and_name tests/test_fields.py::TestParentAndName::test_unbound_field_root_returns_none tests/test_fields.py::TestParentAndName::test_list_field_inner_parent_and_name tests/test_fields.py::TestParentAndName::test_tuple_field_inner_parent_and_name tests/test_fields.py::TestParentAndName::test_mapping_field_inner_parent_and_name tests/test_fields.py::TestParentAndName::test_simple_field_root tests/test_fields.py::TestParentAndName::test_list_field_inner_root tests/test_fields.py::TestParentAndName::test_tuple_field_inner_root tests/test_fields.py::TestParentAndName::test_list_root_inheritance tests/test_fields.py::TestParentAndName::test_dict_root_inheritance tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[String] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Integer] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Boolean] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Float] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Number] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[DateTime] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Time] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Date] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[TimeDelta] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Dict] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Url] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Email] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[UUID] tests/test_fields.py::TestMetadata::test_extra_metadata_may_be_added_to_field[Decimal] tests/test_fields.py::TestErrorMessages::test_default_error_messages_get_merged_with_parent_error_messages_cstm_msg tests/test_fields.py::TestErrorMessages::test_default_error_messages_get_merged_with_parent_error_messages tests/test_fields.py::TestErrorMessages::test_make_error[required-Missing tests/test_fields.py::TestErrorMessages::test_make_error[null-Field tests/test_fields.py::TestErrorMessages::test_make_error[custom-Custom tests/test_fields.py::TestErrorMessages::test_make_error[validator_failed-Invalid tests/test_fields.py::TestErrorMessages::test_fail[required-Missing tests/test_fields.py::TestErrorMessages::test_fail[null-Field tests/test_fields.py::TestErrorMessages::test_fail[custom-Custom tests/test_fields.py::TestErrorMessages::test_fail[validator_failed-Invalid tests/test_fields.py::TestErrorMessages::test_make_error_key_doesnt_exist tests/test_fields.py::TestNestedField::test_nested_only_and_exclude_as_string[only] tests/test_fields.py::TestNestedField::test_nested_only_and_exclude_as_string[exclude] tests/test_fields.py::TestNestedField::test_nested_unknown_override[None-exclude] tests/test_fields.py::TestNestedField::test_nested_unknown_override[None-include] tests/test_fields.py::TestNestedField::test_nested_unknown_override[None-raise] tests/test_fields.py::TestNestedField::test_nested_unknown_override[exclude-exclude] tests/test_fields.py::TestNestedField::test_nested_unknown_override[exclude-include] tests/test_fields.py::TestNestedField::test_nested_unknown_override[exclude-raise] tests/test_fields.py::TestNestedField::test_nested_unknown_override[include-exclude] tests/test_fields.py::TestNestedField::test_nested_unknown_override[include-include] tests/test_fields.py::TestNestedField::test_nested_unknown_override[include-raise] tests/test_fields.py::TestNestedField::test_nested_unknown_override[raise-exclude] tests/test_fields.py::TestNestedField::test_nested_unknown_override[raise-include] tests/test_fields.py::TestNestedField::test_nested_unknown_override[raise-raise] tests/test_fields.py::TestListNested::test_list_nested_only_exclude_dump_only_load_only_propagated_to_nested[only] tests/test_fields.py::TestListNested::test_list_nested_only_exclude_dump_only_load_only_propagated_to_nested[exclude] tests/test_fields.py::TestListNested::test_list_nested_only_exclude_dump_only_load_only_propagated_to_nested[dump_only] tests/test_fields.py::TestListNested::test_list_nested_only_exclude_dump_only_load_only_propagated_to_nested[load_only] tests/test_fields.py::TestListNested::test_list_nested_only_and_exclude_merged_with_nested[only-expected0] tests/test_fields.py::TestListNested::test_list_nested_only_and_exclude_merged_with_nested[exclude-expected1] tests/test_fields.py::TestListNested::test_list_nested_partial_propagated_to_nested tests/test_fields.py::TestTupleNested::test_tuple_nested_only_exclude_dump_only_load_only_propagated_to_nested[dump_only] tests/test_fields.py::TestTupleNested::test_tuple_nested_only_exclude_dump_only_load_only_propagated_to_nested[load_only] tests/test_fields.py::TestTupleNested::test_tuple_nested_partial_propagated_to_nested tests/test_fields.py::TestDictNested::test_dict_nested_only_exclude_dump_only_load_only_propagated_to_nested[only] tests/test_fields.py::TestDictNested::test_dict_nested_only_exclude_dump_only_load_only_propagated_to_nested[exclude] tests/test_fields.py::TestDictNested::test_dict_nested_only_exclude_dump_only_load_only_propagated_to_nested[dump_only] tests/test_fields.py::TestDictNested::test_dict_nested_only_exclude_dump_only_load_only_propagated_to_nested[load_only] tests/test_fields.py::TestDictNested::test_dict_nested_only_and_exclude_merged_with_nested[only-expected0] tests/test_fields.py::TestDictNested::test_dict_nested_only_and_exclude_merged_with_nested[exclude-expected1] tests/test_fields.py::TestDictNested::test_dict_nested_partial_propagated_to_nested
CHANGELOG.rst src/marshmallow/fields.py
CHANGELOG.rst src/marshmallow/fields.py