MCPcopy Create free account
hub / github.com/Tencent/CodeAnalysis / save

Method save

server/projects/analysis/apps/base/basemodel.py:166–181  ·  view source on GitHub ↗

Save this instance. Records modified timestamp and user, and raises ConcurrencyError if an out-of-date version is being saved.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

164 objects = MTManager(show_deleted=False)
165
166 def save(self, *args, **kwargs):
167 """
168 Save this instance.
169 Records modified timestamp and user, and raises ConcurrencyError if an
170 out-of-date version is being saved.
171 """
172 if not kwargs.pop("notrack", False):
173 user = kwargs.pop("user", None)
174 now = utcnow()
175 if self.pk is None and user is not None:
176 self.creator = user
177 # .create() won't pass in user, but presets modifier
178 if not (self.pk is None and self.modifier is not None):
179 self.modifier = user
180 self.modified_time = now
181 return super(CDBaseModel, self).save(*args, **kwargs)
182
183 def clone(self, cascade=None, overrides=None, user=None):
184 """

Callers 15

cloneMethod · 0.45
handleMethod · 0.45
update_issue_authorMethod · 0.45
update_issue_severityMethod · 0.45
update_issue_authorMethod · 0.45
update_issue_statusMethod · 0.45
update_issue_ownerMethod · 0.45
update_issue_stateMethod · 0.45
add_codecount_fileMethod · 0.45

Calls 1

utcnowFunction · 0.70

Tested by

no test coverage detected