Anish
How to validate form and print form error in customs form in django
Alex
How to validate form and print form error in customs form in django
been there, done that, use google + your brain
Anish
been there, done that, use google + your brain
Don't use your brainless brain. I am not asking to you ok mind your language.
Alex
there is a good article about this which even i used for different occasions. i doubt you already tried to properly search answers/examples for your issue or you'd have found it already
Alex
I googled it and also serach in documentation but couldn't implement it
because you dont want to google? maybe i will start to "watch my language" when you start to use your brain ;)
Alex
so maybe reconsider some life choices
Alex
You are a nobe don't try to pretend like a pro.
you may have your opinion and i may have mine, lets agree on you not getting help and me having a good laugh about that ;)
Alex
Don't use your brainless brain. I am not asking to you ok mind your language.
It is really a bad idea to lout a fellow member of our community.
Alex
Hey he started first.
no i didnt, if you actually followed my advice you'd already have your solution and wouldn't try to fight like a child :)
Anish
I am not fighting bro you started first.
Alex
Hey he started first.
!ot lets go there if you feel like i mistreated you ;)
Doragonsureiyā
Hey he started first.
Looks like you need an offtopic group, please continue this conversation at @PythonOfftopic
Doragonsureiyā
I am not fighting bro you started first.
I'm not your bro, bro; we weren't hatched from the same egg 🐍🥚
Alex
I am not fighting bro you started first.
+ using the word "bro" after insulting people is bad practice ;)
Anish
I just started django i searched in documentation but couldn't get a clear idea how to validate custom form.
Anish
After that i posted here.
Martín
Please, for a fight, go private If you are going to collaborate for a solution, then do it
Alex
Please, for a fight, go private If you are going to collaborate for a solution, then do it
hello martin, thanks for your nice words, we're onto getting anish where he wants to go
Anish
In place of helping beginner you making fun of them. That's not nice.
Martín
I don't know who is the admin, but I would stop fighting and go to him Or just redirect the whole thing to help each other
Alex
In place of helping beginner you making fun of them. That's not nice.
instead of assuming I'd insult you, you could have assumed i was actually trying to help (your reaction is your choice, a miserable one mate) and so you are to blame :)
Anish
Leave it ok fine tq for your suggestion.
Alex
In place of helping beginner you making fun of them. That's not nice.
Ah, most of us are tired of answering literally the same nooby questions again, again and again. Really, you could find the answer by searching in this chat. So yes, some of us may be not so polite.
Alex
I don't know who is the admin, but I would stop fighting and go to him Or just redirect the whole thing to help each other
hello martin again, not an admin and probably never will be but im in this group for a while and kinda know the drill :)
Alex
Leave it ok fine tq for your suggestion.
https://docs.djangoproject.com/en/3.0/ref/forms/fields/#error-messages you didn't search very well you were instantly defensive good luck with your life :)
Derek
you know what? Stop it
Anish
I know that form.errors and message.error ok
Derek
already kiss each other
Derek
and then kiss me
Derek
and I want a hug.
Alex
and then kiss me
Nice try, mr. ForeverAlowny
Derek
This is how we do it in Django community!
Alex
and I want a hug.
meet me in !ot and we'll see
Alex
!ot
Doragonsureiyā
Looks like you need an offtopic group, please continue this conversation at @PythonOfftopic
Derek
No with insults but with hugs and kisses... with love..
Alex
I know that form.errors and message.error ok
maybe you wanna post your question again properly so people get what you actually want
Anish
If form is not valid Error will print in form and when i refresh it error message disappear but when i do ctrl+r error message shows again. How to deal with that??
Anish
Wait a minute.
Anish
Any ideas??
Use token
Rajat
Which one?
Anish
When user successful registered send a link on user's email id when user click on that link user will be logged in.
Anish
Which one?
https://medium.com/@frfahim/django-registration-with-confirmation-email-bb5da011e4ef
Rajat
https://medium.com/@frfahim/django-registration-with-confirmation-email-bb5da011e4ef
Sir, in this project the link is sending for activation. But i want to send the otp on the mail whenever the user log in the site or register on that site
Current
Anyone who have watched Corey Mscafer django tutorials?
Martín
Anyone who have watched Corey Mscafer django tutorials?
if you are looking for reccomendations for tutorials, I think there are resources in the pinned message 😊
Damron
Hi everyone! We can validate data while creating model in two ways: 1) in ModelForm - using clean_fieldname 2) in Model itself (If there is some another useful method to validate data, pls, tell😅) So - what is the more widely used way to validate data?
.
SELECT name, STRING_AGG(description, ', ') FROM test JOIN ekwdesc ON ekwdesc.value = ANY(test.ekw) GROUP BY name Hi, How can I write a query like this using ORM?
Stenly
def validate_date(date, year, month): if date < datetime.datetime(year=year, month=month, day=1): raise ValidationError('Date cannot be earlier than year and month') class Common(models.Model): MONTH = ( (1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December'), ) month = models.IntegerField(choices=MONTH) year = models.IntegerField(choices=zip(range(2015, 2021), range(2015, 2021))) date = models.DateTimeField(validators=[validate_date]) def __str__(self): return '%s %s' % (self.date, self.month) class Meta: abstract = True unique_together = ('month', 'year')
Stenly
Would you help me with this situation, how to transfer in function "validate_date" parameter "date"?
Stenly
Why don't u include in class methods?
When I include the function in the class, pycharm gives me an error. And in the documentation examples, the validation function is outside the class.
#
Checkout again
Shubham
Stuck in a problem
Damron
Hi I have problem when trying to handle error message when sending post request with fetch JS to django rest, calling serializers.ValidationError, but further fetch doesn't handle this - in console I have an error message: general.js:26 POST http://127.0.0.1:8000/all/ 400 (Bad Request)
Damron
but with proper data all is fine
PV
I am using sweat alert as js in my django project and i found that there is a python package sweetify for this
PV
But they don't have a well documented style, does anyone used that pavkage
Dev
hello, just want to know steps to change default django admin login template to my own customize html page ...??
Dev
anyone?
Dev
confusing...
Dev
i just want simple steps
Alex
i just want simple steps
You want someone to breastfeed you.