Nicolas
with the same code?
#
nope it differ
#
man try User.objects.get(username=autor) if it is work
Nicolas
it's perfect
Nicolas
I do it in this way
Nicolas
def clean_autor(self):
autor = self.cleaned_data["autor"]
autor_exist = User.objects.filter(username=autor).exists()
if not autor_exist:
raise forms.ValidationError('Sorry, the autor does not exist')
else:
autor = User.objects.get(username=autor)
return autor
Nicolas
#
Thankss!
there could be bug, u make complex ur code
Anonymous
Hello, I am developing a system to learn python(django), but I am stuck in an error, which unfortunately is simple when I google search, no result was similar to my case ...
In my system, first registration is from Clients, later Hosts.
I created the CRUD Client that worked as expected, but when creating the CRUD Host, I added a Select element that lists the Clients, to add a Host, the template passed the Select data via Post normally.
But on the Update template, it simply does not pass Select value via post to the view ...
<select type="id_client" name="id_client">
<option value="{{ h.id_client }}" selected>{{ h.id_client.name }}</option>
{% for c in clients %}
<option value="{{ c.id_client }}">{{ c.name }}</option>
{% endfor %}
</select>
For a Select that does not change in an update view, is it necessary to do something different?
Anonymous
Debugging, I found that in the view the field is receive the value: "---------"
#
Hello, I am developing a system to learn python(django), but I am stuck in an error, which unfortunately is simple when I google search, no result was similar to my case ...
In my system, first registration is from Clients, later Hosts.
I created the CRUD Client that worked as expected, but when creating the CRUD Host, I added a Select element that lists the Clients, to add a Host, the template passed the Select data via Post normally.
But on the Update template, it simply does not pass Select value via post to the view ...
<select type="id_client" name="id_client">
<option value="{{ h.id_client }}" selected>{{ h.id_client.name }}</option>
{% for c in clients %}
<option value="{{ c.id_client }}">{{ c.name }}</option>
{% endfor %}
</select>
For a Select that does not change in an update view, is it necessary to do something different?
what about the html part,did u handle what u have to handle in it?
Anonymous
For web development, I'm very newbie, this is my form in the template:
Maks
Hello. Please tell me how in django rest to output in json only those objects whose field satisfies a certain condition, for example, not zero?
#
#
Maks
#
sohrab
I with using cpanel project great not working because in support create project all right
sohrab
I'm sorry I had written wrong.
sohrab
About English
sohrab
But I supports CPanel and Django
Anonymous
Algorithmic Questions:
30 min for each question (1 hour in total).
1.Produce a list of numbers with length k and numbers in range dis
Given a list of integers and a number x, find the smallest sub-list with sum greater than the given
value.
Examples:
my_list = [1, 4, 45, 6, 0, 19]
x = 51
Output: 3
Minimum length sub-list is [4, 45, 6]
my_list = [1, 10, 5, 2, 7]
x = 9
Output: 1
Minimum length sub-list is [10]
my_list = [1, 11, 100, 1, 0, 200, 3, 2, 1, 250]
x = 280
Output: 4
Minimum length sub-list is [100, 1, 0, 200]
my_list = [1, 2, 4]
x = 8
Output : Not Possible
Whole list sum is smaller than 8.
2.You are given a matrix of MxN boolean values representing a board of free (True) or occupied
(False) fields. Find the size of the largest square of free fields.
Examples:
board = [ [True, False],
[False, False] ]
Output: 1
board = [ [True, False, True, True],
[False, True, True, False] ,
[False, True, True, Flase]]
Output: 2
board = [ [True, False, True, True],
[False, True, True, False] ,
[False, True, True, Flase],
[False, True, True, Flase]]
Output: 2
sohrab
ℕo ℕame
I use postgres in chat app for storing messages. I work with web sockets (channels). Is it not expensive to make query to db and save message every time when a user send message?
Eric
ℕo ℕame
Ihor 🐈
Does Django's cache middleware separate cache for the same urls but with different query-parameters?
Anonymous
like and dislike button.any module or sample?
Anonymous
How do I submit a form who's content is dynamic (as in fetched from database)? 🤔
Shubham
How to upload multiple files in one go in DJANGO?
Shubham
Without Ajax
xarala221
Without Ajax
- You can get all files in a list
- Do a loop to get each file
- In each file submit the form
Hussein
How do I make the code delete images when they are replaced?
Shubham
So how to select multiple files when the pop up window comes to select file?
Shubham
That's not allowing to select multiple images
xarala221
Shubham
Okay Thanks
Shubham
How can I get the latest inserted I'd?
Shubham
Id*
Shubham
Or the of ID of the data which xyz user uploaded the last?
Keeping in mind other users are also filling data in the same table
cj
PV
Does anyone know an accounting app built on django, available open source
Shubham
Is last() available in Django 3?
PV
.first() and .last() are available from django 2
xarala221
xarala221
Mirco
Anonymous
Mirco
Shubham
Thanks everyone🍎
Anonymous
Anonymous
I can't go to the previous page on clicking the browser's back button 😕
Anonymous
Why so?
Anonymous
It just gets me a blank tab 🙄
Martín
I get this error:
TemplateSyntaxError at /es/home/
'blocktrans' doesn't allow other block tags (seen "url 'django_sftpbrowser:sftp-index'") inside it
with this code
<p id="welcome_msg">{% blocktrans %} You are authenticated now. You may go on and
explore the sheet music and resources by clicking <a id="redirLink" href="{% url 'django_sftpbrowser:sftp-index' %}">this link</a>.
{% endblocktrans %}</p>
Martín
Oh, I think I found it
Anonymous
Andrew
what is the difference between gettext, ugettext, gettext_lazy, ugettext_lazy?
John
is it possible in heroku server to create a folder using os.mdkir? or any os command?. .
Rupesh
How to get id though url in Django. Send Id blog page to single blog page with anchor tag. How to get id in single blog page
Tony
Is it possible to host a django project on cpanel
Swapnil
I want send mail in django it shows in sendmail function
Swapnil
Anyone is there ??
🤔
all dead
Felix
Swapnil
❓
Swapnil
Error
Swapnil
Sendmail function error