Anonymous
https://pastebin.pl/view/d9a7532c after making foreign key item-name is none on html templete sir!!
Oleg
Guys, could you please give a hint.. I just made a one to one field in model that refers to itself. I have a collision problem in form validation IN UPDATE FORM. In case I remain same value in field it will return error like: "Model with this field already exists" but If I change value to another instance it will validate form without any problems. So, my solution that came to my mind is to override validate/clean methods in form. Is it a proper way to manage this problem?
Oleg
Or should I use ForeignKey instead of OneToOne to manage this case? btw, I need 1x1 relation
Oleg
There is no collision problem when I use ForeignKey instead of OtO. So my question is still relevant. is it good way to handle this issue?
goku
Can I compare the value selected in choices with the integer in url?
goku
I am talking about field choices in django
goku
Example Some url/2 (1,raman) (2,yash) Can I filter value with 2 out of database?
goku
Please help.if someone know
VY.sh
Werner
ids are int, not str
𝔐𝔞𝔥𝔡𝔦 𝔉𝔦𝔯𝔬𝔲𝔷𝔧𝔞𝔥
hello everyone is there any extension or settings for VSCODE to indent the django templates? I'm currently using beaufy but it just recognizes the HTML & JS tags, nothing for django-template tags.(at least it makes a little more, indent them to the same level of parent HTML tag)
Anonymous
Which ide is best vscode or pycharm
D
Which ide is best vscode or pycharm
If you are more focused towards django pycharm is better but pycharm is not good for html code it whereas pycharm has a lot of pros for django
عــمــر
How can i marge listview with detaileview
عــمــر
i have a problem , i get a video from a model in template in this way {% static '{{course.video}}' %} and its shows like this why ?? <video src="/static/%7B%7Bcourse_contant.video%7D%7D"></video> , it should be like this <video src="/static/video1.mp4"></video>
Hamidreza
{% static 'course.video' %}
Oleg
Anyone help? I still in stuck with this issue that I described above... But also I've created a post in stackoverflow https://stackoverflow.com/questions/65064162/django-onetoone-self-referencing-field-form-validation-error-model-with-this-f
Mehran
How can I create a model for a dictionary that'll be used in a table in django?
M
{% static 'course.video' %}
I think {{}} is ok to accept variable just remove quotes
عــمــر
I fix it {{ course.video.url }}
Hamidreza
mukul
[{'text': 'in warehouse', 'time': datetime.date(2020, 11, 30)}, {'text': 'ready to dispatch', 'time': datetime.date(2020, 11, 30)}]
mukul
How to use this data in html page
cj
How to use this data in html page
did you read the tutorial about templates?
Anonymous
How to use this data in html page
{{ time|date:”Y-m-d” }}
cj
{{ time|date:”Y-m-d” }}
that's not what he asked
Doragonsureiyā
No
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
cj
No
it's a good time to go and read it then
Safwan
Hi there, I am looking for project suggestions for my final year. Any suggestions are welcome. Please help, thanks
𝔐𝔞𝔥𝔡𝔦 𝔉𝔦𝔯𝔬𝔲𝔷𝔧𝔞𝔥
Use Pycharm
tnx, it was a hard work you did
𝔐𝔞𝔥𝔡𝔦 𝔉𝔦𝔯𝔬𝔲𝔷𝔧𝔞𝔥
Django Extension pack
there is no such thing, its python pack. and none of them do indentation for django-template
artur
Can someone explain how the API works for sharing tracks in Spotify (I need to do the same in intern project)?
artur
share song link
Mirco
share song link
it's a simple link to the detail page view
Mirco
so learn DetailPageView in django and you'll know how to make the same funcionality into your project
artur
I have actually done it. However, my boss states it should work another way. In the detail, api gives json instance of track with whole data only if the session is authenticated should i change permissions?
Mirco
that API must be accessible only if user is authenticated and if you are using Django Rest Framework it means that you need to set IsAuthenticated permission
Mirco
the API is something link api/v1/tracks/<id>/ ( the base path is up 2 u ) you get the object by using the id only if you are authenticated otherwise you have to return a 403
Mirco
and Django has a way to do it with 2/3 lines of code by using a GenericAPIView
artur
thanks🙏🏻 will try
Doragonsureiyā
thanks🙏🏻 will try
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Mirco
just study it and that's all
Mirco
it's a simple CRUD operation
Javad
Hi. I want to trunc hour to last second of hour (set minutes=59 and seconds=59). How can I do this with orm?
Javad
Cast(datetime, output_field=DateTimeField()) always setts utc timezone on it. How I can customize that?
Mirco
Hi. I want to trunc hour to last second of hour (set minutes=59 and seconds=59). How can I do this with orm?
https://docs.djangoproject.com/en/3.1/ref/models/database-functions/#trunc
__init__
how to solve {"detail":"Multipart form parse error - Invalid boundary in multipart: None"} in DRF when try to upload file from angular app.
Javad
customize it 😊
Do you know what is must override?
Mirco
Do you know what is must override?
you can just override Trunc or Func that is the base
Konstantin
can anyone recommend a free html template for an django enterprise application, the main content of which is tables and graphs?
𝙑𝙞𝙨𝙝𝙖𝙡
Guys I am using a widget media in my django project but it is not rendering when I am deploying it on heroku. I have used {{ form.media }} in the head tag of my html file. It is working locally but not on the server. Can you guys help me ?
Hamidreza
In your opinion, is SQLAlchemy better and easier or Tortoise?
Hamidreza
It's really up 2 u
In my opinion, at a glance, Tortoise seemed very simple and comfortable, I wanted to ask your opinion to see if it is so? Or I do not have enough experience and this made me have the same view of Tortoise!
Askhat
Hello everyone, I'm new! Who knows how to use the social registration form in django-allauth?
Doragonsureiyā
Hello everyone, I'm new! Who knows how to use the social registration form in django-allauth?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Askhat
no one to answer me?
The
I want my class based view to return response first and then do some processing Because view sometimes takes a bit long to prcess things and time-out happenings due to not receiving response. Solution ?
The
M using django rest framework for views
Mirco
no one to answer me?
https://t.me/django/130373