godmode
how yo make a foreignKey blank=True?
godmode
we are talking about a model field into a models.py
godmode
Now it works... i didn't apply and migrate
Anonymous
Hi, I am having a strange problem in formset. I am using multiple modules with modelformset in update view but when I hit save button then it save only last form. I can see that hidden id field's name are also same for all forms. Any help?
Leonardo
guys, i need to change my date format before save it on database, im trying to do that on perform create, but its not working
Leonardo
serializer.is_valid(raise_exception=True) self.perform_create(serializer) headers = self.get_success_headers(serializer.data) return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
Leonardo
its DRF
Mirco
guys, i need to change my date format before save it on database, im trying to do that on perform create, but its not working
https://www.django-rest-framework.org/api-guide/serializers/#validation Use the validate_field on your date field into the serializer
Leonardo
im not validating, im changing the date format
Mirco
im not validating, im changing the date format
So you can override your model's save method and change the format as u want for example
Leonardo
So you can override your model's save method and change the format as u want for example
ive found to_internal_value, its seems the properly method for that
Leonardo
thx btw @pyflare
Anonymous
I am new to this group can anyone help me to give me a few pointers where can i start learning from
Pieas
hello, I am using the default signup from django. but it only shows username, password & confirm password. how can i get the fields first_name, last_name and email and make them required ??
Firdaus
maybe create a custom form based from the built-in auth forms? https://docs.djangoproject.com/en/3.0/topics/auth/default/#module-django.contrib.auth.forms
Gaurav
how to write a model which can be either updated or deleted..... actually, I want to write 'about us' section in my website and I am stucked in designing the model for this..... The "about us" should be editable and deletable..... how to do that?
Anonymous
But it is not playing
Is that video default Or it has to to be accessed from Database?
Gaurav
You can delete or update the information
yeah, but I dont want to display 'add more' option in the admin dashbord, which comes by default
Gaurav
U have to override admin template
there should be some easier ways
Gaurav
@GouravSaini125 I just want to design models for about us template
Gourav
Sorry, I couldn't get what ur problem is❓
Gaurav
Sorry, I couldn't get what ur problem is❓
In simple words, how to design model for the about us page.....
Gourav
Just type down the fields you want to have in ur models.py
Gaurav
Just type down the fields you want to have in ur models.py
should I use many-to-one relation then?
Gourav
DM me plz, let's talk there
Dharmendra
Can change default date format at modal level
Ajay
Int() argument must be string a byte like object or a number not user error in django
Ajay
Help me guys
Gourav
Send me ss
Gourav
Error during template rendering
The line where the error has been occurred is being shown, check it
◇Сущ
Hi, there! Need some help with project. How I can send the code? It a lot
◇Сущ
Use pastebin.com
Thx, one moment
Gaurav
Thx, one moment
Hey its pastebin.com
Gaurav
And share the link
Gaurav
Thx, one moment
If you have more than one file... Then write file name and comment it out and then paste the code
Gaurav
Do this for every file
Rohan
Use pastebin.com
Or use git instead and share repo
Rohan
In case there are multiple files
Gaurav
Or use git instead and share repo
Yeah.... The best idea!
◇Сущ
Repo: https://github.com/aliensowo/mysicaly // So, troubles in shop/models, shop/view, shop/urls AttributeError at / ‘UpCatrgory’ object has no attribute ‘get’
◇Сущ
Mb it’s very stupid mistake, but im 3 days without sleep and deadline is knock
Rohan
Or just paste your error log on pastebin and toss the link here
◇Сущ
https://pastebin.com/Fhe2J4JC
Rohan
This doesn't seem complete
◇Сущ
A
◇Сущ
https://github.com/aliensowo/mysicaly/blob/master/shop/view.py
Firdaus
Repo: https://github.com/aliensowo/mysicaly // So, troubles in shop/models, shop/view, shop/urls AttributeError at / ‘UpCatrgory’ object has no attribute ‘get’
url(r'UpCategory/(?P<upcategory_slug>[\w\-]+)/$', view.UpCategory, name='CategoryListByCategory'), Either UpCategory view is missing or you mispelled it.
Rohan
This happens during runserver? Can you tell me how to reproduce this? Looks like you're not using the manager somewhere or it's ambiguous with some other class name
Rohan
the server starts successfully I follow localhost:8000 And happened
why do you not have a requirements file in your repo?
Rohan
I can't even reproduce it on my machine :/
Anonymous
I am sending image through contact form from template to admin side All the data of form is ok but the image is not opening there in admin side How to set this...?
◇Сущ
Hah
Hari
Hi guys any one here
◇Сущ
https://pastebin.com/H1ipMMMn
◇Сущ
I think trouble in shop/urls But I can’t find
Shreehari
Anyone has made a basic django based application for banking like stuff? If yes, please share it.
◇Сущ
Is that the complete error message you get?
https://pastebin.com/H1ipMMMn
◇Сущ
New
Anonymous
https://pastebin.com/H1ipMMMn
It looks like you have defined your view incorrectly in your shop/urls.py file
Anonymous
I could not find a view with name view.UpCategory in the views.py file