Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)

src/k/n/kninfra-HEAD/kn/leden/views.py   kninfra(Download)
def _group_detail(request, group):
    ctx = _entity_detail(request, group)
    isFreeToJoin = group.has_tag(Es.id_by_name('!free-to-join', True))
    rel_id = None
    if isFreeToJoin:
            logging.info("Added user %s" % nm)
            u.save()
            Es.add_relation(u, Es.id_by_name('leden',
                            use_cache=True),
                    _from=date_to_dt(fd['dateJoined']))
            for l in fd['addToList']:
                Es.add_relation(u, Es.id_by_name(l, use_cache=True),

src/k/n/kninfra-HEAD/utils/shell.py   kninfra(Download)
def qrel(who=-1, _with=-1, how=-1, _from=None, until=None):
    """ Queries relations """
    if who not in (None, -1):
        who = Es.id_by_name(who)
    if _with not in (None, -1):
        _with = Es.id_by_name(_with)
def del_rel(who, _with, how):
    """ Removes a relation given by names.
 
    For instance: del_rel('giedo', 'leden', None) """
    who = Es.id_by_name(who)
    _with = Es.id_by_name(_with)
    For instance: add_rel('giedo', 'bestuur', 'voorzitter', '2004-09-01',
                '2006-09-01') """
    who = Es.id_by_name(who)
    _with = Es.id_by_name(_with)
    how = Es.ecol.find_one({'sofa_suffix': how})['_id'] \

src/k/n/kninfra-HEAD/utils/one-shot/2012-04-27-correct-ledenStartDate.py   kninfra(Download)
def main():
    year_overrides = dict()
    had = set()
    for t in Es.bearers_by_tag_id(Es.id_by_name('!year-overrides'), _as=Es.Tag):
        year_overrides[(t._data['year-override']['type'],
                        t._data['year-override']['year'])] = t._data['_id']
    for rel in sorted(Es.query_relations(-1, Es.id_by_name('leden'), None,

src/k/n/kninfra-HEAD/utils/one-shot/2012-08-26-year-overrides.py   kninfra(Download)
def main():
    # Fetch year overrides
    print 'loading year overrides ...'
    year_overrides = {}
    for t in Es.bearers_by_tag_id(Es.id_by_name('!year-overrides'), _as=Es.Tag):
    years = [t[1] for t in year_overrides.keys()]
    min_year, max_year = min(years), max(years)
    leden_id = Es.id_by_name('leden')
    print 'checking ...'
    for year in xrange(min_year+1, max_year+1):