Pagination in Flask-SQLAlchemy

  Рет қаралды 25,196

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 58
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql
@thomasrosenbaugh5805
@thomasrosenbaugh5805 3 жыл бұрын
Can't tell you how much you have helped me learn, every time I need to learn something within flask you have a video to get me going. You are the man my friend
@saibademais
@saibademais 2 жыл бұрын
Very good. Its help me so much. Congratulations from Brazil
@mounirben9370
@mounirben9370 4 жыл бұрын
The king of flask you are
@webmasters7133
@webmasters7133 2 жыл бұрын
thank you bro!
@kadursandy
@kadursandy 5 жыл бұрын
This is a good example of offset based pagination. Is there any example for cursor based pagination? I am looking for a good example using flask sqlalchemy with timestamp been used in the cursor based .please help
@alejocapovilla8119
@alejocapovilla8119 2 жыл бұрын
How can i dynamically change the per_page value to show rows in a table like 5, 10, 20, etc. I managed to sort them but when navigation to next page it shows the rows as only 5 or the number i have previously set.
@prafulrathod8765
@prafulrathod8765 4 жыл бұрын
hey Anthony,you explanation Power is Wonderfull..I am getting error in jinja syntax that 'list object is not iterable' for threads.iter_pages.How does I solve this ??
@richardrenescol4835
@richardrenescol4835 4 жыл бұрын
great video !! , how about pagination with filter ?
@mayurpande5415
@mayurpande5415 6 жыл бұрын
Hi I am not able to post through all form data from paginated pages. For example if I have loads of checkboxes on each row, I am not when I submit my form. I only get the data for the last page number when an items was selected. Is there a way around this.
@diego.coder26
@diego.coder26 7 жыл бұрын
Saludos desde Chile , buenos vídeos
@prettyprinted
@prettyprinted 7 жыл бұрын
Gracias!
@patrickmutuku
@patrickmutuku 6 жыл бұрын
Great tutorials as always
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks, I appreciate it!
@kishoreandra
@kishoreandra 5 жыл бұрын
Hey anthony, how can I achieve this... say I want to pass an index for eg: 0 it should return 0 to 5 records and if index is 1 it should return 6 to 10 record in json if possible......using flask sql alchemy.....thanks
@arushkapoor7735
@arushkapoor7735 6 жыл бұрын
Best video tutorial on flask pagination, but please make a video on flask infinite scrolling as it is hard to find on the internet.
@prettyprinted
@prettyprinted 6 жыл бұрын
That's a good idea. I'll add it to my list. Thanks for watching.
@RamiroJativa
@RamiroJativa 4 жыл бұрын
Excellent Anthony- As always. Thank you!!! The link provided to access the source code reports an error 404: Page not found
@MaxSeipio
@MaxSeipio 7 жыл бұрын
Excellent, thanks for the video!
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome! Thanks for watching.
@zacaruca
@zacaruca 5 жыл бұрын
Muchas gracias por este tutorial. Me ha venido muy bien.
@prettyprinted
@prettyprinted 5 жыл бұрын
You're welcome! Thanks for watching.
@ayushaher5022
@ayushaher5022 3 жыл бұрын
thank you
@Surendranathkumarms
@Surendranathkumarms 6 жыл бұрын
Wonderful video. I am facing an issue. I am able to pull the rows and navigate to rows. I need to receive additional comments for the row presented to the user and update back to the database. What is the best approach to handle this situation?
@prettyprinted
@prettyprinted 6 жыл бұрын
You can associate the additional comments with the ID of each row and then use that ID to query for the row again to update it.
@kekkoB996
@kekkoB996 6 жыл бұрын
Thank you. It's been very helpful.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@jonasnicoletti390
@jonasnicoletti390 7 жыл бұрын
Hi, I really like your Flask Tutorials! Do you mind if I put your CheatSheet on one of my Github Projects? Of course I will link to your website and give the credit to you
@webmasters7133
@webmasters7133 2 жыл бұрын
oshna lekin zo'r chiiqbdi! ashnaqa davom etorin )) (Anjanlilar tushundi)
@khai-chuongtrinh1429
@khai-chuongtrinh1429 5 жыл бұрын
hi thanks for great video. i'm wondering what is difference between your method of pagination and other method like so: pagination = Pagination(page, PER_PAGE, count) return render_template('some.html', pagination=pagination, users=users) Also, how can I change font size of the user.iter_pages() links? Is it through some CSS style? There alternative method I mentioned has documentation on changing the font size and padding, etc through CSS. How can I do it for your method? Thanks
@gleepwurp1974
@gleepwurp1974 7 жыл бұрын
Thanks! Interesting videos!
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks for watching!
@RiddleMeThat313
@RiddleMeThat313 6 жыл бұрын
what if my 'thread' function got already some arguments ?
@_SoundByte_
@_SoundByte_ 7 жыл бұрын
thanks a lot...
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome! Thanks for watching.
@Glauberz1
@Glauberz1 7 жыл бұрын
Hello,I'm having trouble trying to paginate a modal box using flask-sqlalchemy pagination method because when i change the page the modal box close automatically.Can you help me on how to maginate a modal box without it closing? i tried using Ajax but not worked.
@prettyprinted
@prettyprinted 7 жыл бұрын
That's too broad of a question to answer over KZbin. If you have code, you can send it to anthony@prettyprinted.com so I can take a look.
@jottedpro7408
@jottedpro7408 6 жыл бұрын
thank uuuuuu so much it was so helpful
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@ManwalStudio
@ManwalStudio 5 жыл бұрын
Hi, can you please provide the method of search of filter by name or I'd
@prettyprinted
@prettyprinted 5 жыл бұрын
It would look something like this: .filter(db.or_(User.id == id, User.name == name)))
@jake5335
@jake5335 6 жыл бұрын
Any way to add a search box with this to search for a specific result?
@prettyprinted
@prettyprinted 6 жыл бұрын
That's a pretty broad question, but basically, yes you can add a search box.
@jake5335
@jake5335 6 жыл бұрын
Thanks for the quick reply! Okay I'll be more specific, I've used the method in this video to paginate some campsites in a website i'm making. It would be a lot better if the user had the option to type in some characters to filter the results. Would you recommend anything for this functionality? Really helpful vid btw, you explain things very well. I've subbed to your channel.
@prettyprinted
@prettyprinted 6 жыл бұрын
Still a bit broad because it depends on exactly how you want it to work. But I'll assume the search box is just a form. When the form gets submitted, you can add arguments to the URL query string that would get read by the route that queries the database.
@n3wtou
@n3wtou 5 жыл бұрын
Is there a version that can be used with pymongo db?
@prettyprinted
@prettyprinted 5 жыл бұрын
Look into Flask-MongoAlchemy.
@evanesoteric
@evanesoteric 7 жыл бұрын
Appreciate you!
@prettyprinted
@prettyprinted 7 жыл бұрын
And I appreciate you for watching.
@lnknwl7267
@lnknwl7267 7 жыл бұрын
I have some problem. I want to paginate the data from my database but when i run application i get the message: "werkzeug.routing.BuildError: Could not build url for endpoint 'personal_page'. Did you forget to specify values ['page_num']?". I downloaded your application and it works properly, but mine doesn't... What i have do to here? My code below: @app.route('/personal_page/', methods=['GET', 'POST']) @login_required def personal_page(page_num): threads = Users.query.paginate(per_page=10, page=page_num, error_out=True) return render_template('personal_page.htm', threads=threads, title = 'Personal page', name = current_user.username) Sorry for bad English btw
@prettyprinted
@prettyprinted 7 жыл бұрын
When using url_for, are you including the page number? url_for('personal_page', page_num=the_page_num)
@lnknwl7267
@lnknwl7267 7 жыл бұрын
Pretty Printed Yes, I solved that already, but thanks for reply! You are awesome! :D
@luisncn
@luisncn 2 жыл бұрын
como resolviste?
@desmondade
@desmondade 7 жыл бұрын
Nice video Anthony thanks you really explain this well but i want to ask you one question , i am adding full text search to my app using whooshalchemy and i want to paginate my results how can i do this, here is my code but i keep on getting and error.My search code code works well but i get and error only when i try to add pagination to the results @app.route('/search_results//') @app.route('/search_results/') def search_results(query,page=1): results = User.query.whoosh_search(query, or_=True).paginate(page=page, per_page=2,error_out=True) return render_template('search_results.html', results=results, query=query )#closing redirect
@prettyprinted
@prettyprinted 7 жыл бұрын
It's a bug in WhooshAlchemy. See here: github.com/gyllstromk/Flask-WhooshAlchemy/pull/14 Try using a fork of the extension: github.com/dhamaniasad/Flask-WhooshAlchemy
@joshyjoy2318
@joshyjoy2318 5 жыл бұрын
all the time he says cheat sheet, I hear chi chi..... :)
@crearte-diy
@crearte-diy 3 жыл бұрын
this_tutorial_is_fake = True
Bulk Updates and Deletes in Flask-SQLAlchemy
12:20
Pretty Printed
Рет қаралды 18 М.
How to Use Flask-SQLAlchemy With Flask Blueprints
20:10
Pretty Printed
Рет қаралды 37 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 7 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 150 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 103 МЛН
Pagination in Flask: Split Your Data Into Pages
11:51
NeuralNine
Рет қаралды 7 М.
API REST avec Flask en Python (Marshmallow, SQLAlchemy, ...)
23:16
Using Constraints in Flask-SQLAlchemy
12:41
Pretty Printed
Рет қаралды 10 М.
Left Outer Join in Flask-SQLAlchemy
13:04
Pretty Printed
Рет қаралды 22 М.
You’re Probably Doing Pagination Wrong
6:34
Database Star
Рет қаралды 6 М.
Handling Exceptions In Flask-SQLAlchemy
12:11
Pretty Printed
Рет қаралды 19 М.
Python Flask Tutorial: Full-Featured Web App Part 9 - Pagination
31:22
Creating a Todo List App With Flask and Flask-SQLAlchemy
34:59
Pretty Printed
Рет қаралды 41 М.