From 1fc6c6422fbcc94e74b638e74cc7a38a1c2fdaff Mon Sep 17 00:00:00 2001 From: timmartin19 Date: Mon, 20 Oct 2014 11:47:03 -0400 Subject: [PATCH] Included code sample in docs for iff --- docs/topics/models.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/topics/models.rst b/docs/topics/models.rst index 567e8237..bd50d95c 100644 --- a/docs/topics/models.rst +++ b/docs/topics/models.rst @@ -215,6 +215,13 @@ Model Methods If the insertion isn't applied, a LWTException is raised + .. code-block:: + t = TestTransactionModel(text='some text', count=5) + try: + t.iff(count=5).update('other text') + except LWTException as e: + # handle failure + .. method:: update(**values) Performs an update on the model instance. You can pass in values to set on the model