Rohan
You need many=True for serialiser when you have more than one object in queryset
Vaibhav
Still getting same
Your query set doesn't have height which is expected by the seralizer
Vaibhav
Try adding height to values.. It will change
Rohan
Just send QS
Rohan
🤷‍♂️🤷‍♂️
Rohan
Also if you want only specified fields, you can’t expect it from same serialiser
Rohan
It's not getting height here
Obviously, you need to use a different serialiser here
Rohan
Make another and in fields, define only fields you want
Vaibhav
Why even send values
Well, i know.. i did suggest to make new seralizer
Rohan
I see
Rohan
Tried to give a hint from QS too but she didn’t get it
Rohan
Maybe you need to read drf docs Sapna
Sapna
Okay
Rohan
In fact not DRF, basic django
Rohan
Serializers
Vaibhav
Maybe you need to read drf docs Sapna
True but it can be overwhelming for new people's at times unless they don't know what these things are doing
Vaibhav
Spoonfeeding won’t do any good either imho
Yup.. i suggest people to stay away from meta classes for starters
Vaibhav
Meta does a lot of stuff, but hides everything
Y
Hello guys how are you? Please i have some issues whith Django
Y
I had take project on github, so when I run following command python manage.py runserver, i obtain this error ModuleNotFound error
Y
Someone's can help me please?
Y
Personally I think that this error is due at python version
Y
Nope, did u install requirements ?
Non I didn't install requirements
Pavan
I only want to know how can i make specific column displayed
In your model serializer , overwrite the to_representation method , this will be called for each item of the list and you can overwrite the reponse json to display what fields you would need
Mirco
Non I didn't install requirements
so that's the problem
Doragonsureiyā
Thanks you
You're welcome! 😊
Mirco
Thanks you
study python before Django 😊
Mirco
Ok I understand
it'll make your Django life easier
Pavan
Okay , Thanks
One more point , if you are using to_representation to overwrite the response json , you can write line 20 of your code , Employee.objects.all() , for to_representation usage please check https://www.django-rest-framework.org/api-guide/relations/
Riccardo
please help me https://stackoverflow.com/questions/69809459/dropdown-dependent-problems-with-saving-in-the-form-part
Anton
Hello! I have an question. I have UpdateView. How i can get form object with data in post method?
Олег
hi, how to fix "'Media' object has no attribute 'render_q'" appears when editing the model in the admin panel
ADI
Is it possible to one data filed to another data filed using Onetoone , foreignkeyfiled,ManytoMany filed Any body guide to me
ADI
One data base to another database fileds
Carlos🇻🇪
hi guys, I've go a strange problem with migrate. Do the manage.py migrate create only the system tables (django, auth and so on) but ignore the migration of the app. Thhe app is listed in INSTALLED_APP, mangage.py makemigrations create the right 0001initial.py file that contain all the definitions, but migrate report a generic OK without create anything. The db is MySql (not a my choice) and django version in 3.2.9. Can anyone suggest any hint to sove this problem? Googling don't give me any valid suggestion
Shilpy
I had take project on github, so when I run following command python manage.py runserver, i obtain this error ModuleNotFound error
There will be one requirements.txt file that contains all the dependencies. So you will have to install those.
Geralt
Hello, i am following django docs tutorial
Geralt
it says add background image using extension gif so name us background.gif
Geralt
why using gif as extension
Geralt
https://docs.djangoproject.com/en/3.2/intro/tutorial06/
Pavan
Try with , python manage.py migrate <your app name>
Carlos🇻🇪
Try with , python manage.py migrate <your app name>
tnaks but I've tried also this way but with the same results
fn
Hi all! If anybody has any ideas, pls help!) https://stackoverflow.com/questions/69804457/how-to-get-a-value-of-foreign-key-between-apps-of-django
anuprash
How to add clipboard features on django project
Y
Hello ,I have some error when I run python manage.py run server So I try to install requirements ,it's impossible
Y
I want to have some solutions please
Y
Error is ModuleNotFoundError:No module named'Meteoapp'
Y
Meteoapp is my application name's
Eric
Meteoapp is my application name's
If your own app can't be found the problem is probably in your settings.py check the BASE_DIR setting is correct
Y
Ok thanks you
Jagadish
Error is ModuleNotFoundError:No module named'Meteoapp'
Try, virtual env to install all yhe requirements and to run the app, this way. It would resolve and you can debug easily if there is any issue.
Anonymous
DJANGO/ COMMAND TO FIND ALL CONTENT WRITTEN BY PARTICULAR USER
Mirco
DJANGO/ COMMAND TO FIND ALL CONTENT WRITTEN BY PARTICULAR USER
There's no need to write in CAPS And Google is out there for you
Mirco
i did, but didn't find.
Imagine you have a model Content with FK to User model called user Content.objects.filter(user=user) Where user can be request.user in your views
Mirco
i did, but didn't find.
Everything is explained inside Django docs so learn how to look for informations 🙂
ms tk
How can i use SQLAlchemy in django, can anyone help me
Mirco
How can i use SQLAlchemy in django, can anyone help me
don't do it Django has its own ORM and it's enough
Danil
Hey guys, I have a model that extends basic user class and I want to create a form that would have a field from that user class (email). I have tried the following, but i get an error AttributeError: 'ForwardOneToOneDescriptor' object has no attribute 'email' class CreateManagerForm(forms.ModelForm): email = forms.CharField() class Meta: model = Manager fields = ['firstName', 'lastName', 'companyName'] def __init__(self, *args, **kwargs): super(CreateManagerForm, self).__init__(*args, **kwargs) user = kwargs.get('instance') email = user.user.email self.fields['email'].initial = email Could you check it pls?
Doragonsureiyā
Sai
Any alternative websocket integration rather than channels. My requirement is just to notify the client if model change. Frontend: Angular Note: I know channels are preferred, but my project is LIVE.
BinKhalid
Hello, I have an English website built with Django, is there any way to make it in another language? Like translate it or something