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?
<td>{{ instance.category.name }}</td>
Try this one 🤔
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)
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>
when you use {%%} you should't use {{}} inside that
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?
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
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?
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
how to solve {"detail":"Multipart form parse error - Invalid boundary in multipart: None"} in DRF when try to upload file from angular app.
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 ?
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?
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
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 ?