Beispiel #1
0
def entry_list(template, query, **context):
    search = request.args.get('q')
    if search:
        query = query.filter(
            (Entry.body.contains(search)) |
            (Entry.title.contains(search)))
    return object_list(template, query, **context)
Beispiel #2
0
def entry_list(template, query, **context):
    search = request.args.get('q')
    if search:
        query = query.filter((Entry.body.contains(search))
                             | (Entry.title.contains(search)))

    return object_list(template, query, **context)
Beispiel #3
0
def entry_list(template, query, **context):
    app.logger.info("---> Hello")
    search = request.args.get('q')
    if search:
        query = query.filter((Entry.body.contains(search))
                             | (Entry.title.contains(search)))
    return object_list(template, query, **context)
Beispiel #4
0
def entry_list(template, query, **context):
    valid_statuses = (Entry.STATUS_DRAFT, Entry.STATUS_PUBLIC)
    query = query.filter(Entry.status.in_(valid_statuses))
    search = request.args.get('q')
    if search:
        query = query.filter((Entry.body.contains(search))
                             | (Entry.title.contains(search)))
    return object_list(template, query, **context)
Beispiel #5
0
def entry_list(template, query, **context):
    query = filter_status_by_user(query)
    valid_statuses = (Entry.STATUS_PUBLIC, Entry.STATUS_DRAFT)
    query = query.filter(Entry.status.in_(valid_statuses))
    if request.args.get('q'):
        search = request.args['q']
        query = query.filter((Entry.body.contains(search))
                             | (Entry.title.contains(search)))
    return object_list(template, query, **context)
def entry_list(template, query, **context):
    valid_statuses = (STATUS_DRAFT, STATUS_PUBLIC)
    # filter down to posts owned by this user and DRAFT and PUBLIC statuses first
    query = filter_status_by_user(query).filter(Entry.status.in_(valid_statuses))
    # if the GET request contains a 'q' variable, use that 'q' as the search term
    search = request.args.get('q')
    if search:
        query = query.filter(Entry.body.contains(search) | Entry.title.contains(search))
    return object_list(template, query, **context)
Beispiel #7
0
def entry_list(template, query, **context):
	query = filter_status_by_user(query)
	valid_statuses = (Entry.STATUS_PUBLIC, Entry.STATUS_DRAFT)
	query = query.filter(Entry.status.in_(valid_statuses))
	if request.args.get('q'):
		search = request.args['q']
		query = query.filter(
			(Entry.body.contains(search)) |
			(Entry.title.contains(search)))
	return object_list(template, query, **context)
Beispiel #8
0
def entry_list(template, query, **context):
    app.logger.info("---> Hello")
    valid_statuses = (Entry.STATUS_PUBLIC, Entry.STATUS_DRAFT)
    query = query.filter(Entry.status.in_(valid_statuses))

    if request.args.get('q'):
        search = request.args['q']
        query = query.filter(
            Entry.body.contains(search) | (Entry.title.contains(search)))

    return object_list(template, query, **context)
Beispiel #9
0
def customer_list(template, query, **context):
    """doc."""
    valid_statuses = (Customer.STATUS_PUBLIC, Customer.STATUS_DRAFT)
    query = query.filter(Customer.status.in_(valid_statuses))
    if request.args.get('q'):
        search = request.args['q']
        query = query.filter(
            (Customer.body.contains(search)) |
            (Customer.title.contains(search)))

    return object_list(template, query, **context)
Beispiel #10
0
def entry_list(template, query, **context):
    valid_statuses = (Entry.STATUS_PUBLIC, Entry.STATUS_DRAFT)
    query = query.filter(Entry.status.in_(valid_statuses))
    results = []
    search = request.args.get('q')
    if search:
        query = query.filter(
            (Entry.body.contains(search)) |
            (Entry.title.contains(search)))
        results = query.all()
        if not results:
            flash(f'There were no matches for your search "{search}".', 'danger')
    return object_list(template, query, **context)
Beispiel #11
0
def tag_detail(slug):
    tag_list = []
    entries_ids = set()
    tag_entries = []
    raw_tags = set([tag.strip() for tag in slug.split('+') if tag.strip()])
    for tag in raw_tags:
        tag_obj = Tag.query.filter(Tag.slug == tag).first_or_404()
        tag_list.append(tag_obj)
        tag_entries.append([entry.id for entry in tag_obj.entries])
        entries_ids |= set([entry.id for entry in tag_obj.entries])
    for entries in tag_entries:
        entries_ids &= set(entries)
    entries = Entry.query.filter(Entry.id.in_(entries_ids))
    tag_names = " + ".join(["{}".format(tag.name) for tag in tag_list])
    return object_list('entries/tag_detail.html', entries, tag=tag_names)
