ModelForm.save() not creating a new row in the DB
For some reason, using the command in the title overwrites the same row instead of creating a new one and increment the id.
I've posted the code on [Stack Overflow](https://stackoverflow.com/questions/50841225/form-save-populates-lates-row-instead-of-creating-a-new-django)
Since I do not get any error message, searching for solutions has been hard.
Thanks in advance.
/r/djangolearning
https://redd.it/8r9uwd
For some reason, using the command in the title overwrites the same row instead of creating a new one and increment the id.
I've posted the code on [Stack Overflow](https://stackoverflow.com/questions/50841225/form-save-populates-lates-row-instead-of-creating-a-new-django)
Since I do not get any error message, searching for solutions has been hard.
Thanks in advance.
/r/djangolearning
https://redd.it/8r9uwd
Stack Overflow
form.save() populates lates row instead of creating a new - Django
I'm trying to create a Klient with a post statement, but instead of creating a new row in the DB it replaces the latest one.
The point of my view is to create two models from one POST. Eventually ...
The point of my view is to create two models from one POST. Eventually ...
Adding a search option for the Mezzanine page tree
Could anybody give me some guidance on how to add a search option for the Messanine page tree (in admin section). I'm looking in to converting a wordpress app in to Mezzanine/Django which has \~2000+ hierarchical articles in it. So to make it usable I need to provide a search option.
I looked at the related template file (mezzanine/pages/templates/admin/pages/page/change\_list.html) and it just have following code block.
`{% block content %}`
`<div id="content-main">`
`{% if has_add_permission %}`
`{% include "admin/includes/content_typed_change_list.html" %}`
`{% endif %}`
`{% if cl.result_count == 0 %}`
`<p class="paginator">0 {{ cl.opts.verbose_name_plural }}</p>`
`{% else %}`
`<div id="tree">{% page_menu "pages/menus/admin.html" %}</div>`
`{% endif %}`
`</div>`
`{% endblock %}`
/r/django
https://redd.it/8rc06h
Could anybody give me some guidance on how to add a search option for the Messanine page tree (in admin section). I'm looking in to converting a wordpress app in to Mezzanine/Django which has \~2000+ hierarchical articles in it. So to make it usable I need to provide a search option.
I looked at the related template file (mezzanine/pages/templates/admin/pages/page/change\_list.html) and it just have following code block.
`{% block content %}`
`<div id="content-main">`
`{% if has_add_permission %}`
`{% include "admin/includes/content_typed_change_list.html" %}`
`{% endif %}`
`{% if cl.result_count == 0 %}`
`<p class="paginator">0 {{ cl.opts.verbose_name_plural }}</p>`
`{% else %}`
`<div id="tree">{% page_menu "pages/menus/admin.html" %}</div>`
`{% endif %}`
`</div>`
`{% endblock %}`
/r/django
https://redd.it/8rc06h
reddit
r/django - Adding a search option for the Mezzanine page tree
0 votes and 0 so far on reddit
Using jQuery to Auto refesh blog on update.
I need to use jQuery to check if my blog was updated and then to refresh the page if it has.
I see plenty of tutorials on how to do this using a php back end.
but I don't know jQuery well enough to make it work with Django.
/r/django
https://redd.it/8rdxqr
I need to use jQuery to check if my blog was updated and then to refresh the page if it has.
I see plenty of tutorials on how to do this using a php back end.
but I don't know jQuery well enough to make it work with Django.
/r/django
https://redd.it/8rdxqr
reddit
r/django - Using jQuery to Auto refesh blog on update.
0 votes and 3 so far on reddit
[P]I made a GPU cluster and free website to help detecting and classifying breast mammogram lesions for general public
https://imgur.com/gallery/PuWx39O
/r/MachineLearning
https://redd.it/8rdpwy
https://imgur.com/gallery/PuWx39O
/r/MachineLearning
https://redd.it/8rdpwy
Imgur
I made a GPU cluster and free website to help detecting and classifying breast mammogram lesions for general public - Album on…
Post with 17 votes and 4078 views. Shared by coolwulf. I made a GPU cluster and free website to help detecting and classifying breast mammogram lesions for general public
Why do you need to check if user entered an email when creating their account? (Custom User)
I'm creating a custom user, mostly because I want the email to be used for logging in instead of a username. As I understand, `USERNAME_FIELD = 'EMAIL_FIELD'` already makes the email required. So, why do the docs say you should write in the Custom User Manager inside of the create\_user method:
if not email:
raise ValueError("Users must have an email address")
Isn't it redundant to do that check when it's already required because the email is used by USERNAME\_FIELD?
I would also like to quickly confirm that there are no is\_admin, last\_login, etc properties that comes with AbstractBaseUser? You have to create all these properties by yourself and then create methods for them as well which for example update last\_login every time user logs in.
/r/djangolearning
https://redd.it/8rd3r2
I'm creating a custom user, mostly because I want the email to be used for logging in instead of a username. As I understand, `USERNAME_FIELD = 'EMAIL_FIELD'` already makes the email required. So, why do the docs say you should write in the Custom User Manager inside of the create\_user method:
if not email:
raise ValueError("Users must have an email address")
Isn't it redundant to do that check when it's already required because the email is used by USERNAME\_FIELD?
I would also like to quickly confirm that there are no is\_admin, last\_login, etc properties that comes with AbstractBaseUser? You have to create all these properties by yourself and then create methods for them as well which for example update last\_login every time user logs in.
/r/djangolearning
https://redd.it/8rd3r2
reddit
r/djangolearning - Why do you need to check if user entered an email when creating their account? (Custom User)
4 votes and 0 so far on reddit
Python: Picking random events for a game: developing the algorithm
https://www.youtube.com/attribution_link?a=nFfXgy6jLKE&u=%2Fwatch%3Fv%3DVU7FrkV0ha4%26feature%3Dshare
/r/Python
https://redd.it/8rfckc
https://www.youtube.com/attribution_link?a=nFfXgy6jLKE&u=%2Fwatch%3Fv%3DVU7FrkV0ha4%26feature%3Dshare
/r/Python
https://redd.it/8rfckc
YouTube
Python: Picking random events for a game: developing the algorithm
This video walks though developing code to pick random events where the events have different probabilities. This could be used in games, simulations, or pic...
Made a CLI for the World Cup simple but does its job!
https://github.com/SkullCarverCoder/wc18-cli
/r/Python
https://redd.it/8rdzzz
https://github.com/SkullCarverCoder/wc18-cli
/r/Python
https://redd.it/8rdzzz
GitHub
SkullCarverCoder/wc18-cli
wc18-cli - An easy command line interface for the 2018 World Cup
How to build a twitter clone using Django 2.0 - part one
https://ahackersday.com/blog/djitter-how-to-build-a-twitter-clone-using-django-2-0-part-one/
/r/djangolearning
https://redd.it/8rhure
https://ahackersday.com/blog/djitter-how-to-build-a-twitter-clone-using-django-2-0-part-one/
/r/djangolearning
https://redd.it/8rhure
A Hacker's Day
Djitter - how to build a twitter clone using Django 2.0 - Part one | A Hacker's Day
In the first part of this series we will go through how you're setting up a Django project.
Which javascript to use on the front end?
I've come a grudging acceptance that I will have to learn and add some javascript to a little personal project that I've been using to learn a few things as I go along. And I'm sure this comes up a lot, I'm just having trouble finding something relevant.
If I wanted to add a little bit of interactivity on pages, what is the best route to go down. Vanilla Javascript? JQuery? Can Vue be used for just scripts or does it have to be used as a full on framework? Something I'm not aware of?
/r/flask
https://redd.it/8rcjof
I've come a grudging acceptance that I will have to learn and add some javascript to a little personal project that I've been using to learn a few things as I go along. And I'm sure this comes up a lot, I'm just having trouble finding something relevant.
If I wanted to add a little bit of interactivity on pages, what is the best route to go down. Vanilla Javascript? JQuery? Can Vue be used for just scripts or does it have to be used as a full on framework? Something I'm not aware of?
/r/flask
https://redd.it/8rcjof
reddit
r/flask - Which javascript to use on the front end?
7 votes and 17 so far on reddit
Django Or Rails
Hi currently I am using Rails to develop web apps, I want to know more what makes Django better than Rails
the first time I tried Django I feel like there is a lot magic syntax that I never know when using rails
Can someone give me a suggestion what make Django the best and what do people usually use Django for?
m
/r/django
https://redd.it/8rhy19
Hi currently I am using Rails to develop web apps, I want to know more what makes Django better than Rails
the first time I tried Django I feel like there is a lot magic syntax that I never know when using rails
Can someone give me a suggestion what make Django the best and what do people usually use Django for?
m
/r/django
https://redd.it/8rhy19
reddit
r/django - Django Or Rails
3 votes and 6 so far on reddit
Converting an exe back to .py
hi guys,
I got discord bot created in python by someone few months ago, coder at that time just converted that to an exe file so its easy for me to run it. Now my coder has disappeared and i can not find him and i need to make small adjustments to script.
Is there a way to convert that .exe back to .py ?
Thanks,
/r/Python
https://redd.it/8rh2x2
hi guys,
I got discord bot created in python by someone few months ago, coder at that time just converted that to an exe file so its easy for me to run it. Now my coder has disappeared and i can not find him and i need to make small adjustments to script.
Is there a way to convert that .exe back to .py ?
Thanks,
/r/Python
https://redd.it/8rh2x2
reddit
r/Python - Converting an exe back to .py
12 votes and 10 so far on reddit
Will the mega tutorial help me learn how to build more interactive apps than something like a blog?
I'm finished about a quarter of the mega tutorial and while it's very good, it also seems to be primarily focused on creating kind of a barebones blog style app without lots of user interactivity going on. My end goal is to make a speed reading app that can take text from an outside source (probably going to start with just taking wikipedia articles) and spacing the words into chunks of words you can read one at a time
ex: so instead of reading this word for word
[you would] [read it like] [this and] [read faster]
and maybe having every block highlighted with a different color.
Do you guys think the mega tutorial could help satisfy this?
/r/flask
https://redd.it/8rcebx
I'm finished about a quarter of the mega tutorial and while it's very good, it also seems to be primarily focused on creating kind of a barebones blog style app without lots of user interactivity going on. My end goal is to make a speed reading app that can take text from an outside source (probably going to start with just taking wikipedia articles) and spacing the words into chunks of words you can read one at a time
ex: so instead of reading this word for word
[you would] [read it like] [this and] [read faster]
and maybe having every block highlighted with a different color.
Do you guys think the mega tutorial could help satisfy this?
/r/flask
https://redd.it/8rcebx
reddit
r/flask - Will the mega tutorial help me learn how to build more interactive apps than something like a blog?
9 votes and 10 so far on reddit
Django Graphene tutorial question
I went through the graphene tutorial and using relays. But I have am a bit confused on one thing
If you go through the normal tutorial when you do single queries the query part is defined by
class Query(object):
category = graphene.Field(CategoryType,
id=graphene.Int(),
name=graphene.String())
If you do the one with relay the query part is defined as
class Query(object):
category = relay.Node.Field(CategoryNode)
If I want both features (single queries and filters from relays) does that mean I have to define a new variable for one to have both features? or do I just used relays and somehow the typings for the fields are inherited. I am just kind of confused by the ambiguous way the tutorials are written.
/r/djangolearning
https://redd.it/8rhl1p
I went through the graphene tutorial and using relays. But I have am a bit confused on one thing
If you go through the normal tutorial when you do single queries the query part is defined by
class Query(object):
category = graphene.Field(CategoryType,
id=graphene.Int(),
name=graphene.String())
If you do the one with relay the query part is defined as
class Query(object):
category = relay.Node.Field(CategoryNode)
If I want both features (single queries and filters from relays) does that mean I have to define a new variable for one to have both features? or do I just used relays and somehow the typings for the fields are inherited. I am just kind of confused by the ambiguous way the tutorials are written.
/r/djangolearning
https://redd.it/8rhl1p
reddit
r/djangolearning - Django Graphene tutorial question
1 votes and 0 so far on reddit
How to build a twitter clone using Django 2.0 - part one
https://ahackersday.com/blog/djitter-how-to-build-a-twitter-clone-using-django-2-0-part-one/
/r/django
https://redd.it/8ri49m
https://ahackersday.com/blog/djitter-how-to-build-a-twitter-clone-using-django-2-0-part-one/
/r/django
https://redd.it/8ri49m
A Hacker's Day
Djitter - how to build a twitter clone using Django 2.0 - Part one | A Hacker's Day
In the first part of this series we will go through how you're setting up a Django project.
Tensorflow seq2seq Text Summarization.
https://github.com/dongjun-Lee/text-summarization-tensorflow
/r/MachineLearning
https://redd.it/8rj7nt
https://github.com/dongjun-Lee/text-summarization-tensorflow
/r/MachineLearning
https://redd.it/8rj7nt
GitHub
GitHub - dongjun-Lee/text-summarization-tensorflow: Tensorflow seq2seq Implementation of Text Summarization.
Tensorflow seq2seq Implementation of Text Summarization. - dongjun-Lee/text-summarization-tensorflow
Masonite 2.0 Released - The Modern Python Web Framework!
I posted about the Masonite Python web framework a few months ago on this /r/python here and it received interesting feedback. During this time we received a few contributors who are just super awesome and contributed some awesome features.
We also were able to boost the speed of the framework to serve about twice as many requests in 30 seconds as Masonite 1.6 using some \`wrk\` benchmark testing.
Our contributors are extremely excited for this release and we can't wait to show it to the Python community. We think many of you will love the framework.
Here are a few useful links to checkout the framework:
The Github Repo: [https://github.com/MasoniteFramework/masonite](https://github.com/MasoniteFramework/masonite)
The Documentation: [https://docs.masoniteproject.com/prologue/introduction-and-installaton](https://docs.masoniteproject.com/prologue/introduction-and-installaton)
Whats New in Masonite 2.0: [https://docs.masoniteproject.com/whats-new/masonite-2.0](https://docs.masoniteproject.com/whats-new/masonite-2.0)
The Core Repository: [https://github.com/MasoniteFramework/core](https://github.com/MasoniteFramework/core)
Creating Your First Blog: [https://docs.masoniteproject.com/creating-your-first-blog/introduction](https://docs.masoniteproject.com/creating-your-first-blog/introduction)
Feedback for the Masonite community is appreciated and we'll be watching this thread for your thoughts on the framework! We hope to see you guys create some awesome web applications!
/r/Python
https://redd.it/8rjla6
I posted about the Masonite Python web framework a few months ago on this /r/python here and it received interesting feedback. During this time we received a few contributors who are just super awesome and contributed some awesome features.
We also were able to boost the speed of the framework to serve about twice as many requests in 30 seconds as Masonite 1.6 using some \`wrk\` benchmark testing.
Our contributors are extremely excited for this release and we can't wait to show it to the Python community. We think many of you will love the framework.
Here are a few useful links to checkout the framework:
The Github Repo: [https://github.com/MasoniteFramework/masonite](https://github.com/MasoniteFramework/masonite)
The Documentation: [https://docs.masoniteproject.com/prologue/introduction-and-installaton](https://docs.masoniteproject.com/prologue/introduction-and-installaton)
Whats New in Masonite 2.0: [https://docs.masoniteproject.com/whats-new/masonite-2.0](https://docs.masoniteproject.com/whats-new/masonite-2.0)
The Core Repository: [https://github.com/MasoniteFramework/core](https://github.com/MasoniteFramework/core)
Creating Your First Blog: [https://docs.masoniteproject.com/creating-your-first-blog/introduction](https://docs.masoniteproject.com/creating-your-first-blog/introduction)
Feedback for the Masonite community is appreciated and we'll be watching this thread for your thoughts on the framework! We hope to see you guys create some awesome web applications!
/r/Python
https://redd.it/8rjla6
GitHub
GitHub - MasoniteFramework/masonite: The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and…
The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Discord channel for questions: https://discord.gg/TwKeFahmPZ - MasoniteFramework/masonite
Help with using public APIs
Edit-
day=datetime.datetime.today().strftime('%Y-%m-%d')#Get Todays Date, Daily Setting
my problem is below this
url = "https://demo.docusign.net/restapi/v2/accounts/"+accountId+"/envelopes"
querystring = {"from_date":Date,"status":"completed"}#if Envelope is completed
headers = { 'X-DocuSign-Authentication': "{\"Username\":\""+ email +"\",\"Password\":\""+Password+"\",\"IntegratorKey\": \""+IntegratorKey+"\"}", 'Content-Type': "application/json", 'Cache-Control': "no-cache", 'Postman-Token': "e53ceaba-512d-467b-9f95-1b89f6f65211" }
**my problem above this **
''' Envelope Response ''' response = requests.request("GET", url, headers=headers, params=querystring) envelopes=response.text
I currently have a python 3 program on my desktop. I run it with idle and everything is how I want it. What I want to do with Django is use this code to print its outputs on a webpage and have the user download it’s additional csv file output. I have managed to make a Django localhost and I am stuck at that point. I do not know how to use my python 3 code to run to webpage. The code is made up of api calls , I use postman to help me with sending the right parameters. I will add a example of code. All I want is for user to enter value such as “accountID” so that the api can complete the request and give them data for their own request. I would highly appreciate help on this
I have been trying for hours, from my understanding I have to make a view then send to HTML template
/r/django
https://redd.it/8ri846
Edit-
day=datetime.datetime.today().strftime('%Y-%m-%d')#Get Todays Date, Daily Setting
my problem is below this
url = "https://demo.docusign.net/restapi/v2/accounts/"+accountId+"/envelopes"
querystring = {"from_date":Date,"status":"completed"}#if Envelope is completed
headers = { 'X-DocuSign-Authentication': "{\"Username\":\""+ email +"\",\"Password\":\""+Password+"\",\"IntegratorKey\": \""+IntegratorKey+"\"}", 'Content-Type': "application/json", 'Cache-Control': "no-cache", 'Postman-Token': "e53ceaba-512d-467b-9f95-1b89f6f65211" }
**my problem above this **
''' Envelope Response ''' response = requests.request("GET", url, headers=headers, params=querystring) envelopes=response.text
I currently have a python 3 program on my desktop. I run it with idle and everything is how I want it. What I want to do with Django is use this code to print its outputs on a webpage and have the user download it’s additional csv file output. I have managed to make a Django localhost and I am stuck at that point. I do not know how to use my python 3 code to run to webpage. The code is made up of api calls , I use postman to help me with sending the right parameters. I will add a example of code. All I want is for user to enter value such as “accountID” so that the api can complete the request and give them data for their own request. I would highly appreciate help on this
I have been trying for hours, from my understanding I have to make a view then send to HTML template
/r/django
https://redd.it/8ri846
Beyond Unit Tests: Taking Your Testing to the Next Level
https://www.youtube.com/watch?v=ySGyHHVS6mI
/r/Python
https://redd.it/8rlnh5
https://www.youtube.com/watch?v=ySGyHHVS6mI
/r/Python
https://redd.it/8rlnh5
YouTube
Beyond Unit Tests: Taking Your Testing to the Next Level
You've used pytest and you've used mypy, but bugs are still slipping through your code. What's next? In this talk, we cover two simple but powerful tools for...
Good flask apps to study from?
I'm about a quarter of the way done with the mega tutorial and want to see if I know just enough to get my hands dirty. I want to build something more engaged than a blog site (in particular I'm trying to build a speed reading saccade app) and I'm looking for any potential fully developed flask apps on github and such that I could study from.
/r/flask
https://redd.it/8rmqyg
I'm about a quarter of the way done with the mega tutorial and want to see if I know just enough to get my hands dirty. I want to build something more engaged than a blog site (in particular I'm trying to build a speed reading saccade app) and I'm looking for any potential fully developed flask apps on github and such that I could study from.
/r/flask
https://redd.it/8rmqyg
reddit
r/flask - Good flask apps to study from?
1 votes and 0 so far on reddit