Akobir
So? There are no "self" in use
https://stackoverflow.com/questions/15285626/django-self-referential-foreign-key
Akobir
And so on
Akobir
That's all I can do
Александр
https://stackoverflow.com/questions/15285626/django-self-referential-foreign-key
Well, yeah, I already read that. But I really want to trust documentation instead of StackOverflow *shrug*
Александр
That's all I can do
Thank you anyway
Akash
Hey is there anyone working on project so that any other newbie or beginner can contribute
Akash
On github or any other open source platform
RIP
class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) , what should I do if I want display full name in my templates? Do I need add extra fields called full_name = models.CharField(max_length=60) ??
Александр
Hey is there anyone working on project so that any other newbie or beginner can contribute
I'm working on a CRUD service for collecting quotes. You know, these programming quotes like "Premature optimization is the root of all evil in programming (Charles Antony Richard Hoare)". I'm trying to make it possible to keep original quotes and their translations. I killed a few days on it, and now I feel that this project will be done soon.
ГуНиСе️
class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) , what should I do if I want display full name in my templates? Do I need add extra fields called full_name = models.CharField(max_length=60) ??
I'd not recommend this. It's better to define a property to dynamic compute full name. class Person(models.Model): ... @property def full_name(self): return self.first_name + " " + self.last_name
RIP
This is just what I need,thank you
Bhavesh
How do i fix { 405 method patch not allowed } While update record in table
Harishwar......
Hi guyz... I have a doubt... How to integrate a ML model with Django
Harishwar......
I have completed django part and ml part separately... But I have no idea how to integrate it
k
How to create object for a model which has a field which is a manytomanyfield reference to other model?
k
I am creating the object throughout shell. I was able to create it if the m2m field was left null. But can't create it along with m2m field. It says the m2m field is not iterable and fails.
Doragonsureiyā
What are you talking about?
T
I have completed django part and ml part separately... But I have no idea how to integrate it
You can turn your final ml outcome to a rest api maybe using django rest.
Dhanik K.
#django #help-post i am using postgres for backend in django project. I loaded some data into database using .sql file then I tried to add some data manually using django admin site or django shell , I am getting INTEGRETY ERROR. seems like postgres is not auto incrementing ids . Any advice ?? thanks
Alisher shamuratov
Yes
Can you screen your project ?
Dhanik K.
Can you screen your project ?
Seems like media files are not allowed in this grp
Dhanik K.
Alisher shamuratov
ГуНиСе️
#django #help-post i am using postgres for backend in django project. I loaded some data into database using .sql file then I tried to add some data manually using django admin site or django shell , I am getting INTEGRETY ERROR. seems like postgres is not auto incrementing ids . Any advice ?? thanks
> postgres is not auto incrementing ids PostgreSQL relies on sequences for generating id of newly inserted rows. It's possible to set any number for next id as you wish. https://t.me/django/205620
ГуНиСе️
SELECT setval('tablename_id_seq', 500) after this command, next inserted row will get id = 501
N.P
How can I arranged the multiple graph ,ratherthan using different page i have to arrange in one page side by side ?? How can I do dt
Rohan
Learn css maybe?
N.P
Ok
Fan of Thunder
In authentication, Singup done successfully but not logged in Why.??
Fan of Thunder
Just used authentication login logout
Fan of Thunder
Share your code
I'll inbox you
Charly
I'll inbox you
No, see rule 5 and share it here
Charly
no worries
It's not about you, it's about the rules of the group
Alex
path problem, either set path or use virtual env.
Dhanik K.
SELECT setval('tablename_id_seq', 500) after this command, next inserted row will get id = 501
it means every time i have to run this command, if i add product instance using django-admin site?? ((with incremented id)
Dhanik K.
> postgres is not auto incrementing ids PostgreSQL relies on sequences for generating id of newly inserted rows. It's possible to set any number for next id as you wish. https://t.me/django/205620
def save(self, *args, **kwargs) -> None: from django.db import connection # select a relevant line from the output of ./manage.py sqlsequencereset [appname] sql = '''SELECT setval(pg_get_serial_sequence('"store_product"','id'), coalesce(max("id"), 1), max("id") IS NOT null) FROM "store_product";''' cursor = connection.cursor() cursor.execute(sql) return super().save(*args, **kwargs) THANK YOU, after your response I did some extra googling and come up with this solution , and now everything is working as expected.
ГуНиСе️
it means every time i have to run this command, if i add product instance using django-admin site?? ((with incremented id)
No. You shouldn't run this command every time from the service. Only once is enough. Postgres automatically increases serial sequences when a row is being inserted.
Никита
Who has worked with Django-EAV2, how did you render the filters in the HTML for the products?
YUSUF CR
>>> News.objects.all() Traceback (most recent call last): File "<console>", line 1, in <module> NameError: name 'News' is not defined
YUSUF CR
What is this error about?
ГуНиСе️
you forgot an import clause
ГуНиСе️
from appname.models import News
YUSUF CR
it works now thank you very much
Никита
Who has worked with Django-EAV2, how did you render the filters in the HTML for the products?
Dj - 505
Hi .. Which is the best ? django-rest-auth or Simple JWT
Maestro
Hello, I'm from Frankfurt and I'm self-employed. If I can help you, you can write to me
Vansh
synatx = messages.SUCCESS(request, 'Your password was updated successfully!')
Vansh
error = i'int' object is not callable
Vansh
plz help me
Doragonsureiyā
synatx = messages.SUCCESS(request, 'Your password was updated successfully!')
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Vansh
i am doing a from wich can submit and alert show success
Vansh
vs code
Maxim
i am doing a from wich can submit and alert show success
please read https://t.me/django/205990 carefully provide both the code and the full error text, both via pasting service
Vansh
ok sir
Vansh
i send it see
Maxim
i send it see
here, not in PM
Vansh
Ok
Kh
hi all there, i have a question regarding celery rabbitmq the question itself is i can have many requests from post api and i am trying to put them in the queue, can u provide some materials or suggestions how to realize it
Shabbir
Importing bulk users and related data jn django...is this possible? If yes how?
T
Importing bulk users and related data jn django...is this possible? If yes how?
Django has a bulk_create() method It may help. But still you will need a data source like a csv file etc to get the data, or another way for your use case https://docs.djangoproject.com/en/4.0/ref/models/querysets/#bulk-create
Shadow
In authentication, Singup done successfully but not logged in Why.??
https://docs.djangoproject.com/en/4.0/topics/auth/default/
Shadow
This link may help u successfully set up Django authentication
Yesu
What are the ways that different applications can interact with a django applications and its post method. I knew that for internal, it was using CSRF token to get access to post method How external applications can interact with django or django rest's POST method.
Almaz
Hello everyone! I'm looking for any tutorial how to make shopping cart only by Django without Javascript, Php, etc. Who can help me?
Егор
Django is a web-framework, you cannot write your html-something with django only. You may need additional apps for this, I guees, but what is the problem with HTML5, CSS and JS?
Егор
Yes, you can do it. Go read about templates.
Abdii
Please help me. 👉 Cannot import httpresponse.
Doragonsureiyā
Please help me. 👉 Cannot import httpresponse.
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org