inchidi
totally agreed! but that would be custom user model. though depends upon project whatever is used.
then how's your approach to do that without custom user model?
A.M
Iam having difficulty understanding dtl, anyone having resources for that
Alex
Iam having difficulty understanding dtl, anyone having resources for that
sure https://docs.djangoproject.com/en/3.0/ref/templates/language/
Xavier
ArrayField
also note it's a postgres specific model (wont work with default sql)
Siddharthan
How to use {{form.errors}} in template please give me an example
Xavier
How to use {{form.errors}} in template please give me an example
https://docs.djangoproject.com/en/3.0/topics/forms/ this got ample amount of examples
Zhumakhan
How to store list data in model
in another model, add id of your model to new model as foreignkey
Anonymous
I need some help
Hello world
Hello guys i received url from html page using request.POST.get("url") now i want to visit that url how to visit that url reverse or redirect or which method i use to visit that url
Hello world
thank you
Hello world
redirect work🤟
PA
I am going to create a Customer management web app using Django so how much should I sell it for?
Pavel
Hi everyone. Is it possible to merge two forms media in a template UPD: I have 2 forms. Each of them has own form media. It's both in layout.html. One of them is gotten via context_processor. View don't know about it. Both could contain the same media (Select2). How to get ride of doubling select2 media?
Phani
Hii guys please help me out with this: A drop down is present in the front end. And a table containing data is saved in the MySQL database. How can we display the data in the table, inside the drop-down. Please help me out with this
Phani
Would you please send any reference file...
Biswajeet
Would you please send any reference file...
https://www.quora.com/How-do-I-populate-a-Django-dropdown-list-from-MySQL-database-in-Python
Phani
Thank you guys😊
Luciano
Hello! how are you? I'm learning Django and there are some things that i'm confused about! https://dpaste.org/gNcR#L16 I need to generate what I think its called inline formsets for ReportPictures model but: - I need to create a new record of Report model but associate it under current user relationship when processing the form on server side. - I would like to have one Report form and multiple inlines for ReportPictures(so that way i can add multiple pictures of that report) Hope it makes sense to you and thanks a lot in advance!!!!
Alex
Hi everyone. Is it possible to merge two forms media in a template UPD: I have 2 forms. Each of them has own form media. It's both in layout.html. One of them is gotten via context_processor. View don't know about it. Both could contain the same media (Select2). How to get ride of doubling select2 media?
As far as I know there is no way to have multiple media attribute on a form. If you need both of them, you have to call each media attr separatly or create a new form class and explicetly describe content of combined media/
Rohan
How to display the data stored in db if we increment it?
Rajvir
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\lib\site-packages\rest_framework\utils\model_meta.py", line 83, in _get_pk while pk.rel and pk.rel.parent_link: AttributeError: 'AutoField' object has no attribute 'rel' Help
Alex
My own app, in a view
https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/#inline-formsets I think in your case it should be something like this ReportFormSet = inlineformset_factory(Report, ReportPictures, fields=('foto',))
Xavier
How to display the data stored in db if we increment it?
i mean go to the docs the first page is about it
Luciano
Sure, but, how do I associate the current user to Report foreign key "user"? Thanks a lot for your help Alex!
I just figured out my own error... I was doing this: user = User.objects.get(id=request.user.id) form = report_form.save() form.user = user Instead of: user = User.objects.get(id=request.user.id) form = report_form.save(commit=False) form.user = user form.save() Problem solved!!!! I couldn't be more dumb haha
Luciano
Thanks a lot @alkalit
Jigani
https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/#inline-formsets I think in your case it should be something like this ReportFormSet = inlineformset_factory(Report, ReportPictures, fields=('foto',))
Hey Alex.... I'm on formsets too it works but I can't get users to automatically add new modelform instance of via something like a button except via the extra parameter in the formset....is there something I'm doing wrong
Alex
at first, you could simply use request.user - it is already a User instance.
Luciano
at first, you could simply use request.user - it is already a User instance.
thanks! and that would be the ultimate solution or is it one of the best approaches?
Alex
thanks! and that would be the ultimate solution or is it one of the best approaches?
I rarely work with django forms. The thing I want to advice is not to manually set attributes on instances, but pass them in a form it self. https://docs.djangoproject.com/en/3.0/topics/forms/formsets/#using-initial-data-with-a-formset
Sandeep
Guys does any1 working on import export module on Django ?
Doragonsureiyā
Guys does any1 working on import export module on Django ?
Please, provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you. Include details such as libraries, platforms, modules, etc.
Jigani
Prakash
can anyone explain simple difference between API and Rest API
Alex
your captain obviousity
Sandeep
!explain
Ok actually thing is user will upload the excel file in a webserver.. I need to take the data inside that and only required data I need to post to database by validating the data with my another models.. Any idea on this
Sandeep
Please, provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you. Include details such as libraries, platforms, modules, etc.
Ok actually thing is user will upload the excel file in a webserver.. I need to take the data inside that and only required data I need to post to database by validating the data with my another models.. Any idea on this
Aarav
can anyone explain simple difference between API and Rest API
API - Function, class, any script, socket events, pub sub. Any thing from this list which provides access to some functionality. REST API - This is an API which will be used to communicate between computers using http protocol. States are not maintained from the previous request at server level.
Teja
I started learning django few weeks back and I did this http://ravitejareddyk.pythonanywhere.com/
Rajvir
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python38\lib\site-packages\rest_framework\utils\model_meta.py", line 111, in _get_forward_relationships related_model=_resolve_model(field.remote_field.to), AttributeError: 'ManyToOneRel' object has no attribute 'to'
Rajvir
can anybody tell me what should i do to solve this error
Anonymous
Hi Please How can i send data from from render_change_form to JQUERY file. Js So I can use it in condition in JQUERY file
Sandeep
You didn't explain what is your problem. Processing excel format by python? Data validation? Or what?
Ok I have a web app which will accept the excel file .. Now I need to fetch that excel data and I need to validate that data with my other data's which is already present in DB. After validation if everything is validated then I want to save that data to database..
Rajvir
where to find 'manytoonerel' object
Tejas
I have two different django projects and want to connect them with single signon
Tejas
Can someone give me idea?
Tejas
I have one solution but that is not scalable
Apleoxero
Can anyone show me how to create custom redirect url in django allauth I am confused about it https://django-allauth.readthedocs.io/en/latest/advanced.html#custom-redirects
iiiiiiπoW
How can we implement the functionality same as identiti server in django rest api ?
Anonymous
https://pastebin.com/2zkpXAsU
Anonymous
help me with this code
Anonymous
i am getting no result