====
post
====

.. py:method:: post(self)

**domain**: server

**language**: python

**class** :doc:`Item class </refs/server/item_api>`

Description
===========

Writes a modified record to the item dataset. Call post to save changes made to 
a record after :doc:`append <m_append>`, :doc:`insert <m_insert>` or 
:doc:`edit <m_edit>` method was called. 

The ``post`` method

* checks if an item is in edit or insert 
  :doc:`state <at_item_state>`
  , otherwise raises exception

* triggers the ``on_before_post`` event handler if one is defined for the item

* checks if a record is valid, if not raises exception

* If an item has 
  :doc:`details </programming/data/details>`
  , post current record in details

* add changes to an item change log

* puts the item into browse 
  :doc:`state <at_item_state>`

* triggers the ``on_after_post`` event handler if one is defined for the item.

See also
========

:doc:`Modifying datasets </programming/data/modifying_datasets>`

