code: def write_csv(self, file, *attributes, **options):
          
          with open(file, 'w', newline='') as file_handle:
              fieldnames = self._get_fieldnames(*attributes, **options)
              writer = csv.DictWriter(file_handle, fieldnames)
              writer.writeheader()
              for row in self.to_csv(*attributes, **options):
                  writer.writerow(row)
docs: Writes the field *path* and the selected field *attributes* for each
          :class:`Field` *nested* in the `Container` to  a ``.csv`` *file*.
  
          :param str file: name and location of the ``.csv`` *file*.
          :param str attributes: selected :class:`Field` attributes.
              Fallback is the field :attr:`~Field.value`.
          :keyword str name: name of the `Container`.
              Default is the class name of the instance.
          :keyword tuple fieldnames: sequence of dictionary keys for the field *path*
              and the selected field *attributes*.
              Defaults to ``('id', *attributes)``.
          :keyword bool nested: if ``True`` all :class:`Pointer` fields in the
              `Container` lists their referenced :attr:`~Pointer.data` object
              field attributes as well (chained method call).