Beispiel #12
0
def index():
    #persons = PersonEntry.query.order_by(PersonEntry.last_name, PersonEntry.first_name)
    #persons = PersonEntry.query.join(CemeteryEntry,
    #        CemeteryEntry.id==PersonEntry.cemetery_id).\
    #    order_by(PersonEntry.last_name, PersonEntry.first_name)
    #pdb
    persons = db.session.query(PersonEntry, CemeteryEntry).\
            filter(CemeteryEntry.id==PersonEntry.cemetery_id).\
            order_by(PersonEntry.last_name, PersonEntry.first_name)
    return object_list('persons/index.html', persons)
    C = """Clarence Francis Kerr was born on Wednesday, August, 28, 1929. He \
    died on Thursday, December, 23, 2004 at the age of 75.\
    It has been 13 years since his death. If he were alive today, \
    he would be 88 years old."""
    M = """Marion Elaine Kerr was born on Thursday, April, 09, 1931. She died \
    on Monday, June, 03, 1991 at the age of 60. \
    It has been 26 years since her death. If she were alive today, \
    she would be 87 years old."""
    mlist = [('Marion Elaine Kerr', 'marion80x80.png', M),
             ('Clarence Francis Kerr', 'clarence80x80.png', C)]

    return render_template('show_individual.html', mlist=mlist)
Beispiel #13
0
def homepage():
    readings = DailyReading.query.filter(
        DailyReading.user_id == g.user.id).order_by(
            DailyReading.reading_day.desc())
    return object_list('homepage.html', readings, steps_form=StepsDataForm())
Beispiel #14
0
def tag_detail(slug):
    tag = Tag.query.filter(Tag.slug == slug).first_or_404()
    posts = tag.posts.order_by(Post.created_timestamp.desc())
    return object_list('posts/tag_detail.html', posts, tag=tag)
Beispiel #15
0
def index():
    cemeteries = CemeteryEntry.query.order_by(CemeteryEntry.name_of_cemetery)
    return object_list('cemeteries/index.html', cemeteries)
Beispiel #16
0
def tag_index():
    """doc."""
    tags = Tag.query.order_by(Tag.name)
    return object_list('customers/tag_index.html', tags)
Beispiel #17
0
def tag_detail(slug):
    tag = Tag.query.filter(Tag.slug == slug).first_or_404()
    entries = tag.entries.order_by(Entry.created_timestamp.desc())
    return object_list('entries/tag_detail.html', entries, tag=tag)
Beispiel #18
0
def list_estanteria():
	estanterias =  Estanteria.query.order_by(Estanteria.nombre)
	return object_list('estanteria/index.html', estanterias)
Beispiel #19
0
def list_producto():
	productos =  Producto.query.order_by(Producto.nombre)
	return object_list('producto/index.html', productos)
Beispiel #20
0
def index():
    entries = Entry.query.order_by(Entry.created_timestamp.desc())
    return object_list('entries/index.html', entries)
Beispiel #21
0
def list_alimento():
	alimentos =  Alimento.query.order_by(Alimento.producto_ref)
	return object_list('alimento/index.html', alimentos)
Beispiel #22
0
def index():
    snippets = Snippet.query.order_by(Snippet.created_timestamp.desc())
    return object_list("entries/index.html", snippets)
Beispiel #23
0
def tag_index():
    tags = Tag.query.order_by(Tag.name)
    if (tags is None):
        return "No Tags"
    else:
        return object_list('entries/tag_index.html', tags)
Beispiel #24
0
def tag_index():
    tags = Tag.query.order_by(Tag.name)
    title = "Tags"
    return object_list('entries/tag_index.html', tags, title=title)
Beispiel #25
0
def index():
    asn = AutonomousSystem.query.order_by(AutonomousSystem.asn.asc())
    # autonomoussystems = db.session.query(AutonomousSystem)
    return object_list('asn/index.html', asn)
Beispiel #26
0
def index():
    asn = AutonomousSystem.query.order_by(AutonomousSystem.asn.asc())
    # autonomoussystems = db.session.query(AutonomousSystem)
    return object_list('asn/index.html', asn)
Beispiel #27
0
def tag_index():
	tags = Tag.query.order_by(Tag.name)
	return object_list('entries/tag_index.html', tags)
def tag_details(slug):
    tag = Tag.query.filter(Tag.slug == slug).first_or_404()
    entries = tag.entries.order_by(Entry.created_timestamp.desc())
    return object_list('entries/tag_detail.html', entries, tag=tag)
Beispiel #29
0
def index():
    snippets = Snippet.query.order_by(Snippet.created_timestamp.desc())
    return object_list('entries/index.html', snippets)
Beispiel #30
0
def tag_index():
    tags = Tag.query.order_by(Tag.name.asc())
    tags_index = [len(tag.entries.all()) for tag in tags]
    return object_list('entries/tag_index.html', tags, title= "Blog Categories", tags_index=tags_index )
Beispiel #31
0
def tag_index():
    tags = Tag.query.order_by(Tag.name)
    return object_list('entries/tag_index.html', tags)
def image_list(template, query, **context):
    query = query.filter(Image.status == STATUS_PUBLIC)
    search = request.args.get('q')
    if search:
        query = query.filter(Image.name.contains(search))
    return object_list(template, query, **context)