Mirco
Francis
Thank bro...
Francis
How do I get a list of the fields only
Mirco
Francis
Yeah
Francis
I dnt need the 'model' and the 'pk'
Francis
just the name
Mirco
YourModelClass._meta.get_fields() should work
Francis
Gives an error:
Object of type ManyToOneRel is not JSON serializable
Mirco
Francis
Yes, I am getting the serialized data
Francis
But in it, there is the ''model'' and ''pk''
Francis
I dnt need them
.
Francis
That is what I am using bro... (Django Rest Framework) right !?
.
Yes
Francis
I got a query set, and want to return to user...
.
Pass qs to serializer and make many=True
.
For relation fields make your own fields in serializer
.
Or exclude if you don't need them
Francis
But am not able
Francis
let me try that
.
Show code
.
May be we can help
Francis
categories = profile.category.all()
return JsonResponse({'status': '00', "categories": categories}, status=status.HTTP_200_OK)
.
You are not using DRF
.
Use DRF serializer
.
Make CategorySeriliazer class
.
Pass qs to it CategorySerializer(qs, many=True)
.
And return serializer version
.
As CategorySerializer(qs, many=True).data
Francis
Okay... just a min
Francis
"non_field_errors": [
"Expected a list of items but got type \"QuerySet\"."
]
.
Francis
Same error
Francis
But I just wante list of the name
Francis
Maybe I can use a for loop to get the fields.... is it advisable !!?
Francis
Matvey
Hello guys,
Can you help me? Please
I add field my custom user model in UserCreationForm and not see this fields in django admin
https://gist.github.com/Tingaev/f448ad8f123bcb15695d11b481f19cc5
.
Francis
Oksy, thank you... ill try
Sardor
Sampreeth
Hey guys
Before deploying the django project should we change DEBUG=true to DEBUG=false
Sampreeth
Sampreeth
Is firebase is best to use in django
cj
you just have to know what you're doing
Sampreeth
Ok
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
I had a question.
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
Is it possible to create a application of a website with Django?
Sardor
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
will Django be enough for that?
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
I mean application for mobile phones .
Sardor
I do not think so, others correct me if I am wrong
Anonymous
yes it is
eee Sardor qalay iwla o'qiwla qoyile uchragan joyni qarang!
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
cos there is a web project and we wanted to create an app for this to log in from mobile phones
Sardor
Anonymous
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
Thanks)
Mohamed
007
Suppose there are 2 fields in table (1) date & (2) production.
If i want to select date from 11-01-2019 to 13-02-2019 in between this date the i want to display available production data
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
cj
007
Is there any method to aggregate data
Abdulboriy Alimov (Abdulboriy Ibn Abdulxay Ibn Sharif Al-Uzbek)
Anonymous
Like SQL for server. Html, JavaScript or anything else for scripting
Anonymous
Etc
Anonymous
Etc - end of thinking capacity
.
007
What data?
Kaushal:
Suppose there are 2 fields in table (1) date & (2) production.
If i want to select date from 11-01-2019 to 13-02-2019 in between this date the i want to display available production data aggregate
.
.
In Django ORM?