'Get the default value for a field
@param field: the Field
@returns: the default value for the field'

def get_default(self, field, lookup=None):

    default = field.default
    if (default is not None):
        fieldtype = str(field.type)
        if (fieldtype[:9] == 'reference'):
            uuid = self.get_uuid(lookup, default)
            if uuid:
                self._references[lookup].add(default)
                default = uuid
            else:
                default = None
        elif (fieldtype in ('date', 'datetime', 'time')):
            default = None
        else:
            default = field.default
    return default
