Mirco
how can i perform in django that without sing in user can read only 5 to 10 post
limit the queryset if user is not authenticated inside the view
Sai Krupa Reddy
you have to elaborate
I trying to create a quiz model in that different users should have different data but even if I create different users the data is visible to other user Like teacher 1 has created a quiz DA and teacher 2 has created another quiz DS . both are able to see both the test's . But as per my requirements teacher 1 should only see DA quiz and Teacher 2 should only see DS quiz
Sai Krupa Reddy
create permission based on the owner of the quiz , for owner I mean who has created the quiz
https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#custom-permissions like this?
Mirco
https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#custom-permissions like this?
https://learndjango.com/tutorials/django-best-practices-user-permissions
Doragonsureiyā
Ok I will see into it Thank you
You're welcome! 😊
Maz
by using JSON Field of Django
I have to write to the jsonb field of the db
Mirco
I have to write to the jsonb field of the db
create inside your Django model the JSONField and Django will convert it to the Postgres json field
Ds
I am a beginner can anyone guide me???
Doragonsureiyā
I am a beginner can anyone guide me???
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Mirco
buy it
Mirco
piracy is not supported here
Anonymous
Ellyse Perry: Hello everyone, I'm here to inform you that, I need you to make changes in my website, I can pay u for this https://github.com/amirahrari/django-react-ecommerce.git Here is the link I want you to run and check, Changes I need 1. I want u to add a main page (static page) with html + css And few changes in database (admin panel) Interested people Dm
Anonymous
Do u know django?
Anonymous
And python??
Pratham
Yes
Akash
When do you save that ?
Save what ? save a Class ?
Akash
I have to maintain a list of items with their prices as item_price_list and show it on webpage using django view. These prices vary every day, therefore I have to update the prices of items, every morning. BUT I cannot use database to store this list as this item list can have 20k+ entries nd my db allows only 10k free entries. How Shoud I store and update the item_price_list ? Already Tried: Tried using celery to run "updation" as a separate task, BUT that would be running in different processor thus, cannot update main item_price_list using that
Maltapopoulos 🇲🇹
Save what ? save a Class ?
Your modifications
Ekta
Hello
Mirco
Hello
!hello
Doragonsureiyā
Hello
Please move your "Hello" and other social talk to @PythonOfftopic.
Sami AL-fasly
I need do chatting realtime by django
Sami AL-fasly
What use for it ?
Sami AL-fasly
And is docker important or no?
Akash
You have to write test.save()
But test is a class, not a django model test.save() throws error. I don't think we can save class. Also, someone also suggested that, worker works on entirely different process, so they can't hold same values
Dishant
And is docker important or no?
No docker is not important
Mirco
And is docker important or no?
Nice to have nowadays, not mandatory Absolutely not related with realtime
Sami AL-fasly
How to try if the chat is ready and the message delivery in real time
Sami AL-fasly
And if any lib help me to make the notifications
Dishant
And if any lib help me to make the notifications
Would you elaborate it more or you can specify it that what you want to do in your django
Dishant
Project
Sami AL-fasly
Chat and group chat like telegram and user post like facebook and LinkedIn.
Hassan
Hi, I was facing issue implementing social auth in django rest api Do you have any tutorial or if you have implemented in any demo project please send me
Sami AL-fasly
Put i need know what use and need to make my project.
Sami AL-fasly
I weak in english language
Astrit
Hello guys hope youre doing well i had a question regarding django-filter into json field
Astrit
Is there any possiblity to make this a single query ?
Astrit
Use the link for more informatiko: https://stackoverflow.com/questions/65703799/django-filter-json-field-array-for-multiple-indexes-lookup-with-q-model
Lucid
I want my django model to grade the result of the class of students
Lucid
Would I use the grading code in the specific model or may I define a function like def grade () then pass it in the model
Lucid
Can anyone give me suggestions on it please I am having so many errors
Lucid
Ok
Dishant
return [auth() for auth in self.authentication_classes] TypeError: 'type' object is not iterable
Dishant
can anyone help me with this error?
Dishant
this is my JWT restframework
Dishant
REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', 'rest_framework.permissions.IsAdminUser', ], 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', ), }
Dishant
https://del.dog/erfephuboc.txt
Lucid
https://del.dog/yzixetimyp.txt
Lucid
this is the related code
Lucid
can you elaborate more please
Shreehari
can you elaborate more please
https://docs.djangoproject.com/en/3.1/topics/db/models/#model-methods
Lucid
i have done before by file handling and totally new in django and databases
Xpyk3rs
Can anyone tell me how to solve this error..This id my apiview for showallusers......AttributeError at /showalluser 'str' object has no attribute 'values'......
Mirco
with pastebin or similar
❍ท℮
Why we can`t send photos?
❍ท℮
here
Doragonsureiyā
Why we can`t send photos?
Read the rules before any activity: @PythonRules
Mirco
Read the rules before any activity: @PythonRules
You are the 100th today that asks the same thing, is it to hard to read rules ?
Mirco
cj
we'd be the richest people on the world!
Mirco
(@pyflare)can you explain in brief
I'm not master you have to study Django permissions, you can limit access to views or limit a queryset if user has not paid for the resource
Anonymous
Hello guys ı need help ı have 1 product but this product must be in 3 category , how ı need django model ??
Anonymous
can u show me a model example ?
Anonymous
class Category(): name class Product(): categories = models.ManyToMany(Category)
Anonymous
like that
Anonymous
class Product(models.Model): category = models.ForeignKey(Category, related_name='Boats', on_delete = models.CASCADE)
Anonymous
ı use this style