CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
models.RegExp Class Reference
Inheritance diagram for models.RegExp:

Public Member Functions

def __init__ (self, regexp)
 
def apply (self)
 
def get_regexp (self)
 

Public Attributes

 database_type
 

Private Attributes

 _regexp
 

Detailed Description

Used to tell proxy methods that a regular expression should be used to query the column.

Definition at line 130 of file models.py.

Constructor & Destructor Documentation

def models.RegExp.__init__ (   self,
  regexp 
)

Definition at line 134 of file models.py.

134  def __init__(self, regexp):
135  self._regexp = regexp
136 
def __init__(self, regexp)
Definition: models.py:134

Member Function Documentation

def models.RegExp.apply (   self)

Definition at line 140 of file models.py.

References models.RegExp.database_type.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

140  def apply(self):
141  # uses code from conddb tool
142  if self.database_type in ["oracle", "frontier"]:
143  return sqlalchemy.func.regexp_like(field, regexp)
144  elif self.database_type == "sqlite":
145  # Relies on being a SingletonThreadPool
146  self.connection_object.engine.pool.connect().create_function('regexp', 2, lambda data, regexp: re.search(regexp, data) is not None)
147 
148  return sqlalchemy.func.regexp(field, regexp)
149  else:
150  raise NotImplemented("Can only apply regular expression search to Oracle, Frontier and SQLite.")
151 
def apply(self)
Definition: models.py:140
def models.RegExp.get_regexp (   self)

Definition at line 137 of file models.py.

References models.RegExp._regexp.

137  def get_regexp(self):
138  return self._regexp
139 
def get_regexp(self)
Definition: models.py:137

Member Data Documentation

models.RegExp._regexp
private

Definition at line 135 of file models.py.

Referenced by models.RegExp.get_regexp().

models.RegExp.database_type

Definition at line 144 of file models.py.

Referenced by models.RegExp.apply().