equal
deleted
inserted
replaced
204 ------------------ |
204 ------------------ |
205 |
205 |
206 Reminder |
206 Reminder |
207 ~~~~~~~~ |
207 ~~~~~~~~ |
208 |
208 |
209 You should never use the `entity.foo = 42` notation to update an |
209 You should never use the `entity.foo = 42` notation to update an entity. It will |
210 entity. It will not do what you expect (updating the |
210 not do what you expect (updating the database). Instead, use the |
211 database). Instead, use the :meth:`set_attributes` and |
211 :meth:`~cubicweb.entity.Entity.cw_set` method or direct access to entity's |
212 :meth:`set_relations` methods. |
212 :attr:`cw_edited` attribute if you're writing a hook for 'before_add_entity' or |
|
213 'before_update_entity' event. |
213 |
214 |
214 |
215 |
215 How to choose between a before and an after event ? |
216 How to choose between a before and an after event ? |
216 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
217 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
217 |
218 |