Exemplo n.º 1
0
    def __init__(self, dry_run):
        self.rules = get_rules()

        self.parents = set()
        self.children = set()
        self.snapshots = dict()
        self.context_cache = dict()
        self.dry_run = dry_run
Exemplo n.º 2
0
  def __init__(self, dry_run):
    self.rules = get_rules()

    self.parents = set()
    self.children = set()
    self.snapshots = dict()
    self.context_cache = dict()
    self.dry_run = dry_run
Exemplo n.º 3
0
def register_snapshot_listeners():
  """Attach listeners to various models"""

  rules = get_rules()

  # Initialize listening on parent objects
  for type_ in rules.rules.keys():
    model = getattr(models.all_models, type_)
    Resource.model_posted_after_commit.connect(create_all, model, weak=False)
    Resource.model_put_after_commit.connect(upsert_all, model, weak=False)
Exemplo n.º 4
0
def register_snapshot_listeners():
  """Attaches listeners to various models."""

  rules = get_rules()

  # Initialize listening on parent objects
  for model_cls in rules.rules.iterkeys():
    model = getattr(models.all_models, model_cls)
    signals.Restful.model_posted_after_commit.connect(
        create_all, model, weak=False)
    signals.Restful.model_put_after_commit.connect(
        upsert_all, model, weak=False)
Exemplo n.º 5
0
def register_snapshot_listeners():
    """Attach listeners to various models"""

    rules = get_rules()

    # Initialize listening on parent objects
    for type_ in rules.rules.keys():
        model = getattr(models.all_models, type_)
        Resource.model_posted_after_commit.connect(create_all,
                                                   model,
                                                   weak=False)
        Resource.model_put_after_commit.connect(upsert_all, model, weak=False)
Exemplo n.º 6
0
def register_snapshot_listeners():
  """Attaches listeners to various models."""

  rules = get_rules()

  # Initialize listening on parent objects
  for model_cls in rules.rules.iterkeys():
    model = getattr(models.all_models, model_cls)
    signals.Restful.model_posted_after_commit.connect(
        create_all, model, weak=False)
    signals.Restful.model_put_after_commit.connect(
        upsert_all, model, weak=False)

  signals.Restful.model_posted_after_commit.connect(
      _copy_snapshot_relationships, models.Snapshot)