CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
 
def apply
 
def get_regexp
 

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.

135  def __init__(self, regexp):
136  self._regexp = regexp
def __init__
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__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

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

Definition at line 137 of file models.py.

References models.RegExp._regexp.

138  def get_regexp(self):
139  return self._regexp
def get_regexp
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().