Anonymous
i am not getting related list in the dependent dropdown list
tfhx8
Hello
tfhx8
How make it? "vscode django model autocomplete"
tfhx8
models.Mymodel.object. here autocomplet not working
tfhx8
why?
Alex
How make it? "vscode django model autocomplete"
this group is about django. NOT about vscode or any other IDE
bahaa eddine
How can i fix this problem : Models aren't loaded yet
Alan
For the people who'd to use Mongo via Django's orm, look up djongo
bahaa eddine
how can I do this options = book.objects.filter(category=category).values('name')
Kratøs
I get this error while migrating "access denied to user 'admin'@'%' to 'database_name'" I didn't got this error when i first time connected my django project to MySQL
Ayy
How to plan out apps in a project? I'm working on something that's very role specific, like customers, sales, delivery boys will have their own separate dashboard with different functions. And then there's common stuff like payments, emails, SMS. How to divide this into various apps
b
hey guys, I've question so, we save items querying user model doing something like .. model.objects.create( model_item = value_for_it , user = req.user.userprofile ) but how can I query that when I'm using form in form we just do something like
b
in form we just do something like object.save()
Yog
Howmany of you working real-time on django? I need some help.. please ping me.
Anonymous
Can anybody guide me how to Display the text from text file i.e stored in FileField datatype I have the URL for the file But am unable to render the text on page
Yog
Who is cj?
cj
Who is cj?
it's me, why?
Mirco
Who is cj?
You don't care 😛
cj
Can anybody guide me how to Display the text from text file i.e stored in FileField datatype I have the URL for the file But am unable to render the text on page
that's an external file, so you have to read it with Phyton first, then pass the content within a context variable to your template
Ghorz
You don't care 😛
And never cares. @izznogooood on ghostmode
Anders (izzno / gooood) 🇳🇴
Wait what?
Rhythm
👀
Anders (izzno / gooood) 🇳🇴
Hah, not wrong though 😂
Ghorz
Ghost coders.
Anonymous
that's an external file, so you have to read it with Phyton first, then pass the content within a context variable to your template
Thanks.. But if I have many files and want them to render on page Getting it first in python i.e views.py and then passing it to template Will it make my site slow?
cj
Thanks.. But if I have many files and want them to render on page Getting it first in python i.e views.py and then passing it to template Will it make my site slow?
well, then you'd better display links to the external files and let the browser decide what to do with them, whether to open directly or show the user the download dialog, that way you won't slow down your templates rendering time, but you won't display the files content inside them either
Knight
Hello everyone! Glad to find this group!
Knight
How can I get currently logged in user in django? When I return request.user from login function, it returns currently logged in user. But, after logged_in when I redirect to other function(getuser) and return request.user from there, it retuns AnonymousUser. I want to upload some codeds here as a screenshot, but media is not allowed.
Bunty chhatri wala..
If request.method=='POST': is missing
Knight
Its Class based view
Or, am I missing something?
Dexter
Can anyone guide me where do I find tutorial to develop news/ecommerce web and android
Or, am I missing something?
Put....self.request.post
Aaditya
In 1st page List of lawyers is coming from database if we click on about button then it will display 2nd page which is detail of particular lawyer detail from database. Problem is how to implement this functionality in our system.
Xavier
In 1st page List of lawyers is coming from database if we click on about button then it will display 2nd page which is detail of particular lawyer detail from database. Problem is how to implement this functionality in our system.
this may not be the best way but u can make another view which takes the id of the lawyer as one of the argument then query it and display it in another page
Knight
Put....self.request.post
Sorry, but where do you mean I have to do it?
Xavier
Sorry, but where do you mean I have to do it?
put : if request.method=="POST":
Anonymous
hy can anyone guide me i want to delete child object and redirect to parent object
Anonymous
https://www.ppaste.org/10Fw163ue
Anonymous
please check my views.py
Alex
please check my views.py
Well, ur 9th row is already redirecting
Anonymous
Well, ur 9th row is already redirecting
that is for updating... its working fine,,,, but for delete cant redirect to parent.... only i can redirect to homepage
Anonymous
can i private message you alex?? so i can explain
Alex
Oh, ok
Anonymous
i have home page and customer page... i am navigating customer page using pk and in that customer page i have customer order details... so what i want to do is if i delete that order it should take me to the same customer (pk) page
Anonymous
https://www.ppaste.org/llMtkIzH6
Anonymous
my models
Anonymous
https://www.ppaste.org/zHHRpYdxd
Anonymous
my urls
Alex
def deleteorder(request, pk): order = Order.objects.get(pk=pk) customer = order.customer order.delete() redirect('to-customer', args=(customer.pk,))
Anonymous
https://www.ppaste.org/5qNGJBVgc
Anonymous
please check my customer template also
Alex
NoReverseMatch at /delete_order/66
I just answered particular question. Not production grade code. XD
Alex
man, you are trying to sit down on my neck
Anonymous
😆😆😆😆
Anonymous
ok sorry for if its irritating 😝😝
Aryal S
I want to learn django deeply from where can i start.?
Doragonsureiyā
I want to learn django deeply from where can i start.?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Paschaljet
Please is necessary to class based view in some cases or can all class based view be in form of function based view perfectly?
Alex
FBV are perfectly fine
Alex
nope fbv is fine too
hey! You stole my sentence!
Xavier
hey! You stole my sentence!
how much do i owe you ;)
Paschaljet
Elaborate
Can all class based view be written perfectly as function based view or is it necessary to use class based view in some cases?
JP
To write a CBV is good for DRY approach, also it is considered as function inside when it is being executed. To write FBV is depends on your requirement and ease of convenience.
Alex
Can you help organize this view as a function based view.... Its been giving me hard time
I think it is a workout that you should do by your own. Read django docs - they cover this matter very good.
JP
If it is using a implicit functionality and working on overriding of super class's method then we have to check ..