vector
https://linkode.org/#vK00VENKa6eiobjJcJ3pL6
Doragonsureiyā
I am trying to create a blog application using mongo db but whenever i try to save data from django admin i get Attribute error 'NoneType' object has no attribute 'attname' can anyone help?
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Д
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??..
Fan / Ac
Can any one plz tel me why should I learn django??..
read this and see what django is first https://www.djangoproject.com/
Anonymous
read this and see what django is first https://www.djangoproject.com/
Yeh ..I actually started to learn this stuff..but I could get any kind of interesting tho..thatswhy I asked.....
Doragonsureiyā
Yeh ..I actually started to learn this stuff..but I could get any kind of interesting tho..thatswhy I asked.....
looks like you need an offtopic group, please continue this conversation at @pythonofftopic
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
Richard
I would to know how to define a primary Key on many fields on django
Д
I would to know how to define a primary Key on many fields on django
Multiple fields? Not possible. Define one primary key and then add Unique Constraints.
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
Д
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
You're gonna have to do programming. Depending how the data comes/goes, this would probably be some kind of Serializer modification job
Д
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
Charly
How to record audio in django and store it in a db sqlite without using ajax
Record audio is something done in the frontend, nothing to do with Django, storing it yes, but don't store it in the database, save the file in a specific location and Dave the path on the DB
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
William
I've used media as folder and specified in settings now I wanna know how to save the path on db
When you save any file It will already be stored in some directory Check upload_to in filefield
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
Д
I just want the backend logic cause i'm doing this in rest api
the backend logic is completely independent of the frontend logic... I mean there has to be some mapping but you get to decide how you implement that
Rahul
the backend logic is completely independent of the frontend logic... I mean there has to be some mapping but you get to decide how you implement that
Thank you bro I found the solution here https://stackoverflow.com/questions/18212268/django-sorting-object-based-on-user-defined-order-in-template/25893449
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
Д
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
Д
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
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
Almaz
np. just bored :D
np. What does it mean?
Д
no problem
Almaz
no problem
Oh, okay
Д
today I will eat ice cream
Akash
I want upload 3 different input image fro 3 different input field.
Piyush
I want upload 3 different input image fro 3 different input field.
Then, what is your problem? Please explain it briefly
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
that's not a django question
Ok, i just wanted to use my new sticker)
Sir
I thought, you told me about it
Aman
that's not a django question
i'm workibg on django template that's why i asked if anyone know please share
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
how can fetch meta data of youtube, vimeo and dailymotion videos via url using javascipt
Like save from net site Copy a link of video & paste it to download such a video
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?
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__'