'Saves the contents from the OGR DataSource Layer into the database
according to the mapping dictionary given at initialization.
Keyword Parameters:
verbose:
If set, information will be printed subsequent to each model save
executed on the database.
fid_range:
May be set with a slice or tuple of (begin, end) feature ID\'s to map
from the data source.  In other words, this keyword enables the user
to selectively import a subset range of features in the geographic
data source.
step:
If set with an integer, transactions will occur at every step
interval. For example, if step=1000, a commit would occur after
the 1,000th feature, the 2,000th feature etc.
progress:
When this keyword is set, status information will be printed giving
the number of features processed and sucessfully saved.  By default,
progress information will pe printed every 1000 features processed,
however, this default may be overridden by setting this keyword with an
integer for the desired interval.
stream:
Status information will be written to this file handle.  Defaults to
using `sys.stdout`, but any object with a `write` method is supported.
silent:
By default, non-fatal error notifications are printed to stdout, but
this keyword may be set to disable these notifications.
strict:
Execution of the model mapping will cease upon the first error
encountered.  The default behavior is to attempt to continue.'

def save(self, verbose=False, fid_range=False, step=False, progress=False, silent=False, stream=sys.stdout, strict=False):

    default_range = self.check_fid_range(fid_range)
    if progress:
        if ((progress is True) or (not isinstance(progress, int))):
            progress_interval = 1000
        else:
            progress_interval = progress
    @self.transaction_decorator
    def _save(feat_range=default_range, num_feat=0, num_saved=0):
        if feat_range:
            layer_iter = self.layer[feat_range]
        else:
            layer_iter = self.layer
        for feat in layer_iter:
            num_feat += 1
            try:
                kwargs = self.feature_kwargs(feat)
            except LayerMapError as msg:
                if strict:
                    raise
                elif (not silent):
                    stream.write(('Ignoring    Feature    ID    %s    because:    %s\n' % (feat.fid, msg)))
            else:
                is_update = False
                if self.unique:
                    try:
                        u_kwargs = self.unique_kwargs(kwargs)
                        m = self.model.objects.using(self.using).get(**u_kwargs)
                        is_update = True
                        geom = getattr(m, self.geom_field).ogr
                        new = OGRGeometry(kwargs[self.geom_field])
                        for g in new:
                            geom.add(g)
                        setattr(m, self.geom_field, geom.wkt)
                    except ObjectDoesNotExist:
                        m = self.model(**kwargs)
                else:
                    m = self.model(**kwargs)
                try:
                    m.save(using=self.using)
                    num_saved += 1
                    if verbose:
                        stream.write(('%s:    %s\n' % (((is_update and 'Updated') or 'Saved'), m)))
                except SystemExit:
                    raise
                except Exception as msg:
                    if (self.transaction_mode == 'autocommit'):
                        transaction.rollback_unless_managed()
                    if strict:
                        if (not silent):
                            stream.write(('Failed    to    save    the    feature    (id:    %s)    into    the    model    with    the    keyword    arguments:\n' % feat.fid))
                            stream.write(('%s\n' % kwargs))
                        raise
                    elif (not silent):
                        stream.write(('Failed    to    save    %s:\n    %s\nContinuing\n' % (kwargs, msg)))
            if (progress and ((num_feat % progress_interval) == 0)):
                stream.write(('Processed    %d    features,    saved    %d    ...\n' % (num_feat, num_saved)))
        return (num_saved, num_feat)
    nfeat = self.layer.num_feat
    if (step and isinstance(step, int) and (step < nfeat)):
        if default_range:
            raise LayerMapError('The    `step`    keyword    may    not    be    used    in    conjunction    with    the    `fid_range`    keyword.')
        (beg, num_feat, num_saved) = (0, 0, 0)
        indices = range(step, nfeat, step)
        n_i = len(indices)
        for (i, end) in enumerate(indices):
            if ((i + 1) == n_i):
                step_slice = slice(beg, None)
            else:
                step_slice = slice(beg, end)
            try:
                (num_feat, num_saved) = _save(step_slice, num_feat, num_saved)
                beg = end
            except:
                stream.write(('%s\nFailed    to    save    slice:    %s\n' % (('=-' * 20), step_slice)))
                raise
    else:
        _save()
