Пример #1
0
def _insert_with_id(event):
    abbr = event[event['level']]
    id = next_big_id(abbr, 'E', 'event_ids')
    logging.info("Saving as %s" % id)

    event['_id'] = id
    db.events.save(event, safe=True)

    return id
Пример #2
0
def _insert_with_id(event):
    abbr = event[settings.LEVEL_FIELD]
    id = next_big_id(abbr, 'E', 'event_ids')
    logger.info("Saving as %s" % id)

    event['_id'] = id
    db.events.save(event, safe=True)

    return id
Пример #3
0
def _insert_with_id(event):
    abbr = event[settings.LEVEL_FIELD]
    id = next_big_id(abbr, "E", "event_ids")
    logger.info("Saving as %s" % id)

    event["_id"] = id
    db.events.save(event, safe=True)

    return id
Пример #4
0
def _insert_with_id(event):
    abbr = event[event['level']]
    id = next_big_id(abbr, 'E', 'event_ids')
    logging.info("Saving as %s" % id)

    event['_id'] = id
    db.events.save(event, safe=True)

    return id
Пример #5
0
def _insert_with_id(event):
    abbr = event[settings.LEVEL_FIELD]
    _id = next_big_id(abbr, 'E', 'event_ids')
    logger.info("Saving as %s" % _id)

    event['_id'] = _id
    db.events.save(event, safe=True)

    return _id
Пример #6
0
def test_next_big_id():
    db.test_ids.drop()
    db.vote_ids.drop()
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000001'
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000002'
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000003'
    assert utils.next_big_id('xy', 'V', 'vote_ids') == 'XYV00000001'
    db.test_ids.drop()
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000001'
    assert utils.next_big_id('xy', 'V', 'vote_ids') == 'XYV00000002'
Пример #7
0
def test_next_big_id():
    db.test_ids.drop()
    db.vote_ids.drop()
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000001'
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000002'
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000003'
    assert utils.next_big_id('xy', 'V', 'vote_ids') == 'XYV00000001'
    db.test_ids.drop()
    assert utils.next_big_id('xy', 'D', 'test_ids') == 'XYD00000001'
    assert utils.next_big_id('xy', 'V', 'vote_ids') == 'XYV00000002'
Пример #8
0
 def _get_next_id(self):
     return next_big_id(self.abbr, self.id_letter, self.id_collection)
Пример #9
0
 def _get_next_id(self):
     return next_big_id(self.abbr, 'V', 'vote_ids')
Пример #10
0
 def _get_next_id(self):
     return next_big_id(self.abbr, self.id_letter, self.id_collection)
Пример #11
0
 def _get_next_id(self):
     return next_big_id(self.abbr, 'V', 'vote_ids')