NiceGUI 1.2.10 with improved bindings, ui.grid, ui.chat_message and more
### New features and enhancements
- Add [autocomplete](https://nicegui.io/documentation/input#autocompletion) for `ui.input`
- Allow binding dictionaries
- Add binding methods for disableable elements
- Introduce [`ui.grid`](https://nicegui.io/documentation/grid)
- Introduce [`ui.chat_message`](https://nicegui.io/documentation/chat_message)
- Support [`ui.refreshable`](https://nicegui.io/documentation/refreshable) with async functions
- Style blockquotes in [`ui.markdown`](https://nicegui.io/documentation/markdown) elements
- Introduce [`seek`](https://nicegui.io/documentation/video#video_start_position) method for `ui.video`
- Support [base64](https://nicegui.io/documentation/run#base64_favicon) and [SVG](https://nicegui.io/documentation/run#svg_favicon) favicons
- Add `mount_path` parameter to `ui.run_with`
### Bugfixes
- Fix layout issue with [`ui.refreshable`](https://nicegui.io/documentation/refreshable)
- Avoid memory leak with [`ui.refreshable`](https://nicegui.io/documentation/refreshable)
- Fix new event registrations not being sent to the client
### Documentation
- Allow choosing from different elements for the [live demo](https://nicegui.io/documentation#try_styling_nicegui_elements_)
- Improve menu accessibility on mobile devices
Thanks for all the great contributions. It is a pleasure working with you.
/r/Python
https://redd.it/130toef
### New features and enhancements
- Add [autocomplete](https://nicegui.io/documentation/input#autocompletion) for `ui.input`
- Allow binding dictionaries
- Add binding methods for disableable elements
- Introduce [`ui.grid`](https://nicegui.io/documentation/grid)
- Introduce [`ui.chat_message`](https://nicegui.io/documentation/chat_message)
- Support [`ui.refreshable`](https://nicegui.io/documentation/refreshable) with async functions
- Style blockquotes in [`ui.markdown`](https://nicegui.io/documentation/markdown) elements
- Introduce [`seek`](https://nicegui.io/documentation/video#video_start_position) method for `ui.video`
- Support [base64](https://nicegui.io/documentation/run#base64_favicon) and [SVG](https://nicegui.io/documentation/run#svg_favicon) favicons
- Add `mount_path` parameter to `ui.run_with`
### Bugfixes
- Fix layout issue with [`ui.refreshable`](https://nicegui.io/documentation/refreshable)
- Avoid memory leak with [`ui.refreshable`](https://nicegui.io/documentation/refreshable)
- Fix new event registrations not being sent to the client
### Documentation
- Allow choosing from different elements for the [live demo](https://nicegui.io/documentation#try_styling_nicegui_elements_)
- Improve menu accessibility on mobile devices
Thanks for all the great contributions. It is a pleasure working with you.
/r/Python
https://redd.it/130toef
nicegui.io
ui.refreshable | NiceGUI
NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser. You can create buttons, dialogs, Markdown, 3D scenes, plots and much more.
Wagtail snippets/template tags help
Hi, i'm working on my first Wagtail project, currently developing snippets but looking for some help.
I have a header snippet section where I can add several headers which can be used by the home page. At the moment the page is displaying all the headers, but I want it to just show the selected header.
I presume it because i am doing Headers.objects.all() in my custom tag but how do I write this in Wagtail to only display the selected header? Sorry, it's been a while since I wrote any Django as been working on Frontend learning the last couple of months!
Here is my code. The tag code is only relevant, but i'll include everything related, my snippets work correctly, but obviously I don't want to be returning all my header objects.
Just like to add, I am finding Wagtail awesome but almost more confusing than Django.
Snippet
@register_snippet
class Header(models.Model):
logo = models.ForeignKey(
'wagtailimages.Image',
null=True,
/r/djangolearning
https://redd.it/13177hq
Hi, i'm working on my first Wagtail project, currently developing snippets but looking for some help.
I have a header snippet section where I can add several headers which can be used by the home page. At the moment the page is displaying all the headers, but I want it to just show the selected header.
I presume it because i am doing Headers.objects.all() in my custom tag but how do I write this in Wagtail to only display the selected header? Sorry, it's been a while since I wrote any Django as been working on Frontend learning the last couple of months!
Here is my code. The tag code is only relevant, but i'll include everything related, my snippets work correctly, but obviously I don't want to be returning all my header objects.
Just like to add, I am finding Wagtail awesome but almost more confusing than Django.
Snippet
@register_snippet
class Header(models.Model):
logo = models.ForeignKey(
'wagtailimages.Image',
null=True,
/r/djangolearning
https://redd.it/13177hq
Reddit
r/djangolearning on Reddit: Wagtail snippets/template tags help
Posted by u/rob8624 - 1 vote and 1 comment
How to test redirection In Flask with Python unittest?
hello i have flask function create\_product, how i can in unit test testing redirection? i want test if product is created user is send to this site with that line of code return redirect(url\_for('products.product\_page\_preview', product\_id=new\_product.id))
I need add test to my test case.
PLEASE HELP TO ME
@products.route('/create-product', methods=['GET', 'POST'])
@login_required
def create_product():
form = ProductForm()
if form.validate_on_submit():
product_data = {
'product_name': request.form.get('product_name'),
'price': request.form.get('price'),
'discount': request.form.get('discount'),
'stock': request.form.get('stock'),
'size': float(request.form.get('size')),
/r/flask
https://redd.it/13108zl
hello i have flask function create\_product, how i can in unit test testing redirection? i want test if product is created user is send to this site with that line of code return redirect(url\_for('products.product\_page\_preview', product\_id=new\_product.id))
I need add test to my test case.
PLEASE HELP TO ME
@products.route('/create-product', methods=['GET', 'POST'])
@login_required
def create_product():
form = ProductForm()
if form.validate_on_submit():
product_data = {
'product_name': request.form.get('product_name'),
'price': request.form.get('price'),
'discount': request.form.get('discount'),
'stock': request.form.get('stock'),
'size': float(request.form.get('size')),
/r/flask
https://redd.it/13108zl
Python resume projects?
I am by no means good enough at python to be looking for a job in it, but felt curious about what employers like to see, and maybe try to do one of these projects to try and learn some new things.
/r/Python
https://redd.it/13187gs
I am by no means good enough at python to be looking for a job in it, but felt curious about what employers like to see, and maybe try to do one of these projects to try and learn some new things.
/r/Python
https://redd.it/13187gs
Reddit
r/Python on Reddit: Python resume projects?
Posted by u/sloop35 - 7 votes and 8 comments
Open-source collaboration
I wanted to introduce myself and share a new open-source project I've been working on called Apollo. It's an LLM aggregation library for Python that simplifies the process of working with APIs, AI models, and Django.
I'm currently adding support for a full API to manage in-app integrations, user subscription management, and preferences, and would love to get feedback on our SDK.
By the way, if you're interested in contributing to the project, we're always looking for new contributors!
/r/Python
https://redd.it/131bqkj
I wanted to introduce myself and share a new open-source project I've been working on called Apollo. It's an LLM aggregation library for Python that simplifies the process of working with APIs, AI models, and Django.
I'm currently adding support for a full API to manage in-app integrations, user subscription management, and preferences, and would love to get feedback on our SDK.
By the way, if you're interested in contributing to the project, we're always looking for new contributors!
/r/Python
https://redd.it/131bqkj
GitHub
GitHub - apolloapi/apolloapi: LLMOps framework for model management and automation through integrating any provider and syncingβ¦
LLMOps framework for model management and automation through integrating any provider and syncing data under one API. - GitHub - apolloapi/apolloapi: LLMOps framework for model management and autom...
I'm trying to have all my pages use one html file for a navbar but I cant get it to load in
I tried using javascript to load it in from a static file
$(function(){
$("#navbar").load("/navbar");
});
I also tried it by loading it as a seprate route and trying to reference it that way.
does anyone know if there is a way to get this working, through python or javascript?
/r/flask
https://redd.it/130x3cx
I tried using javascript to load it in from a static file
$(function(){
$("#navbar").load("/navbar");
});
I also tried it by loading it as a seprate route and trying to reference it that way.
does anyone know if there is a way to get this working, through python or javascript?
/r/flask
https://redd.it/130x3cx
Reddit
r/flask on Reddit: I'm trying to have all my pages use one html file for a navbar but I cant get it to load in
Posted by u/blud97 - 1 vote and 6 comments
[P] UnpromptedControl: Noprompt ControlNet Image Restoration/Object removal, GitHub link in comments
https://redd.it/13154na
@pythondaily
https://redd.it/13154na
@pythondaily
Reddit
r/MachineLearning on Reddit: [P] UnpromptedControl: Noprompt ControlNet Image Restoration/Object removal, GitHub link in comments
Posted by u/vijish_madhavan - No votes and 5 comments
My first website I have built and deployed as Django newbie π
http://phevab1.pythonanywhere.com/index.html
/r/django
https://redd.it/130odlk
http://phevab1.pythonanywhere.com/index.html
/r/django
https://redd.it/130odlk
Reddit
r/django on Reddit: My first website I have built and deployed as Django newbie π
Posted by u/NoHistorian4672 - 39 votes and 30 comments
Cooldown timer or other query limit?
I have a fairly complex web app that needs to run some fairly heavy queries.
1. to our project management system to get all the users available and what projects they work in
2. ldap to our dc active directory to see whether they are allowed to work on these projects
3. ldap to our dc active directory to make changes to what they are allowed to work on
I do not think this will be used multiple times a day even, but it will be accessed by multiple people, so there is a chance a bunch of people might compound these queries and stall our dc and project management system. Also projects ramp up so they may be making really large modifications or really tiny ones, 1 person or 100 people.
Is there some sort of backend server level cool down timer I could implement just in case that might make them wait a bit longer while an active query is running, maybe space the queries out?
I have refactored these queries to about as minimal as they can be but it's just the fact that we need to know that these 400ish people can be added, and we need to know that these
/r/flask
https://redd.it/1305g87
I have a fairly complex web app that needs to run some fairly heavy queries.
1. to our project management system to get all the users available and what projects they work in
2. ldap to our dc active directory to see whether they are allowed to work on these projects
3. ldap to our dc active directory to make changes to what they are allowed to work on
I do not think this will be used multiple times a day even, but it will be accessed by multiple people, so there is a chance a bunch of people might compound these queries and stall our dc and project management system. Also projects ramp up so they may be making really large modifications or really tiny ones, 1 person or 100 people.
Is there some sort of backend server level cool down timer I could implement just in case that might make them wait a bit longer while an active query is running, maybe space the queries out?
I have refactored these queries to about as minimal as they can be but it's just the fact that we need to know that these 400ish people can be added, and we need to know that these
/r/flask
https://redd.it/1305g87
Reddit
r/flask on Reddit: Cooldown timer or other query limit?
Posted by u/cahmyafahm - 3 votes and 10 comments
P Best practices for large models on Docker
How would you deploy a large model from a git repo when deploying on docker?
The model gets downloaded in the cache when you run it for the first time (similar to a transformer library like sentenceTransform).
For now, I have done a
however, what would be the best practice for this?
Should the model be downloaded when doing the "build" or the first "run"?
/r/MachineLearning
https://redd.it/131m148
How would you deploy a large model from a git repo when deploying on docker?
The model gets downloaded in the cache when you run it for the first time (similar to a transformer library like sentenceTransform).
For now, I have done a
RUN python -c "funcToDownloadModels()" however, what would be the best practice for this?
Should the model be downloaded when doing the "build" or the first "run"?
/r/MachineLearning
https://redd.it/131m148
Reddit
r/MachineLearning on Reddit: [P] Best practices for large models on Docker
Posted by u/GustaMusto - 7 votes and 2 comments
Introducing Socon: Socon enables you to create a generic framework structure for all your different projects.
I'm a test and validation engineer and I'm working a lot with different projects that requires to share common scripts/components.
The idea behind the framework is to help people and/or organizations to develop their own fast and reliable framework for their different projects. We often spend too much time creating scripts for a single project. Or spend too much time trying to create generic scripts for several projects. Usually, this ends up in hundreds of scripts and is very time-consuming.
Couple months ago I decided to create Socon. Socon has been designed to simplify all the above. Socon works with commands. Socon will let you define common commands that can be shared across projects. Each project can either write their own commands, or override a common command to change its behavior by adding or removing functionalities.
Socon will also let you develop your own managers and hooks to empower your framework. You are also free to develop your own plugins to share across your company, with friends or with the world.
I have been working alone for quite some time now and I would really appreciate feedback and help. The framework can save a lot of time for people working in devops or
/r/Python
https://redd.it/131lfa4
I'm a test and validation engineer and I'm working a lot with different projects that requires to share common scripts/components.
The idea behind the framework is to help people and/or organizations to develop their own fast and reliable framework for their different projects. We often spend too much time creating scripts for a single project. Or spend too much time trying to create generic scripts for several projects. Usually, this ends up in hundreds of scripts and is very time-consuming.
Couple months ago I decided to create Socon. Socon has been designed to simplify all the above. Socon works with commands. Socon will let you define common commands that can be shared across projects. Each project can either write their own commands, or override a common command to change its behavior by adding or removing functionalities.
Socon will also let you develop your own managers and hooks to empower your framework. You are also free to develop your own plugins to share across your company, with friends or with the world.
I have been working alone for quite some time now and I would really appreciate feedback and help. The framework can save a lot of time for people working in devops or
/r/Python
https://redd.it/131lfa4
Reddit
r/Python on Reddit: Introducing Socon: Socon enables you to create a generic framework structure for all your different projects.
Posted by u/CyberEng - 68 votes and 10 comments
Button with a double function
I made the following models file:
class Product(models.Model):
...
downloads = models.IntegerField(default=0)
And I would like to increase it every time the following link is clicked:
<a href="{{ product.pdf.url }}" download></a>
Any suggestion on how to do that?
/r/djangolearning
https://redd.it/1316obj
I made the following models file:
class Product(models.Model):
...
downloads = models.IntegerField(default=0)
And I would like to increase it every time the following link is clicked:
<a href="{{ product.pdf.url }}" download></a>
Any suggestion on how to do that?
/r/djangolearning
https://redd.it/1316obj
Reddit
r/djangolearning on Reddit: Button with a double function
Posted by u/Fit-Refrigerator495 - 4 votes and 2 comments
Why is poetry such a mess?
I really wanted to like poetry. But in my experience, you run into trouble with almost any installation. Especially, when it comes to complex stuff like pytorch, etc. I spent hours debugging its build problems already. But I still don't understand why it is so damn brittle.
How can people recommend this tool as an alternative to conda? I really don't understand.
/r/Python
https://redd.it/131snt9
I really wanted to like poetry. But in my experience, you run into trouble with almost any installation. Especially, when it comes to complex stuff like pytorch, etc. I spent hours debugging its build problems already. But I still don't understand why it is so damn brittle.
How can people recommend this tool as an alternative to conda? I really don't understand.
/r/Python
https://redd.it/131snt9
Reddit
r/Python on Reddit: Why is poetry such a mess?
Posted by u/CodingButStillAlive - 29 votes and 56 comments
How to make @loginrequired optional?
hi, I have this piece of code:
@app.route('/register', methods=["GET", "POST"])
@loginrequired
def register():
if request.method == "POST":
...etc
Now, if I have no users in the database yet (so
/r/flask
https://redd.it/131okwn
hi, I have this piece of code:
@app.route('/register', methods=["GET", "POST"])
@loginrequired
def register():
if request.method == "POST":
...etc
Now, if I have no users in the database yet (so
if User.query.count() == 0 I want it to be available without login so the initial user can be registered (which then has rights to create others) but how? I tried putting @login_required in an if statement but that doesn't work. What's the proper approach for this?/r/flask
https://redd.it/131okwn
Reddit
r/flask on Reddit: How to make @login_required optional?
Posted by u/Xzenor - 4 votes and 12 comments
Piperoni ~ Create your business process diagrams with words!
Check out Piperoni, the graphical frontend for the ProcessPiper Python package! With Piperoni, you can easily generate business process diagrams using simple English words.
Piperoni Repo: https://github.com/csgoh/Piperoni
ProcessPiper Repo: https://github.com/csgoh/processpiper
Piperoni project is still in the early stages of development. Any feedback is welcome!
https://preview.redd.it/y6zvm2v3jlwa1.png?width=1834&format=png&auto=webp&v=enabled&s=9a78b01c15403512c52221858cf2c99c3b3fb156
/r/Python
https://redd.it/131myf1
Check out Piperoni, the graphical frontend for the ProcessPiper Python package! With Piperoni, you can easily generate business process diagrams using simple English words.
Piperoni Repo: https://github.com/csgoh/Piperoni
ProcessPiper Repo: https://github.com/csgoh/processpiper
Piperoni project is still in the early stages of development. Any feedback is welcome!
https://preview.redd.it/y6zvm2v3jlwa1.png?width=1834&format=png&auto=webp&v=enabled&s=9a78b01c15403512c52221858cf2c99c3b3fb156
/r/Python
https://redd.it/131myf1
GitHub
GitHub - csgoh/Piperoni
Contribute to csgoh/Piperoni development by creating an account on GitHub.
SQLModel or SQLAlchemy for big data analysis application?
Hello i need some advice. We are working on a new data analysis software and i need to choose between SQLModel and SQLAlchemy for our backend , seeing as it's going to be a massive application and nobody in my company has much experience with python (all our other applications are in ruby on rails) i wanted to know some pros and cons on using SQLModel over SQLAlchemy.
Some pros for SQLModel:
1. Our data analysit use pydantic for modeling the input and output of our APIs.
2. We are going to use FastAPI.
Some pros for SQLAlchemy:
1. It has a history as a reliable library.
2. The last commit for SQLModel was 2 months ago and it's still a relatively new library.
Sorry if this post isn't allowed (if it isn't please tell me where to post). Thank you in advance.
/r/Python
https://redd.it/13260j3
Hello i need some advice. We are working on a new data analysis software and i need to choose between SQLModel and SQLAlchemy for our backend , seeing as it's going to be a massive application and nobody in my company has much experience with python (all our other applications are in ruby on rails) i wanted to know some pros and cons on using SQLModel over SQLAlchemy.
Some pros for SQLModel:
1. Our data analysit use pydantic for modeling the input and output of our APIs.
2. We are going to use FastAPI.
Some pros for SQLAlchemy:
1. It has a history as a reliable library.
2. The last commit for SQLModel was 2 months ago and it's still a relatively new library.
Sorry if this post isn't allowed (if it isn't please tell me where to post). Thank you in advance.
/r/Python
https://redd.it/13260j3
Reddit
r/Python on Reddit: SQLModel or SQLAlchemy for big data analysis application?
Posted by u/glup_ko_procita - No votes and 4 comments
Introducing Project Ragaz - A fast, safe and powerful pythonic compiler which aims allow you to create simple scripts to complex systems in a code easier to read, write and maintain than other system languages with the same purpose.
Hello everyone, I would like to introduce you to a project that I have been working on for 2 years. For those who don't know me, my name is David, I'm a software engineer (MSc) and I've been working with Python and artificial intelligence for a few years.
The name of the project is Ragaz, and it consists of a compiler aimed at meeting requirements that many developers, like me, have always wanted in the Python world as such as:
Runtime speed equal to or close to languages like C/C++ or Rust.
Compiling a Python project to pure executable code (using LLVM) without the need for virtual machines, wrappings, decorators, and other extras to distribute your software.
Code that runs on multiple processors (because there is no [GIL](https://granulate.io/blog/introduction-to-the-infamous-python-gil/)).
Rust-like memory management that eliminates garbage collector, improves runtime speed and prevents memory access bugs.
With these requirements already being met in my project, even creating an operating system in Python would be feasible, for example.
I made this chart comparing Ragaz's performance with the official version of Python and C/C++. As you can see, the program compiled in Ragaz runs at a speed close to the same one compiled in C/C++ and is dozens
/r/Python
https://redd.it/1329mfw
Hello everyone, I would like to introduce you to a project that I have been working on for 2 years. For those who don't know me, my name is David, I'm a software engineer (MSc) and I've been working with Python and artificial intelligence for a few years.
The name of the project is Ragaz, and it consists of a compiler aimed at meeting requirements that many developers, like me, have always wanted in the Python world as such as:
Runtime speed equal to or close to languages like C/C++ or Rust.
Compiling a Python project to pure executable code (using LLVM) without the need for virtual machines, wrappings, decorators, and other extras to distribute your software.
Code that runs on multiple processors (because there is no [GIL](https://granulate.io/blog/introduction-to-the-infamous-python-gil/)).
Rust-like memory management that eliminates garbage collector, improves runtime speed and prevents memory access bugs.
With these requirements already being met in my project, even creating an operating system in Python would be feasible, for example.
I made this chart comparing Ragaz's performance with the official version of Python and C/C++. As you can see, the program compiled in Ragaz runs at a speed close to the same one compiled in C/C++ and is dozens
/r/Python
https://redd.it/1329mfw
InfoWorld
What is LLVM? The power behind Swift, Rust, Clang, and more
Learn how the compiler framework for programmatically generating machine-native code has made it easier than ever to roll new languages and enhance existing ones
Django Roadmap
Can you provide a Django roadmap to help me improve my skills and knowledge as a developer?
/r/django
https://redd.it/131m4w0
Can you provide a Django roadmap to help me improve my skills and knowledge as a developer?
/r/django
https://redd.it/131m4w0
Reddit
r/django on Reddit: Django Roadmap
Posted by u/NoHistorian4672 - 31 votes and 4 comments
Prefetchrelated and filtering
I was reading django documentation about [prefetch related](https://docs.djangoproject.com/en/4.2/ref/models/querysets/#django.db.models.query.QuerySet.prefetchrelated)
And the next lines confused me a bit:
pizzas = Pizza.objects.prefetchrelated('toppings')
[list(pizza.toppings.filter(spicy=True)) for pizza in pizzas]
β¦then the fact that pizza.toppings.all() has been prefetched will not help you.
The prefetchrelated('toppings') implied pizza.toppings.all(), but pizza.toppings.filter() is a new and different query. The prefetched cache canβt help here;
Can anyone explain what is meant by this? Why prefetch cache can't help in such cases?
/r/django
https://redd.it/13232zy
I was reading django documentation about [prefetch related](https://docs.djangoproject.com/en/4.2/ref/models/querysets/#django.db.models.query.QuerySet.prefetchrelated)
And the next lines confused me a bit:
pizzas = Pizza.objects.prefetchrelated('toppings')
[list(pizza.toppings.filter(spicy=True)) for pizza in pizzas]
β¦then the fact that pizza.toppings.all() has been prefetched will not help you.
The prefetchrelated('toppings') implied pizza.toppings.all(), but pizza.toppings.filter() is a new and different query. The prefetched cache canβt help here;
Can anyone explain what is meant by this? Why prefetch cache can't help in such cases?
/r/django
https://redd.it/13232zy
Django Project
QuerySet API reference | Django documentation
The web framework for perfectionists with deadlines.
Databases Design
Hi!!
Im trying to create the ER schema but Iβve had some trouble since Database architecture isnβt my strength.
Basically, the app X has a service S. That service S has different functionalities such as: data analysis, and news analysis.
My problem is connecting the relations. So far I have this model:
1. Service Relation
βββββββββ
Name
Price
Isactive
Functions (manytomany)
2. Functions relation
βββββββββ-
Name
Isactive
3. News analysis
ββββββββββ-
Author
Pub date
Content
My desire is to somehow relate the service S, to the news analysis.
If you have any other ideas or thought about how to improve it please let my know.
I would appreciate any type of help.
/r/django
https://redd.it/132ag0t
Hi!!
Im trying to create the ER schema but Iβve had some trouble since Database architecture isnβt my strength.
Basically, the app X has a service S. That service S has different functionalities such as: data analysis, and news analysis.
My problem is connecting the relations. So far I have this model:
1. Service Relation
βββββββββ
Name
Price
Isactive
Functions (manytomany)
2. Functions relation
βββββββββ-
Name
Isactive
3. News analysis
ββββββββββ-
Author
Pub date
Content
My desire is to somehow relate the service S, to the news analysis.
If you have any other ideas or thought about how to improve it please let my know.
I would appreciate any type of help.
/r/django
https://redd.it/132ag0t
Reddit
r/django on Reddit: Databases Design
Posted by u/Iamjuanclopez6 - 2 votes and 3 comments