Shubham
Hi guys! Any tutorial link for Rest framework? Probably Video tutorial
Shubham
If I had got updated series i wouldn't have asked... Don't you think? 🤔
Shubham
JustDganjo guy had the best series... But no idea why he stopped all of sudden
Gourav
So you need optimisation? Have you tried to mesure why it takes much time? Maybe there are tons of sql-queries with hundreds duplications?
No I just want to learn. How can I create full project on microservices. Because this architecture using by Netflix and microservices using Django. It is also a growing server architecture https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F011spz0k,Monolith
Gourav
No there is no running project I am just learning this architecture in my free time
Gigil
Have any one tried integrating payment gateway using payu money? I didn't get any good documentation for it.
Derek
Ok guys, can I ask question related to URL in Django? I tried to google solution for myself. Answers I find is not exactly what I looked for. I know it has to be simple, so all apologies, but I really didn't find what I need. So when new user is registered and form.is_valid (https://dpaste.org/GwNp#L14) User will be guided to "success.html" and url link is stays as it is /registatrion. Long story short after registration customer receive HTML code from success.html on the same url related to registration. If customer will try to refresh page he will receive prompt to resend form and I don't want it to be like that. I know that I can change endpoint to URL instead of just HTML code, but what to do if I don't want to make additional URL because I don't want to let possibility to access to success page through site.com/success and I don't want browser to offer customer to resend form when he refresh page if this is html? Is this even an issue or this is should work this way or I need to create URL where customer will be redirected? What personally you use to let customer know he successfully registered and now he need to sign in
Anish
hello guys , i created a custom registration and login form and i want to use reset password and change password from django.contrib.auth.urls i dont want to use login and logout urls which is provided by django.contrib.auth.urls , can i do that ?? By defalut django.contrib.auth.urls provides login , logout , password reset and password change urls and handle it by own but i don't want to use login and logout because i have created methods for login and logout. thanks in advance
Derek
maybe u can insert this tag <meta http-equiv="Refresh" content="2;url=https://loginpage" /> into success page?
This is actually a good decision. Thank you, Sir. Browser is actually still offer to resend form but will transfer customer to sign in page faster than customer can make mistake and "resend form", but prompt still appear and prompt will still transfer customer to registration form if he somehow managed to press button fast. But this actually can be used to provide better experience and protect customer from himself. I will try to somehow make it faster
Derek
thank you for you assistance!
Derek
TBH, I can seriously see this solution to work in real life. It is actually look good. It's not perfect but it is much butter than only .html and it is actually protect user from himself. Great! It does his work! Thank you one more time, Sir!
0xky1e (けち)
glad u found it helpful😉
Anonymous
How can i display incoming json data on the webpage?
Yash
After deleting a model instance, I want to save that deleted instance in other model, so is their any other way except creating the same model with same attributes?
PV
After deleting a model instance, I want to save that deleted instance in other model, so is their any other way except creating the same model with same attributes?
You can add additional model field as deleted and set it as false by default, and when you want to delete the instance, update the instance by changing deleted as true, that way the data will not go anywhere and you can retrieve it wherever you want
Yash
You can add additional model field as deleted and set it as false by default, and when you want to delete the instance, update the instance by changing deleted as true, that way the data will not go anywhere and you can retrieve it wherever you want
Hmm yes I thought of that, but still the data won't be deleted and I have to do this - MyModel.objects.filter(deleted=False) everywhere in my project code which would be quite clumsy as MyModel is heavily used in my project
Dhruva
module 'djangi.db.models' has no attribute Textarea
Dhruva
How to resolve this error
cj
How to resolve this error
read again that line carefully, char by char
Dhruva
Textarea is in forms not in models
So what to write for models
Dhruva
I have mentioned textarea in forms
Dhruva
So it should map
Yash
you can simply override delete method
what logic should I use in override method though?
cj
So it should map
so you want TextField in the models
Alex
what logic should I use in override method though?
https://lmgtfy.com/?q=django+delete+override
PV
And Textarea() in forms
Alex
lmao I didn't mean that
Yeah, you ment that I should spoonfeed you the anwser. No, that not gonna work.
Yash
Yeah, you ment that I should spoonfeed you the anwser. No, that not gonna work.
I didn't mean that too. I was asking if I have create new model again with same attribute and save the deleted object to model in override method. But 10/10 for the efforts in lmgtfy though
Gio
is this chat deleting messages time to time ? i am asking because stats show so
Gio
Bot does
that means if someone already shared their knowledge about something i have to ask again
Gio
are photos urls and files also deleted?
Valery
Hello. How can I get related objects in last model in example? class Base(models.Model): name = models.CharField(max_length=300) class Sub(models.Model): base = models.ForeignKey(Base, on_delete=models.CASCADE, related_name='sub') class SubSub(models.Model): sub = models.ForeignKey(Sub, on_delete=models.CASCADE, related_name='subsub') # obj = Base(name='base') # obj.sub.subsub
Mirco
!rules
Doragonsureiyā
Read the rules before any activity: @PythonRules
Alex
If an answer is deleted, it was likely the one who sent it
Gio
https://pastebin.com/dijcgJv5
it has to be something like obj__dept__address
Alex
https://pastebin.com/dijcgJv5
kinda depts = school.dept_set.all(); for dept in depts: dept.address_set.all()
Anonymous
https://stackoverflow.com/questions/17359790/how-to-restrict-foreign-key-choices-to-another-foreign-key-in-the-same-model
Alex
then use them instead of *_set
Gio
https://pastebin.com/dijcgJv5
https://docs.djangoproject.com/en/3.0/topics/db/queries/#lookups-that-span-relationships this describes much better than my broken english
Alex
Someone up to now this procedure done?
I think you don't understand how relational db work.
Anonymous
class Province(models.Model): name class City(models.Model): name province= foreign key class Trip_plan(models.Model): province=foreign key city=foreign key, limit_choices_to={'province': province}
Anonymous
Like this, for when in the panel admin of that model, we use the
Valery
kinda depts = school.dept_set.all(); for dept in depts: dept.address_set.all()
Many thanks. It works. Is it normal to get objects to serialize in this way?
Alex
Many thanks. It works. Is it normal to get objects to serialize in this way?
I would say that if you have a highload service - not at all. But what is your main goal?
Valery
I just need to display the school and all address objects on the main page. And the addresses do not have FK to the school. This is an example. A bunch of models is longer)
Valery
Super. This is what I need. Thanks a lot!
Alex
Hey, can help me anyone? I need make some function which will create instance of the model and change only one field other model. Can't find some decision in google
Alex
Hey, can help me anyone? I need make some function which will create instance of the model and change only one field other model. Can't find some decision in google
I would strongly advice you to rewrite your message by google translate. I really dont understand what you are saying. Or provide some pseudocode.
Gio
do you use drf? django rest framework or django itelf?
Alex
Not drf
Dhruva
In wizard form how can we add the FileField
Gio
Not drf
https://docs.djangoproject.com/en/3.0/ref/models/querysets/#update
Vorke
Hi everyone, wanted a tutorial on django and vuejs using jwt, someone please point me to a good tutorial
Alex
We are not going to search for you. We are experienced developers who develope and maintain such libraries and framworks.
Vorke
Reason i asked is the ones i found online were more of continuations
Vorke
But thanks anyways