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 132 of file models.py.

Constructor & Destructor Documentation

def models.RegExp.__init__ (   self,
  regexp 
)

Definition at line 136 of file models.py.

136  def __init__(self, regexp):
137  self._regexp = regexp
138 
def __init__(self, regexp)
Definition: models.py:136

Member Function Documentation

def models.RegExp.apply (   self)

Definition at line 142 of file models.py.

References models.RegExp.database_type.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), coreTools.RunOnData.__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__().

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

Definition at line 139 of file models.py.

References models.RegExp._regexp.

139  def get_regexp(self):
140  return self._regexp
141 
def get_regexp(self)
Definition: models.py:139

Member Data Documentation

models.RegExp._regexp
private

Definition at line 137 of file models.py.

Referenced by models.RegExp.get_regexp().

models.RegExp.database_type

Definition at line 146 of file models.py.

Referenced by models.RegExp.apply().