@@ -276,16 +276,20 @@ def external(self):
276
276
277
277
def update1 (self , row ):
278
278
"""
279
- update1 updates one existing entry in the table.
280
- Caution: In DataJoint the primary modes for data manipulation is to ``insert`` and ``delete``
281
- entire records since referential integrity works on the level of records, not fields.
282
- Therefore, updates are reserved for corrective operations outside of main workflow.
283
- Use UPDATE methods sparingly with full awareness of potential violations of assumptions.
279
+ ``update1`` updates one existing entry in the table.
280
+ Caution: In DataJoint the primary modes for data manipulation is to ``insert`` and
281
+ ``delete`` entire records since referential integrity works on the level of records,
282
+ not fields. Therefore, updates are reserved for corrective operations outside of main
283
+ workflow. Use UPDATE methods sparingly with full awareness of potential violations of
284
+ assumptions.
284
285
285
286
:param row: a ``dict`` containing the primary key values and the attributes to update.
286
- Setting an attribute value to None will reset it to the default value (if any)
287
+ Setting an attribute value to None will reset it to the default value (if any).
288
+
287
289
The primary key attributes must always be provided.
290
+
288
291
Examples:
292
+
289
293
>>> table.update1({'id': 1, 'value': 3}) # update value in record with id=1
290
294
>>> table.update1({'id': 1, 'value': None}) # reset value to default
291
295
"""
@@ -326,7 +330,7 @@ def insert1(self, row, **kwargs):
326
330
Insert one data record into the table. For ``kwargs``, see ``insert()``.
327
331
328
332
:param row: a numpy record, a dict-like object, or an ordered sequence to be inserted
329
- as one row.
333
+ as one row.
330
334
"""
331
335
self .insert ((row ,), ** kwargs )
332
336
@@ -339,16 +343,18 @@ def insert(
339
343
allow_direct_insert = None ,
340
344
):
341
345
"""
342
- Insert a collection of rows.
343
-
344
- :param rows: An iterable where an element is a numpy record, a dict-like object, a pandas.DataFrame, a sequence,
345
- or a query expression with the same heading as self.
346
- :param replace: If True, replaces the existing tuple.
347
- :param skip_duplicates: If True, silently skip duplicate inserts.
348
- :param ignore_extra_fields: If False, fields that are not in the heading raise error.
349
- :param allow_direct_insert: applies only in auto-populated tables.
350
- If False (default), insert are allowed only from inside the make callback.
351
- Example::
346
+ Insert a collection of rows.
347
+
348
+ :param rows: An iterable where an element is a numpy record, a dict-like object, a
349
+ pandas.DataFrame, a sequence, or a query expression with the same heading as self.
350
+ :param replace: If True, replaces the existing tuple.
351
+ :param skip_duplicates: If True, silently skip duplicate inserts.
352
+ :param ignore_extra_fields: If False, fields that are not in the heading raise error.
353
+ :param allow_direct_insert: applies only in auto-populated tables. If False (default),
354
+ insert are allowed only from inside the make callback.
355
+
356
+ Example:
357
+
352
358
>>> relation.insert([
353
359
>>> dict(subject_id=7, species="mouse", date_of_birth="2014-09-01"),
354
360
>>> dict(subject_id=8, species="mouse", date_of_birth="2014-09-02")])
0 commit comments