Added docs for has_changes

This commit is contained in:
Konsta Vesterinen
2013-10-30 14:47:52 +02:00
parent 7cfa87547f
commit 4a5d3554ff

View File

@@ -182,6 +182,22 @@ def has_changes(obj, attr):
Simple shortcut function for checking if given attribute of given Simple shortcut function for checking if given attribute of given
declarative model object has changed during the transaction. declarative model object has changed during the transaction.
::
from sqlalchemy_utils import has_changes
user = User()
has_changes(user, 'name') # False
user.name = u'someone'
has_changes(user, 'name') # True
:param obj: SQLAlchemy declarative model object :param obj: SQLAlchemy declarative model object
:param attr: Name of the attribute :param attr: Name of the attribute
""" """