pymensago/userinfo.py
def save_name(db: sqlite3.Connection, name: Name) -> RetVal:
	'''Saves the name passed into the database. Note that all name-related fields will be 
	synchronized with the values in the object passed, so empty name fields will be deleted and 
	missing name fields will be added. Thus all name information will be deleted if this function 
	is passed an empty Name object. Note that this call does not affect the Nicknames field.'''

	single_fields = {
		'GivenName' : name.given,
		'FamilyName' : name.family,
		'Prefix' : name.prefix,
		'FormattedName': name.formatted
	}
	for fieldname, fieldvalue in single_fields.items():
		status = delete_user_field(db, fieldname)
		if status.error():
			return status
		
		if fieldvalue:
			status = save_user_field(db, fieldname, fieldvalue)
			if status.error():
				return status
	
	list_fields = {
		'Suffixes' : name.suffixes,
		'AdditionalNames' : name.additional
	}
	for fieldname, fieldvalue in list_fields.items():
		status = delete_user_list_field(db, fieldname)
		if status.error():
			return status

		if fieldvalue:
			status = save_user_list_field(db, fieldname, fieldvalue)
			if status.error():
				return status
Saves the name passed into the database. Note that all name-related fields will be 
	synchronized with the values in the object passed, so empty name fields will be deleted and 
	missing name fields will be added. Thus all name information will be deleted if this function 
	is passed an empty Name object. Note that this call does not affect the Nicknames field.
Saves the name passed into the database. Note that all name-related fields will be
synchronized with the values in the object passed, so empty name fields will be deleted and
missing name fields will be added. Thus all name information will be deleted if this function
is passed an empty Name object. Note that this call does not affect the Nicknames field.
Saves the name passed into the database . Note that all name - related fields will be synchronized with the values in the object passed so empty name fields will be deleted and missing name fields will be added . Thus all name information will be deleted if this function is passed an empty Name object . Note that this call does not affect the Nicknames field .
def save_name(db: sqlite3.Connection, name: Name) -> RetVal:
	single_fields = {
		'GivenName' : name.given,
		'FamilyName' : name.family,
		'Prefix' : name.prefix,
		'FormattedName': name.formatted
	}
	for fieldname, fieldvalue in single_fields.items():
		status = delete_user_field(db, fieldname)
		if status.error():
			return status
		if fieldvalue:
			status = save_user_field(db, fieldname, fieldvalue)
			if status.error():
				return status
	list_fields = {
		'Suffixes' : name.suffixes,
		'AdditionalNames' : name.additional
	}
	for fieldname, fieldvalue in list_fields.items():
		status = delete_user_list_field(db, fieldname)
		if status.error():
			return status
		if fieldvalue:
			status = save_user_list_field(db, fieldname, fieldvalue)
			if status.error():
				return status
def save_name ( db : sqlite3 . Connection , name : Name ) -> RetVal : single_fields = { 'GivenName' : name . given , 'FamilyName' : name . family , 'Prefix' : name . prefix , 'FormattedName' : name . formatted } for fieldname , fieldvalue in single_fields . items ( ) : status = delete_user_field ( db , fieldname ) if status . error ( ) : return status if fieldvalue : status = save_user_field ( db , fieldname , fieldvalue ) if status . error ( ) : return status list_fields = { 'Suffixes' : name . suffixes , 'AdditionalNames' : name . additional } for fieldname , fieldvalue in list_fields . items ( ) : status = delete_user_list_field ( db , fieldname ) if status . error ( ) : return status if fieldvalue : status = save_user_list_field ( db , fieldname , fieldvalue ) if status . error ( ) : return status
Saves the name passed into the database.
Saves the name passed into the database .
'''Saves the name passed into the database. Note that all name-related fields will be 
	synchronized with the values in the object passed, so empty name fields will be deleted and 
	missing name fields will be added. Thus all name information will be deleted if this function 
	is passed an empty Name object. Note that this call does not affect the Nicknames field.'''
db
sqlite3.Connection
name
Name