Денис
If in model A you have relation like this - b=models.ForeignKey(B) Then u can filter objects like A.objects.filter(b__modelBfield = )
Davide
yes i have a fk between A and B, and between B and C
Davide
but how to filter model A with a field from C ?
Денис
Try b__c__field
Davide
ok, after some test, the correct way is b__field-b-c__field-c
Davide
Thanks a lot
Suliman
Hello guys can anyone here suggest me an open source project that can i start with to make a full e-commerce project i want to use django to make APIs not to make a full stack project
Suliman
if anyone can help me to do that without starting from the begging in the project and remaking the wheel i will appreciate his help a lot
Obdif
Hello guys, I’m a beginner in django and I’m currently building a web application but I need someone to help me with session in the web app, is difficult for me to use the session, please someone should help me out
Doragonsureiyā
Hello guys, I’m a beginner in django and I’m currently building a web application but I need someone to help me with session in the web app, is difficult for me to use the session, please someone should help me out
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
Noufal
Hi anybody know about the meta trading websocket api integration??
Doragonsureiyā
Hi anybody know about the meta trading websocket api integration??
Don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask directly! The better you are at explaining the problem, the more likely you are to get help. If you don't know what that means, read Asking Smart Questions.
Lalə
Hello. It will be off topic, but I want to get an idea. I need to find an innovative idea in the field of education. An idea comes to my mind, but I don't know how innovative it is. Students are matched with mentors that match their interests. These mentors guide students with their knowledge and answer their questions For example, if a student indicates that they are having difficulty with math, the platform can refer them to a mentor who is a math expert. This mentor can provide the student with interactive materials to understand the concepts, answer their questions, and support them to increase their academic success. How innovative is this idea?
DeathLikeSilence
Hello, I customize my user in Django for registering and logging in. In setting.py I wrote it to add that. AUTH_USER_MODEL =’ accounts. User’ Now I have added another model and I want to add it. What should I do??? Can I add my new model to AUTH_USER_MODEL
DeathLikeSilence
I have to do it. beacuse it is two diffrent user in my website I mean, one of them is User or Client another is seller what should I do ????
DeathLikeSilence
you can use parameters such as is_admin or is_superuser/is_staff
Emmm. Unfortunately, I can not, because both of them have this parameters
deficiente ✙
DeathLikeSilence
so client also can access the admin panel?
That depends, if is_admin checks, they can.
deficiente ✙
That depends, if is_admin checks, they can.
i mean according to your logic, clients also have is_admin==True?
DeathLikeSilence
make models Clients and Sellers with field user related to User model
Thanks, I will do it I hope it's gonna work
DeathLikeSilence
i mean according to your logic, clients also have is_admin==True?
Yeah in my logic Yeah Some of them have access to admin panel
deficiente ✙
Yeah in my logic Yeah Some of them have access to admin panel
ok, got that, then use taxicab33's method and write separate models that inherit from BaseUser or have 1to1 relationsip
Arseny
Hi all. Guys, please tell me how to send an array from js to the models field
Piyush
Hey ,I want help form you all,I have created an app where user enter his credentials like name,dob etc and an password will be generated,the module where this password will be generated is in google cloud platform how can I call it ,sorry if it is not related but I want some guidance.
Arseny
Use a post request to a view
How can I basically get a js array and pass it to views.
Muflone
How can I basically get a js array and pass it to views.
I just told you You make a post request in Js passing the data to the post fields
Arseny
Well, thanks
DeathLikeSilence
make models Clients and Sellers with field user related to User model
Excuse me, sir Do you know how can I add another model to the admin panel Before, I added the user to the admin panel like this: admin. site.register(User, seller, UserAdmin) User and seller are my models in model.py and UserAdmin is a class that I created in admin.py But I have an error and I don't know what should I do
deficiente ✙
try deleting User from the line
DeathLikeSilence
Add multiple admin.site.register Lines, one per model
How?? You mean I should do it : admin.site.register(User, UserAdmin) admin.site.register(seller,UserAdmin) If you mean this, I have an error for it
DeathLikeSilence
Believe
Useradmin is necessary for both of them
Then create seller admin class also
Mohammed
Do you know how to customize the django admin to create a news web application? Or do you know some django templates for that ?
Mirco
Do you know how to customize the django admin to create a news web application? Or do you know some django templates for that ?
don't use admin for a lot of custom stuff, build the app and the UI outside admin panel
MaxFee
Hey guys, please help! I have two models, A and B. I need to make it so that when a new user is created in database A, a table for that user is automatically created in database B! I can't figure out how to simultaneously create models. I'm using Django + Django Rest Framework.
Anurag K
Can anybody explain about session and cookies, also about session managment
cj
Can anybody explain about session and cookies, also about session managment
just out of curiosity, have you read the docs? https://docs.djangoproject.com/en/4.2/topics/http/sessions/ because there's that topic well explained there
Software
Hello guys I one problem facing when userauths app create Runtime error show
Software
Please soltuions tell me anyone
Software
Yes wait
Caue
hi
Caue
do you guys have any exp about serving django apps with heroku?
Caue
especially what do i need to pay for these functionalities
Rishabh
Hi Guys, I want to know How do i hide my admin panel from users if i have to add domain name for SSL
Nima
Hello friends I want to add a section to my project so that the admin can upload an article through the admin panel, which is in Farsi and has photos and videos inside, and I want to handle it from the back end, what tools do you think other than ckeditor or tinymce is there another Or is it better for Front to fix it?
Dima
Hi, why filter not work ? ids = [379, 382, 383] queryset = Cart.objects.filter(product_id__in=ids) serializer = CartSerializer(queryset, many=True) class Cart(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name = 'cart_product')
Dima
In queryset, try using productin instead of product_idin
why? i have array of ids not product models
jack
In Cart model, you have product field so just use product__in
Dima
In Cart model, you have product field so just use product__in
queryset = Cart.objects.filter(product__in=ids) not help
Dima
sorry, i have no data in db
jack
queryset = Cart.objects.filter(product__in=ids) not help
Have you checked if those IDs exist in table
jack
Ah that's why
DeathLikeSilence
hello, I created two class models in model.py one of them is a User (I mean client) another is a SellerUser(I mean someone who wants to sell their product) Both of them should register and login In setting.py I wrote this: AUTH_USER_MODEL =’accounts.User’ The register is working, but login just works for User, not for SellerUser What should I do? In view.py in the login class I use authenticate and token I use DRF and APIView
Rubi
Hello everyone Today I have started learning django but now I got stuck that from where should I learn because someone recommended me to learn from you tube but according to documentation it is different so I am confused that which one should I follow
nyctophile
hi there! I was following rest framework you tobe tutorial but I am having this error when I try to runserver ModuleNotFoundError: No module named 'products'
Mirco
can anyone help with that I tried to makemigrations but I got this error again
Because the error is related to python modules, not to migrations Share your code tree via pastebin.org and the full error