Pynecone: New Features and Performance Improvements β‘οΈ
Hi everyone, wanted to give a quick update on Pynecone because there have been major improvements in the past month since our initial release.
For those who have never heard of Pynecone, it is a way to build full-stack web apps in pure Python. The framework is easy to get started with even without previous web dev experience, and is entirely open source / free to use.
# Improvements:
Here are some of the notable improvements we implemented. Along with these were many bug fixes to get Pynecone more stable.
Components/Features:
πͺ Added Windows support!
π Added built-in graphing libraries using Victory.
Added Dynamic Routes.
Performance:
β‘οΈSwitched to WebSockets (No more new requests for every event!)
Compiler improvements to speed up event processing.
Community:
βοΈ Grown from \~30 to \~2400 Github stars.
70 [Discord](https://discord.gg/T5WSbC2YtQ) members.
13 More contributors.
Testing:
β Improved unit test coverage and added integration tests for all PRs.
Next Steps:
Add components such as upload and date picker.
Show how to make your own Pynecone 3rd party libraries.
And many more features!
/r/Python
https://redd.it/10h6l7e
Hi everyone, wanted to give a quick update on Pynecone because there have been major improvements in the past month since our initial release.
For those who have never heard of Pynecone, it is a way to build full-stack web apps in pure Python. The framework is easy to get started with even without previous web dev experience, and is entirely open source / free to use.
# Improvements:
Here are some of the notable improvements we implemented. Along with these were many bug fixes to get Pynecone more stable.
Components/Features:
πͺ Added Windows support!
π Added built-in graphing libraries using Victory.
Added Dynamic Routes.
Performance:
β‘οΈSwitched to WebSockets (No more new requests for every event!)
Compiler improvements to speed up event processing.
Community:
βοΈ Grown from \~30 to \~2400 Github stars.
70 [Discord](https://discord.gg/T5WSbC2YtQ) members.
13 More contributors.
Testing:
β Improved unit test coverage and added integration tests for all PRs.
Next Steps:
Add components such as upload and date picker.
Show how to make your own Pynecone 3rd party libraries.
And many more features!
/r/Python
https://redd.it/10h6l7e
GitHub
GitHub - reflex-dev/reflex: πΈοΈ Web apps in pure Python π
πΈοΈ Web apps in pure Python π. Contribute to reflex-dev/reflex development by creating an account on GitHub.
Migrating from Flask to FastAPI
Part of the work I've done with Forethought is lead an effort to migrate from Flask to FastAPI. π
Here's the first blog post out of 3, with all the tips and tricks to migrate a real-life, huge, production code base. π€
I hope it's useful! ππ
https://engineering.forethought.ai/blog/2022/12/01/migrating-from-flask-to-fastapi-part-1/
/r/Python
https://redd.it/10h9fb5
Part of the work I've done with Forethought is lead an effort to migrate from Flask to FastAPI. π
Here's the first blog post out of 3, with all the tips and tricks to migrate a real-life, huge, production code base. π€
I hope it's useful! ππ
https://engineering.forethought.ai/blog/2022/12/01/migrating-from-flask-to-fastapi-part-1/
/r/Python
https://redd.it/10h9fb5
engineering.forethought.ai
Migrating from Flask to FastAPI, Part 1 - Forethought AI Engineering
Welcome to the Forethought AI engineering team's blog! We are a group of software engineers, data scientists, and machine learning experts who are committed to building innovative solutions to improve the efficiency and effectiveness of customer service teams.
NiceGUI now has a subreddit.
Hi Folks... Just a heads up that NiceGUI now has it's own subreddit at r/nicegui. If you want to do really fast and efficient web page development using Python this is definitely worth looking at. Cheers!
/r/Python
https://redd.it/10hg2i4
Hi Folks... Just a heads up that NiceGUI now has it's own subreddit at r/nicegui. If you want to do really fast and efficient web page development using Python this is definitely worth looking at. Cheers!
/r/Python
https://redd.it/10hg2i4
Reddit
r/Python on Reddit: NiceGUI now has a subreddit.
Posted by u/ParallaxRay - 47 votes and 5 comments
Add Watermarks To PDF, JPG & PNG files with no restrictive licensing
I created a small Python package to add watermarks to PDF, JPG & PNG files.
**Why?** Most Python PDF packages have licensing that requires you to release your source code which isn't ideal for everyone. In this package, I've utilised PIL (open source HPND License) & Pypdfium2 ( either Apache-2.0 or BSD-3-Clause, at your choice. ) and the code itself is released under MIT license.
Check it out - [https://github.com/bowespublishing/pythonwatermark](https://github.com/bowespublishing/pythonwatermark)
It can probably be massively improved but it works :)
## Installation
Installing the latest PyPI release (recommended)
python3 -m pip install -U pythonwatermark
This will use a pre-built wheel package, the easiest way of installing pythonwatermark.
## Dependencies
pythonwatermark uses two awesome open source python packages to work it's magic they are...
Pillow - [https://github.com/python-pillow/Pillow](https://github.com/python-pillow/Pillow)
Like PIL, Pillow is licensed under the open source HPND License
Pypdfium2 - [https://github.com/pypdfium2-team/pypdfium2](https://github.com/pypdfium2-team/pypdfium2)
PDFium and pypdfium2 are available by the terms and conditions of either Apache-2.0 or BSD-3-Clause, at your choice.
These are both fantastic packages and are liberally licensed meaning unlike with other options you don't need to release your source code to the public.
## Usage
Import watermark utils
from pythonwatermark import watermarkutils
Add watermark to file
watermarkutils.put_watermark(inputfile, outputfile, watermark,
/r/Python
https://redd.it/10hfz75
I created a small Python package to add watermarks to PDF, JPG & PNG files.
**Why?** Most Python PDF packages have licensing that requires you to release your source code which isn't ideal for everyone. In this package, I've utilised PIL (open source HPND License) & Pypdfium2 ( either Apache-2.0 or BSD-3-Clause, at your choice. ) and the code itself is released under MIT license.
Check it out - [https://github.com/bowespublishing/pythonwatermark](https://github.com/bowespublishing/pythonwatermark)
It can probably be massively improved but it works :)
## Installation
Installing the latest PyPI release (recommended)
python3 -m pip install -U pythonwatermark
This will use a pre-built wheel package, the easiest way of installing pythonwatermark.
## Dependencies
pythonwatermark uses two awesome open source python packages to work it's magic they are...
Pillow - [https://github.com/python-pillow/Pillow](https://github.com/python-pillow/Pillow)
Like PIL, Pillow is licensed under the open source HPND License
Pypdfium2 - [https://github.com/pypdfium2-team/pypdfium2](https://github.com/pypdfium2-team/pypdfium2)
PDFium and pypdfium2 are available by the terms and conditions of either Apache-2.0 or BSD-3-Clause, at your choice.
These are both fantastic packages and are liberally licensed meaning unlike with other options you don't need to release your source code to the public.
## Usage
Import watermark utils
from pythonwatermark import watermarkutils
Add watermark to file
watermarkutils.put_watermark(inputfile, outputfile, watermark,
/r/Python
https://redd.it/10hfz75
GitHub
GitHub - bowespublishing/pythonwatermark: Easily add watermarks to PDF, JPG & PNG files with no restrictive licensing
Easily add watermarks to PDF, JPG & PNG files with no restrictive licensing - GitHub - bowespublishing/pythonwatermark: Easily add watermarks to PDF, JPG & PNG files with no restric...
Experimental MiniJinja Bindings for Python
https://pypi.org/project/minijinja/0.30.1/
/r/Python
https://redd.it/10hcmdj
https://pypi.org/project/minijinja/0.30.1/
/r/Python
https://redd.it/10hcmdj
PyPI
minijinja
An experimental Python binding of the Rust MiniJinja template engine.
Am I over thinking this question?
Just for some context, this is my first coding class and read what I am supposed to read in the text book. All it taught us was how to use print and how to set up basic math.
This is the first question on the homework, this question seems complex for the first question. How am I supposed to know how to set this up with knowing little to no nothing about coding?
The US Census Bureau projects population based on the following
assumptions:
One birth every 7 seconds
One death every 13 seconds
One new immigrant every 45 seconds
Write a program to display the population for each of the next five years.
Assume the current population is 312032486 and one year has 365 days.
/r/Python
https://redd.it/10hde5l
Just for some context, this is my first coding class and read what I am supposed to read in the text book. All it taught us was how to use print and how to set up basic math.
This is the first question on the homework, this question seems complex for the first question. How am I supposed to know how to set this up with knowing little to no nothing about coding?
The US Census Bureau projects population based on the following
assumptions:
One birth every 7 seconds
One death every 13 seconds
One new immigrant every 45 seconds
Write a program to display the population for each of the next five years.
Assume the current population is 312032486 and one year has 365 days.
/r/Python
https://redd.it/10hde5l
reddit
Am I over thinking this question?
Just for some context, this is my first coding class and read what I am supposed to read in the text book. All it taught us was how to use print...
Build a custom Python linter in 5 minutes
https://blog.sylver.dev/build-a-custom-python-linter-in-5-minutes
/r/Python
https://redd.it/10hnsxq
https://blog.sylver.dev/build-a-custom-python-linter-in-5-minutes
/r/Python
https://redd.it/10hnsxq
Geoffrey Copin's Blog
Build a custom Python linter in 5 minutes
Creating a custom linter can be a great way to enforce coding standards and detect code smells. In this tutorial, we'll use Sylver, a source code query engine to build a custom Python linter in just a few lines of code.
Sylver's main interface is a R...
Sylver's main interface is a R...
Message Queueing: Using Postgres Triggers, Listen and Notify as a replacement for Celery and Signals
A common pattern in modern web development is the requirement to process data asynchronously after some user action or database event. In the article below, we describe via a concrete example a traditional approach to solving this problem for a Django/Postgres based application using django signals and Celery. We then proceed to discuss some of the shortcomings of this approach and demonstrate how using PostgreSQL triggers alongside the PostgreSQL LISTEN/NOTIFY protocol can offer a more robust solution.
Asynchronous processing of database events in a robust and lightweight manner using django-pgpubsub.
/r/django
https://redd.it/10hn5ij
A common pattern in modern web development is the requirement to process data asynchronously after some user action or database event. In the article below, we describe via a concrete example a traditional approach to solving this problem for a Django/Postgres based application using django signals and Celery. We then proceed to discuss some of the shortcomings of this approach and demonstrate how using PostgreSQL triggers alongside the PostgreSQL LISTEN/NOTIFY protocol can offer a more robust solution.
Asynchronous processing of database events in a robust and lightweight manner using django-pgpubsub.
/r/django
https://redd.it/10hn5ij
Django Project
The web framework for perfectionists with deadlines.
PyI18n - Simple and easy-to-use internationalization library
Attention all Python developers! Are you tired of struggling with internationalization in your projects? Look no further! Introducing our new Python library, PyI18n, the ultimate solution for all your internationalization needs. With easy-to-use API and detailed documentation, localizing your projects has never been easier. This library is fully compatible with the Django framework, so you can easily integrate it into your existing Django projects. Don't miss out on this powerful tool, try it out today and take your internationalization to the next level!
repository: https://github.com/sectasy0/pyi18n
/r/django
https://redd.it/10hmu3p
Attention all Python developers! Are you tired of struggling with internationalization in your projects? Look no further! Introducing our new Python library, PyI18n, the ultimate solution for all your internationalization needs. With easy-to-use API and detailed documentation, localizing your projects has never been easier. This library is fully compatible with the Django framework, so you can easily integrate it into your existing Django projects. Don't miss out on this powerful tool, try it out today and take your internationalization to the next level!
repository: https://github.com/sectasy0/pyi18n
/r/django
https://redd.it/10hmu3p
GitHub
GitHub - sectasy0/pyi18n: Small and easy to use internationalization library inspired by Ruby i18n
Small and easy to use internationalization library inspired by Ruby i18n - GitHub - sectasy0/pyi18n: Small and easy to use internationalization library inspired by Ruby i18n
Skinny models and fat views? Where should I be writing this code?
Hey folks,
I'm writing an app using Django that has fairly minimal locally stored data and is heavily dependent on hitting an external API for data, taking the returned data, manipulating it and mixing it up with locally stored object, before sending it back to the API.
I'm doing a lot of the work in my views.py file, even though what gets rendered to the client side is nearly irrelevant to the project ("here's a sign up form", "you've signed up for X" or "success, you've unsubscribed from y")
So that, combined with there being a) not a ton of local objects being used and b) a lot of taking external data and manipulating it for my needs means I'm getting relatively large views -- more logic happening there than in my models, for sure.
So I'm wondering if there's an inherent problem with writing 'skinny models, fat views' in a case like this? Or if convention or something suggests I should pull some/much of my code into a separate file (a utils.py or bad_architecture.py or whatever) file and just import at runtime? Is there any reason I should be doing that besides DRY when/if that becomes an issue?
Hopefully that makes sense
/r/django
https://redd.it/10hhe87
Hey folks,
I'm writing an app using Django that has fairly minimal locally stored data and is heavily dependent on hitting an external API for data, taking the returned data, manipulating it and mixing it up with locally stored object, before sending it back to the API.
I'm doing a lot of the work in my views.py file, even though what gets rendered to the client side is nearly irrelevant to the project ("here's a sign up form", "you've signed up for X" or "success, you've unsubscribed from y")
So that, combined with there being a) not a ton of local objects being used and b) a lot of taking external data and manipulating it for my needs means I'm getting relatively large views -- more logic happening there than in my models, for sure.
So I'm wondering if there's an inherent problem with writing 'skinny models, fat views' in a case like this? Or if convention or something suggests I should pull some/much of my code into a separate file (a utils.py or bad_architecture.py or whatever) file and just import at runtime? Is there any reason I should be doing that besides DRY when/if that becomes an issue?
Hopefully that makes sense
/r/django
https://redd.it/10hhe87
reddit
Skinny models and fat views? Where should I be writing this code?
Hey folks, I'm writing an app using Django that has fairly minimal locally stored data and is heavily dependent on hitting an external API for...
Need help with Stripe Connect onboarding using Django / DRF backend with JWT authentication
I am using Django Rest Framework to build a REST API for an expo react native mobile application and simplejwt to provide jwt authentication. Right now access tokens are sent in an Authorization header (i.e. Bearer <token> auth header). I am currently integrating with [Stripe Connect](https://stripe.com/docs/connect/collect-then-transfer-guide) and need to create both customers (users that pay) and connected accounts (users who are paid) via stripe's API and onboard them via links that the stripe API generates. During the process of onboarding a connected account we must provide [refresh and return URLS](https://stripe.com/docs/api/account_links/create?lang=python) which regenerate the onboarding URL and return the user to our application (via a deep link for instance) respectively.
import stripe
stripe.api_key = "sk_test_51M9QviJiqI7ZOGdYCVDyKVykMIEnSmGJ0dCENHRqqJKjPkhBYcgR50r71efIi6epNqHzNCxFGBeJrj6clwN9Vkok000WvY3ajz"
stripe.AccountLink.create(
account="acct_1M9QviJiqI7ZOGdY",
refresh_url="https://example.com/reauth",
return_url="https://example.com/return",
type="account_onboarding",
)
My current approach was to make a post request to an API view which creates a user account and then generates the link, sending it back to the mobile app so that it can open the link in the browser. The refresh and return links
/r/django
https://redd.it/10hnrvg
I am using Django Rest Framework to build a REST API for an expo react native mobile application and simplejwt to provide jwt authentication. Right now access tokens are sent in an Authorization header (i.e. Bearer <token> auth header). I am currently integrating with [Stripe Connect](https://stripe.com/docs/connect/collect-then-transfer-guide) and need to create both customers (users that pay) and connected accounts (users who are paid) via stripe's API and onboard them via links that the stripe API generates. During the process of onboarding a connected account we must provide [refresh and return URLS](https://stripe.com/docs/api/account_links/create?lang=python) which regenerate the onboarding URL and return the user to our application (via a deep link for instance) respectively.
import stripe
stripe.api_key = "sk_test_51M9QviJiqI7ZOGdYCVDyKVykMIEnSmGJ0dCENHRqqJKjPkhBYcgR50r71efIi6epNqHzNCxFGBeJrj6clwN9Vkok000WvY3ajz"
stripe.AccountLink.create(
account="acct_1M9QviJiqI7ZOGdY",
refresh_url="https://example.com/reauth",
return_url="https://example.com/return",
type="account_onboarding",
)
My current approach was to make a post request to an API view which creates a user account and then generates the link, sending it back to the mobile app so that it can open the link in the browser. The refresh and return links
/r/django
https://redd.it/10hnrvg
Stripe
Build a marketplace
Build a marketplace to connect sellers with customers and facilitate the exchange of physical or digital items or services.
Django-filter; creating a variable which is callable from the view
I have a filter which can be used to filter the products on brand(s), which looks like this:
​
As you can see, the brand filter returns a flat list of all possible brands in the categorie 'eiwitten'. Is there a way to make the queryset in brand a variable which I can input from my view function? This way I can use the filter for every page. Resulting in a unique brand list depending on the categorie. My view function for the 'eiwitten' page looks like this:
/r/django
https://redd.it/10houtj
I have a filter which can be used to filter the products on brand(s), which looks like this:
class SortFilter(django_filters.FilterSet): ORDER_BY_CHOICES = ( ('-discount_sort', 'Hoogste korting'), ('-new_price', 'Hoogste prijs'), ('new_price', 'Laagste prijs'), ) order_by = django_filters.ChoiceFilter(label='Sorteer op', choices=ORDER_BY_CHOICES, method='filter_by_order', empty_label=None)#HERE I WOULD LIKE THIS INPUT A VARIABLE INTO THE QUERYSET variable of the filter brand = django_filters.ModelMultipleChoiceFilter(queryset=Product.objects .order_by('brand') .filter(categorie='eiwitten') .values_list('brand', flat=True).distinct() , widget=forms.CheckboxSelectMultiple) q = django_filters.CharFilter(method='multiple_field_search', widget=TextInput(attrs= {'placeholder': 'Zoek..'})) class Meta: model = Product fields = ['brand', 'q'] def filter_by_order(self, queryset, name, value): return queryset.order_by(value) def multiple_field_search(self, queryset, name, value): return queryset.filter( Q(title__icontains=value) | Q(categorie__icontains=value) | Q(brand__icontains=value) )​
As you can see, the brand filter returns a flat list of all possible brands in the categorie 'eiwitten'. Is there a way to make the queryset in brand a variable which I can input from my view function? This way I can use the filter for every page. Resulting in a unique brand list depending on the categorie. My view function for the 'eiwitten' page looks like this:
def eiwit(request): #print(request.GET.getlist('brand')) # filter alleen eiwitproducten /r/django
https://redd.it/10houtj
reddit
Django-filter; creating a variable which is callable from the view
I have a filter which can be used to filter the products on brand(s), which looks like this: `class SortFilter(django_filters.FilterSet):` ...
Another modern game login screen!
​
https://preview.redd.it/xbhsz6ncfdda1.png?width=702&format=png&auto=webp&v=enabled&s=a2d759494c9b041ae8e26ccef13422909fdb2ec5
Complete with a random splash text every time you open the window!
Made with the amazing CustomTkinter library - https://github.com/TomSchimansky/CustomTkinter
Please let me know what you think down in the comments! \^_\^
/r/Python
https://redd.it/10hnzmn
​
https://preview.redd.it/xbhsz6ncfdda1.png?width=702&format=png&auto=webp&v=enabled&s=a2d759494c9b041ae8e26ccef13422909fdb2ec5
Complete with a random splash text every time you open the window!
Made with the amazing CustomTkinter library - https://github.com/TomSchimansky/CustomTkinter
Please let me know what you think down in the comments! \^_\^
/r/Python
https://redd.it/10hnzmn
How to Secure Sensitive data
Hello, I'm trying to create a system where someone enters data via a form and the data is then saved and emailed to users. Is there a way(s) to safely secure the data so that only those who receive the email have access to it other than using csrf token in wtforms.
/r/flask
https://redd.it/10hu03v
Hello, I'm trying to create a system where someone enters data via a form and the data is then saved and emailed to users. Is there a way(s) to safely secure the data so that only those who receive the email have access to it other than using csrf token in wtforms.
/r/flask
https://redd.it/10hu03v
reddit
How to Secure Sensitive data
Hello, I'm trying to create a system where someone enters data via a form and the data is then saved and emailed to users. Is there a way(s) to...
Sunday Daily Thread: What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/10i5ly7
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/10i5ly7
reddit
Sunday Daily Thread: What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your...
Django-axes, but for something else than failed login
Hello,
I'm currently seeking a way to temporarily ban users and/or IP, not because of failed login attempts or rate limits, but based on rules like "more than X HTTP 400 error". I'm trying to ban people that would try to play too much with my DRF rest API.
Another solution could be to handle the rule part in my validation step, and send the errors to the module so it could treat them.
If you heard about something like django-axes with admin pages, cool off, whitelist, etc. it would be great !!!
Thank you !
/r/django
https://redd.it/10i4gmq
Hello,
I'm currently seeking a way to temporarily ban users and/or IP, not because of failed login attempts or rate limits, but based on rules like "more than X HTTP 400 error". I'm trying to ban people that would try to play too much with my DRF rest API.
Another solution could be to handle the rule part in my validation step, and send the errors to the module so it could treat them.
If you heard about something like django-axes with admin pages, cool off, whitelist, etc. it would be great !!!
Thank you !
/r/django
https://redd.it/10i4gmq
reddit
Django-axes, but for something else than failed login
Hello, I'm currently seeking a way to temporarily ban users and/or IP, not because of failed login attempts or rate limits, but based on rules...
Help with workflow for Django development on a machine with Anaconda/Miniconda/Conda installed
Hey guy, i have anaconda(and conda) installed, and it is my main package manager since i use python for Data Science a lot. I've been wanting to get into Django development, but a lot of useful and cool Django packages are only available through pip. I was wondering what's the most ideal workflow for this situation.
To clarify, conda doesn't work very well with pip, since they are both different package managers with different behaviours. I found a question on another website(which i can't link because of auto moderator), but none of the answers provided seemed like a straightforward solution for daily use.
​
So i was wondering, if there's someone also using conda and Django on the same machine, what is your workflow?
Thanks :)
/r/django
https://redd.it/10i630h
Hey guy, i have anaconda(and conda) installed, and it is my main package manager since i use python for Data Science a lot. I've been wanting to get into Django development, but a lot of useful and cool Django packages are only available through pip. I was wondering what's the most ideal workflow for this situation.
To clarify, conda doesn't work very well with pip, since they are both different package managers with different behaviours. I found a question on another website(which i can't link because of auto moderator), but none of the answers provided seemed like a straightforward solution for daily use.
​
So i was wondering, if there's someone also using conda and Django on the same machine, what is your workflow?
Thanks :)
/r/django
https://redd.it/10i630h
reddit
Help with workflow for Django development on a machine with...
Hey guy, i have anaconda(and conda) installed, and it is my main package manager since i use python for Data Science a lot. I've been wanting to...
delete or hide?
i was thinking on implementing a boolean field in my models to set the record as hide whenever someone click delete,instead of entirely deleting a record.i beleive this would be a safest way to recover a record whenever a mistake happens.whats your opinion?
/r/django
https://redd.it/10ht1p0
i was thinking on implementing a boolean field in my models to set the record as hide whenever someone click delete,instead of entirely deleting a record.i beleive this would be a safest way to recover a record whenever a mistake happens.whats your opinion?
/r/django
https://redd.it/10ht1p0
reddit
delete or hide?
i was thinking on implementing a boolean field in my models to set the record as hide whenever someone click delete,instead of entirely deleting a...
Structuring a ForeignKey/M2M Query to build Context to send to Template
I have been stuck on this for a while... I am able to format the data the way I want in the view using loops and nested queries, but I can't quite figure out how to pass it to my template. I think I can build the data the way I want manually using a list of dictionaries, but I am assuming there's a better way to "chase" all the relationships to deliver everything in one data structure. I saw "through" mentioned, but could quite get it working.
​
Here's are my Models:
https://preview.redd.it/b6dv7ydc1hda1.png?width=1792&format=png&auto=webp&v=enabled&s=abb21dcaca96bfcba040ec9a593d6c40b87e0917
Here's my View which shows that I can print want I want to eventually show in the template, but how do I structure it in my view to send to HTML, since I can't run the nested query for registrations in my template.
https://preview.redd.it/1do12xua1hda1.png?width=1646&format=png&auto=webp&v=enabled&s=b36a38abc1973a95889fbc043f89ef7f3596a2ef
Any suggestions?
/r/django
https://redd.it/10i3fai
I have been stuck on this for a while... I am able to format the data the way I want in the view using loops and nested queries, but I can't quite figure out how to pass it to my template. I think I can build the data the way I want manually using a list of dictionaries, but I am assuming there's a better way to "chase" all the relationships to deliver everything in one data structure. I saw "through" mentioned, but could quite get it working.
​
Here's are my Models:
https://preview.redd.it/b6dv7ydc1hda1.png?width=1792&format=png&auto=webp&v=enabled&s=abb21dcaca96bfcba040ec9a593d6c40b87e0917
Here's my View which shows that I can print want I want to eventually show in the template, but how do I structure it in my view to send to HTML, since I can't run the nested query for registrations in my template.
https://preview.redd.it/1do12xua1hda1.png?width=1646&format=png&auto=webp&v=enabled&s=b36a38abc1973a95889fbc043f89ef7f3596a2ef
Any suggestions?
/r/django
https://redd.it/10i3fai