vector
https://linkode.org/#vK00VENKa6eiobjJcJ3pL6
Doragonsureiyā
Д
what's up.
Д
class BarSerializer(serializers.ModelSerializer):
history = SerializerMethodField()
def get_history(self, object):
foos = object.foo_set.filter(fooId=object.fooId)
fooentries = FooSerializer(foos, many=True).data
barentries = BarSerializer(object.barentries, many=True).data
# how to combine {fooentries, barentries} ?
Д
the results of FooSerializer and BarSerializer ... they're some Django ReturnLists which can be appended but I'm not happy with that
Д
this looks like I'm gonna have to write a Combined Serializer
Д
why you do this Django
Аlibek
You mean write only and read only fields?
Д
You mean write only and read only fields?
I don't see how reading or writing is relevant to this. I want to take data from two different places in the DB (two different Models), combine those, then push it out of a Serializer
Д
whether I read that or end up writing into the DB should be the same serializers problem, regardless.
Д
DRF and Django are just being horsecock...
Д
AAAAAAAAAAAAAAAAA finally
Anonymous
Can any one plz tel me why should I learn django??..
Alex
Doragonsureiyā
Karthik
Hi i'm new to django
i installed django on my virtual env but when i used pip admin command it shows not recognized error any idea how to resolve it thanks
vector
Try upgrading pip or Google your error this is quite common error
Himalaya
Naabe
Richard
I would to know how to define a primary Key on many fields on django
Richard
I have a table that receives the concatenation of primary keys from three tables. Like telling Django that these three fields are my primary key
Д
Д
Because Django models can only have one primary key.
Richard
Okay, I see
Shabaz
How to record audio in django and store it in a db sqlite without using ajax
Baban
I want to document my django rest api with swagger, which lib will be a good choice:
1> Django rest swagger
or
2>drf_yasg
Shabaz
Shabaz
William
Rahul
How to manage the drag and drop ordering in django for example in a to-do list if a user rearrange a task from position 5th to 2nd now i want to store the ordering done by the user
Rahul
Almaz
Hello, everyone! I have a question. We can create admin panel after command: python manage.py createsuperuser.
My question is: can we call this admin panel as db or not?
In other words:
Is admin panel = db
Or
Admin panel ≠ db?
Д
Д
.. the people here
Almaz
Д
Clear. Thanks for reply
I have difficulty seeing why you would think the admin panel is a database IF you know what a database is and IF you know what django is
Д
ah I guess I understand now. since it kinda works like a DB browser, you might think that the admin panel in itself serves the DB
Almaz
Д
Yes
django comes with the DB that the Admin panel connects to through the internals of Django.
Д
I mean it's a Web program that you can modify.
Almaz
Almaz
After being registered in admin.py file
Д
Through models from models.py file?
yes, you can do that. you can add your own models and change how they are visualized\printed out. but you can also change the Template pages that the Admin Panel itself prints out.
Д
you could add whatever content you wanted there by using the Django Template language. there is a way to do it.
Д
for instance you could (even) add maps or whatever content you want
Almaz
Clear. Once more thank you for explaining
Д
np. just bored :D
Д
drinking coffee, waiting for my food
Д
no problem
Almaz
Д
today I will eat ice cream
Akash
I want upload 3 different input image fro 3 different input field.
Piyush
Akash
#models.py
ClassDocument(models.model):
Adhar=models.ImageFiled()
BackAdhar=
Pan=
Akash
This is my models file
Akash
How to make view for it
(⌐■-■)
Use request.FILES to get files uploaded and then upload them into model
moja
hello all
running adminer on docker will be following error
Access Error: 404 -- Not Found
what is the problem?
Aman
how can fetch meta data of youtube, vimeo and dailymotion videos via url using javascipt
Д
Д
Sir
I thought, you told me about it
Aman
working*
Д
Anonymous
Hi guys
I’m trying to import data to django by using the import-export library. It was working fine before I deploy it to heroku. When I try to import I constantly have a timeout error. Does someone know a trick that would do the job ? Many thanks in advance
Kalandhar
Hidden
I want to restrict the admin page, I limited it with an IP, but with a proxy changer, it can be bypassed.
I want to make more moves than the number I say, for example, the password was wrong 3 times, do not let anyone log in for an hour.
I want that method and its algorithm
Can anyone help?
Fan / Ac
Kai
def manualLogin(request):
if not request.user.is_authenticated:
customURL = reverse_lazy('login') + '?next=' + reverse_lazy('users:demo')
return redirect(customURL)
return redirect(reverse_lazy('users:demo'))
Kai
This view is working
Kai
class RegisterUser(CreateView):
model = User
success_url = reverse_lazy('login') + '?next=' + reverse_lazy('users:demo')
form_class = UserCreationForm
fields = '__all__'