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)
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)
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)
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)
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)
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): 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)
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)
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)
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)
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)
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())
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)
def index(): cemeteries = CemeteryEntry.query.order_by(CemeteryEntry.name_of_cemetery) return object_list('cemeteries/index.html', cemeteries)
def tag_index(): """doc.""" tags = Tag.query.order_by(Tag.name) return object_list('customers/tag_index.html', tags)
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)
def list_estanteria(): estanterias = Estanteria.query.order_by(Estanteria.nombre) return object_list('estanteria/index.html', estanterias)
def list_producto(): productos = Producto.query.order_by(Producto.nombre) return object_list('producto/index.html', productos)
def index(): entries = Entry.query.order_by(Entry.created_timestamp.desc()) return object_list('entries/index.html', entries)
def list_alimento(): alimentos = Alimento.query.order_by(Alimento.producto_ref) return object_list('alimento/index.html', alimentos)
def index(): snippets = Snippet.query.order_by(Snippet.created_timestamp.desc()) return object_list("entries/index.html", snippets)
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)
def tag_index(): tags = Tag.query.order_by(Tag.name) title = "Tags" return object_list('entries/tag_index.html', tags, title=title)
def index(): asn = AutonomousSystem.query.order_by(AutonomousSystem.asn.asc()) # autonomoussystems = db.session.query(AutonomousSystem) return object_list('asn/index.html', asn)
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)
def index(): snippets = Snippet.query.order_by(Snippet.created_timestamp.desc()) return object_list('entries/index.html', snippets)
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 )
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)