Mirco
Yep
Isaías
Very good.
Mirco
You need to pass value when use clean_field and data when you use validate
Mirco
I mean as parameter of method in addition to self obviously
Isaías
Whats the diference in: clean_field and validate_field
Mirco
Whats the diference in: clean_field and validate_field
They are the same but clean when use forms and validate for serializers
Mirco
https://www.django-rest-framework.org/api-guide/serializers/#validation
Mirco
For better and more info
Isaías
Ok ok
Isaías
Very good
Mirco
DRF docs is so good, make it your best friend
Shreehari
im trying to display image in a post , but the images are not rendering https://del.dog/lenikuzeva.cs
Mirco
sorry ?
Why you are not using post.image.url instead of /your_folder/your_image.png into template
Shreehari
this is how images are getting displayed : https://imgur.com/a/dy1VXqx
Mirco
for now i want to have same image for all the posts
Ok, so you can use MEDIA_URL or get_media_prefix into template
Mirco
Instead of hardcoding path to the image
Mirco
And into the model use ImageField
Shreehari
And into the model use ImageField
will try that too thanks
Mirco
will try that too thanks
Documentation man, read Django docs for better code 😊
Shreehari
actually i read some random once ,& try to implement irrespective of success of failure😂😂😂
SatyendraN
Hi guys, Can anyone help me implement editable choice field in which if anyone fill any data besides choice, database store it and populate it as a choice in it for the next time ?
Mohit
How it will store new entry in database ?
The choices table can contain just one field like name of the choice.. And to add new choices.. Just add to this table 🤷‍♂
SatyendraN
I want to do it automatically when user enters its new choice to field
SatyendraN
If I have to add manually I could have done it before
Mohit
Hope you got this
I didn't get... What you mean automatically 😅. For user to enter data, there should be a form.. And get the data and store into table
SatyendraN
When user submitted the form new choice should be added with the old one automatically
Mirco
use ajax call...
Nowadays js' Fetch APIs 😁
Anonymous
@pyflare :- I haven't used js' Fetch API before... but thanks for this alternative... is there any major difference ?
SatyendraN
put jQuery and AJAX dependencies into the bin
Can anyone tell me more about it ?
Mirco
Can anyone tell me more about it ?
Make a search, you will find looots of articles about it
João
Hey there! Someone here did something using django and plotly?
Mirco
Hey there! Someone here did something using django and plotly?
Ask what u wanna know , if someone knows about that topic , will answer ya
Gio
Hi there I deployed my app to Python Anywhere and I sometimes get an error: (Timestamp): OSError: write error I was told that this is because the user left the page before uwsgi could give a response Can this problem be caused from an impatient user with a slow connection or is a strictly uwsgi problem?
Gio
I checked in the server log and it says broken pipe so I assume impatient user
João
Ask what u wanna know , if someone knows about that topic , will answer ya
I wanna know if are there any advantages? Cuz' I'll start ato develop a strategic intelligence app and I'm choosing the best chart approach.
Rocky
Hey guys
Le Createur
Rocky
Im working on a project where i need to implement a search functionality in which user enters some string and results are returned if matches from the oracle db
Rocky
I was able to connect to oracle db, create models and search page with button and template to view the result on click of search button
cj
Im working on a project where i need to implement a search functionality in which user enters some string and results are returned if matches from the oracle db
well, in PostgreSQL you have the SearchVector that is very useful for that case... but in Oracle IDK🤷🏻‍♂
Rocky
But i want to display the results in the same page as im searching quite similar to how google search works, itdisplays results as a dropbox and on the same page
Rocky
Any pointers on that
Le Createur
Any pointers on that
if your template {% if results %} # show the results {% else %} # show empty div {% endif %}
Rocky
But presently i have 2 templates - search. Html where user enters and clicks on button and then result. Html template where results are displayed im not able to point that result view to search template
Rocky
Any ideas
cj
Any ideas
use javascript
D
Class based view ?
SatyendraN
use javascript
No need to use js here
D
In django I know function based view please help class based view
cj
No need to use js here
to show a dropdown list while the user write. without re-rendering the template in each key stroke?
SatyendraN
to show a dropdown list while the user write. without re-rendering the template in each key stroke?
This part comes when his search option starts working on the same page. Right ?
Le Createur
to show a dropdown list while the user write. without re-rendering the template in each key stroke?
no he didn't really asked for that. is asked to display results in the same page. this is just a conditional template
cj
This part comes when his search option starts working on the same page. Right ?
doesn't matter after or before that part, how would you do that dropdown box to show suggestions while typing, without using JS?
Le Createur
if he want realtime search then yes he needs js. but there are django apps that do it
Clayton
Hello! I have a application in python with django, but always to consume an API for population my database I have to create a script that run separately from my application.
Clayton
Is there a way for me to do this data loading in the back of my application?
Anders (izzno / gooood) 🇳🇴
Django channels
Anonymous
Hi guys I think all are doing great I need from you
Anonymous
How can I map Django models to execl