Re: Accessing child relations when overriding save()

2019-02-10 Thread Shashank Singh
And how? On Sun, 10 Feb, 2019, 9:23 PM Shashank Singh When do you create child objects?? > > On Sun, 10 Feb, 2019, 9:17 PM Nick Emery >> Tried this too but save() never actually gets called on the child (it >> seems that the foreign key field of the child is updated at the database >> level and

Re: Accessing child relations when overriding save()

2019-02-10 Thread Shashank Singh
When do you create child objects?? On Sun, 10 Feb, 2019, 9:17 PM Nick Emery Tried this too but save() never actually gets called on the child (it > seems that the foreign key field of the child is updated at the database > level and never goes through the Django orm Child). > > On Sunday,

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-10 Thread Simon A
Hi guys, Please correct me if my thought process is wrong. Here is what I am trying to achieve, in order for me to save the password generated before saving the new password to the system, I have to somehow override the existing process. Which is by subclassing the PasswordChangeView. As I

Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
I am trying to wrap up my first app using Django (specifically Django Rest Framework which may change the save behavior), but have run into an issue that I haven't been able to solve for about 10 hours now. I am trying to override the save() method of a model to modify a field on a bunch of

Re: Accessing child relations when overriding save()

2019-02-10 Thread Shashank Singh
Override the save() of the child? On Sun, 10 Feb, 2019, 7:04 PM Nick Emery I am trying to wrap up my first app using Django (specifically Django > Rest Framework which may change the save behavior), but have run into an > issue that I haven't been able to solve for about 10 hours now. > > I am

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
The child objects are created separately beforehand with NULL parents (they don't have to have parents, they can be orphans). One other thing I noticed is that looking at the SQL statements executed by my app I can't even see the UPDATE on the foreign keys of the children (even though I KNOW

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
Tried this too but save() never actually gets called on the child (it seems that the foreign key field of the child is updated at the database level and never goes through the Django orm Child). On Sunday, February 10, 2019 at 8:37:54 AM UTC-5, Shashank Singh wrote: > > Override the save() of

Re: Accessing child relations when overriding save()

2019-02-10 Thread Nick Emery
UPDATE: Finally figured it out! I ultimately did this by overriding `perform_create()` in my [Django Rest Framework view](https://www.django-rest-framework.org/api-guide/generic-views/) and making my changes after saving the object. On Sunday, February 10, 2019 at 8:34:44 AM UTC-5, Nick Emery

Inlineformset parameter for a queryset

2019-02-10 Thread Gerson David Vizquel Alemán
Hello I resort to this medium because I have already invested a lot of time looking for the solution and I can not find it. I have two questions, one of the two will help me to solve an approach that I have: 1.- How can I pass parameters to the inlineformset? 2.- How can I read the value of a

“python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread Dom Delbuco
I'm new to Python and Django, I watched a tutorial that requires me to have Django 2.1. When I type in "python -m django --version" - my Ubuntu terminal says 1.11.18 But, when I type "django-admin --version" - terminal says 2.1 This didn't bother me until I reached part 6 of this series, I'm

Re: Admin form_url breakout problem

2019-02-10 Thread Mike Dewhirst
Matthew I think a workaround would be to reload the admin urls after each Stripe transaction. I don't know how to do that after looking at options.py etc. I know I'm doing something adverse and it is spoiling the admin urls because the url in the address bar is correct but the page contents

Re: Accessing child relations when overriding save()

2019-02-10 Thread Mike Dewhirst
On 10/02/2019 6:22 pm, Nick Emery wrote: I am trying to wrap up my first app using Django (specifically Django Rest Framework which may change the save behavior), but have run into an issue that I haven't been able to solve for about 10 hours now. I am trying to override the save() method of

Upgrading project from Django 1.11 to 2.1

2019-02-10 Thread Mike Dewhirst
Is it safe/advisable to globally replace six.text_types( with str( Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-10 Thread Jason
ClassyCBV doesn't contain everything in django, so that is probably related to your confusion. In classycbv PasswordChangeView's attributes, you can see form_class = which is what is called in PCV's Post handler

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-10 Thread Simon A
Hi Jason, Thank you for your response, really appreciate the help. I was working on your suggestion but then stumbled across django-password-validators which seems to do the required task for me. For now I will go with this one. But I will surely include the github for django when learning

Re: “python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread sachin thakur
Uninstall the 1.11.18 and install 2.1 On Mon 11 Feb, 2019, 9:08 AM JP Smith I know that you are new so, I don't want to overwhelm you. One thing that > you might want to look into is pip, which is a package management tool for > python. This will allow you to install python packages and keep

Re: “python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread JP Smith
I know that you are new so, I don't want to overwhelm you. One thing that you might want to look into is pip, which is a package management tool for python. This will allow you to install python packages and keep them up-to-date. The if you want to take a more manual approach, you could

Re: How to display file tree using Django. Help, please!

2019-02-10 Thread Derek
There are a number of custom Django apps that can do something like, for example: https://github.com/IMGIITRoorkee/django-filemanager (or look here https://djangopackages.org/grids/g/file-managers/ for more) On Friday, 8 February 2019 14:24:01 UTC+2, Yura wrote: > > Hello everyone! I really

Upgrading project from Django 1.11 to 2.1

2019-02-10 Thread PARTH PATIL
Six.text_types is used to represent unicode() in python2 and str in python3. And now you are only using python3, it would be safe to replace it with str() -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop