﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18368	LayerMapping.save() should be able to set attributes on created model instances	geoffhing@…	nobody	"As far as I can tell, {{{LayerMapping}}} only allows populating a spatial model's attributes from the vector file.  I recently had a use case where I needed to set other attributes of the model instances based on information not in the vector file.

I propose allowing an additional argument to {{{LayerMapping.save()}}} that is a dictionary of initial field values that will be passed to the constructor of the spatial model.

That is, changing the method signature to be:

{{{
    def save(self, verbose=False, fid_range=False, step=False,
             progress=False, silent=False, stream=sys.stdout, strict=False,
             model_kwargs=None):

}}}

and then inside {{{save()}}} around line 523, updating the keyword arguments passed to the model constructor:

{{{
                    # Add additional keyword arguments
                    if model_kwargs:
                        kwargs.update(model_kwargs)

}}}"	New feature	closed	GIS	1.4	Normal	wontfix			Unreviewed	0	0	0	0	0	0
