MCPcopy Index your code
hub / github.com/ddserver/ddserver / validate_python

Method validate_python

ddserver/interface/validation.py:332–350  ·  view source on GitHub ↗
(self,
                      value,
                      state,
                      db)

Source from the content-addressed store, hash-verified

330
331 @require(db = 'ddserver.db:Database')
332 def validate_python(self,
333 value,
334 state,
335 db):
336 ValidSuffix.validate_python(self, value, state)
337
338 with db.cursor() as cur:
339 cur.execute('''
340 SELECT name
341 FROM suffixes
342 WHERE name = %(suffixname)s
343 ''', {'suffixname': value})
344 result = cur.fetchone()
345
346 if result != None:
347 raise formencode.Invalid(self.message('not_uniq',
348 value),
349 value,
350 state)
351

Callers

nothing calls this directly

Calls 2

cursorMethod · 0.80
validate_pythonMethod · 0.45

Tested by

no test coverage detected