Neo
How do you guys go about writing start up checks? I understand there are a few ways to do this. Anything to do with a model i put in the model, but in my case i want to check if a key exists in the cache if it does not create it
APY
How to use list of one function in other function in views.py
S
Neo
Bhaghi
Product matching query does not exist.
Bhaghi
This is the error how can solve the error
dimmmmmma
Hello everyone, can anyone help me with a migration error?
Operations to perform:
Apply all migrations: socialaccount
Running migrations:
Applying socialaccount.0001_initial...Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "users_advuser" does not exist
Here is the situation in more detail
https://stackoverflow.com/questions/73278646/django-doesnt-see-model-after-migration
Anonymous
Maybe try to delete 0001_initial and then make migration
Anonymous
It worked for me
Rafaela
you probably mistyped users_advuser
S
Sunil
In my Django project I am using Aws rds service for Database. And I have deployed on aws ec2 instance. And it's working. But in model class I have aaded new field and it showing changes in local machine but it is not showing field in my production application and even I have updated production code. But there is no changes reflected on my database. If anyone know this about problem plz help me
Book of the end
hello everyone, can anyone help me with this error?
Book of the end
{"detail":"Method \"GET\" not allowed."} when i m tring to get the api
mahdi
you must send request with method post
Book of the end
rtg
Hi! Internationalization: Error when execute "django-admin compilemessages" Execution of msgfmt failed: /home/Documents/proyect/locale/en/LC_MESSAGES/django.po:121: duplicate message definition...
/home/Documents/proyect/locale/en/LC_MESSAGES/django.po:32: ...this is the location of the first definition
msgfmt: found 1 fatal error
Jay
I want to make form.error msg in register view disappear after few seconds please help
Jay
I am using custom user model in django app
Alexander
Abdullah
I want script python to download Playlist from YouTube and subtitles
Alexander
Alexander
Abdullah
I don't know python currently
So I need automatic script
Alexander
you can find there any examples for any languages
Abdullah
Alexander
https://developers.google.com/youtube/v3
Abdullah
Ok
@lex
hello guyz i need the help to create my first project which hello django 🙏🏻
Georgiy
Rafael
What is httpsresponse?
@lex
Rafael
You guys should give problem solving quizs
Sinan
How to limit Django REST specify APIs to only specify user
Mirco
Mohammed
can any one help ?
I have (Order) model and it contain SenderCustomer and ReceiverCustomer
in order form : I want to be able to search for Customer and select SenderCustomer and ReceiverCustomer Or create new Customer and chose it for filed
Sinan
Mirco
Abdullah
If I want make a script to download Playlist from YouTube
Python only enough
OR I want use framework or library???
Mihail
why CharField() is passed, but ForeignKey() not viewed?
match field:
case CharField():
dict[field.attname] = f'test_{model._meta.model_name}_{field.attname}'
case ManyToManyField(), ForeignKey():
dict[field.attname] = 1
Jay
I want to display only first alert of bootstrap in my register template
Jay
How?
Nikita
Hello, guys! Please tell me who has encountered this.
There is a raw query:
SELECT vdf.name , COALESCE(count_filter.count_f, 0) from vacancy_default_field vdf
LEFT JOIN (
SELECT vf.field_id, COUNT(DISTINCT vf.vacancy_id) as count_f from root JOIN vacancy_field vf ON root.id = vf.vacancy_id GROUP BY vf.field_id
) as count_filter
ON vdf.id = count_filter.field_id
How such a request can be implemented via Django ORM. ?
I have already tried to describe an annotation with a nested query beforehand. Then I tried FilteredRelation. But the requests are different. And the selection is not the same.
I will be very grateful to you for your help.
Maxim
APY
How to write query for django database if i want this to be executed
“ select tags from repository where docid=i “
Mirco
Dmitry
After get?
And i want only one column
if one pipe:
pipe = Pipe.objects.get(id=int(pk))
if many pipes:
pipes_all = Pipe.objects.all().order_by('name')
for pipe in pipes_all:
....
Mirco
read the doc!
Jeeva
I'm beginner for python django
Jeeva
How can I start my career
Jeeva
Through this
Jay
I want to display only first alert of bootstrap in my register template
How?
Nikita
you misunderstand the concept of ORM
your question makes no sense in isolation from a specific set of models
I have three tables Vacancy - contains information about vacancies, vacancy_default_field - contains basic data. And the vacancy_field relationship table - contains information which default_field refers to a specific vacancy
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| title | varchar(128) | NO | | NULL | |
| min_salary | int unsigned | YES | | NULL | |
| max_salary | int unsigned | YES | | NULL | |
| description | longtext | NO | | NULL | |
| contacts | longtext | NO | | NULL | |
| company_id | int | NO | MUL | NULL | |
| created_at | datetime(6) | YES | | NULL | |
| is_top | tinyint(1) | NO | | NULL | |
| displayed_id | varchar(64) | YES | UNI | NULL | |
| conditions | longtext | YES | | NULL | |
| requirements | longtext | YES | | NULL | |
| responsibilities | longtext | YES | | NULL | |
+------------------+--------------+------+-----+---------+----------------+
13 rows in set (0,00 sec)
mysql> show columns from vacancy_default_field;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| name | varchar(32) | NO | | NULL | |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0,00 sec)
mysql> show columns from vacancy_field;
+------------+------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| field_id | int | NO | MUL | NULL | |
| vacancy_id | int | NO | MUL | NULL | |
+------------+------+------+-----+---------+----------------+
and raw query work is correct
```
SELECT vdf.name , COALESCE(count_filter.count_f, 0) from vacancy_default_field vdf
LEFT JOIN (
SELECT vf.field_id, COUNT(DISTINCT vf.vacancy_id) as count_f from root JOIN vacancy_field vf ON root.id = vf.vacancy_id GROUP BY vf.field_id
) as count_filter
ON vdf.id = count_filter.field_id
```
where root is analog queryset from controller
is sql this:
```WITH root as (SELECT * FROM vacancy
WHERE id in (SELECT vacancy_id from vacancy_region vr where region_id =4))
```
How such a request can be implemented via Django ORM. ?
Maxim
Nikita
!ol
Doragonsureiyā
Python groups in other languages
(‼️ Not managed by us ‼️)
Amharic @python_amharic
Arabic @arabipython
Azerbaijani @azepug
Chinese @pythonzh
French @python_francais
German @pythonde
Hebrew @pythonisrael
Hindi @pyhindi
Indonesian @pythonid
Italian @python_ita @pythonita
Kazakh @python_kz
Malaysia @pythonmalaysia
Persian @pyfarsi
Portuguese @pythonbr
Russian @ru_python_beginners @ru_python @python_scripts
Spanish @PythonEsp
Swahili @python_eafrica
Turkish @python_tr
Uzbek @python_uz
If you have an (active) group you want to add, ask in the meta group, link in the rules page.
Nav
Hello guys , new to django here. No idea how to save data to database from a external api. Sharing screen snippets for reference. Any guide or resource will be appreciated
Nav
Media is not allowed . Ok
Doragonsureiyā
Media is not allowed . Ok
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Kim
Use ajax?
G4st0n
Rafael
What are the main topics i have to learn before starting django
G4st0n
query set have a lot of options
Nav
https://nekobin.com/
Maxim
G4st0n
Rafael
Nav
After data= response.json ().
Nav
How to assign data values to model
Maxim
Means?
only specific issues
such as yours please at @pythonofftopic