django-validation
Adding css class to field on validation error in django
I am usingDjango\'s modelform and its really good. How can I highlight the actual text box (e.g. border:red ) if there is a validation error associated with it开发者_开发问答. Basically what i want is[详细]
2023-02-07 20:17 分类:问答Django - access m2m objects (or raw pks) from ``clean`` before model is saved
Of course you can\'t just use self.related_field.objects.all(), or you\'ll get a ...needs to have a primary key... error, but if I want to run custo开发者_运维知识库m validation inside of Model.clean,[详细]
2023-02-06 12:28 分类:问答django form validation based on whether field has value
When I submit an empty form with a phone_type selected (for formHomePhone) the form returns its self without a value selected in phone_type stipulating This field is required[详细]
2023-02-05 10:57 分类:问答Why doesn't django's model.save() call full_clean()?
I\'m just curious if anyone knows if there\'s good reason why django\'s orm doesn\'t call \'full_clean\' on a model unless it is being saved as part of a model form.[详细]
2023-01-31 02:21 分类:问答How to check value transition in Django (django-admin)? (Revisited)
I was wondering about 开发者_运维百科how to control transitions in model data.I found the solution at How to check value transition in Django (django-admin)? but when I tried to implement it within my[详细]
2023-01-12 23:23 分类:问答How can I create sophisticated Django Model Validation for Django Admin?
I have the following model in Django: class Bout (models.Model): fighter_1 = models.ForeignKey(Fighter, related_name=\"bout_fighter_1\")[详细]
2023-01-12 19:52 分类:问答Django TextField max_length validation for ModelForm
Django does not respect the max_length attribute of TextField model field while validating a ModelForm.[详细]
2023-01-06 07:32 分类:问答Django Formset validation with an optional ForeignKey field
Having a ModelFormSet built with modelformset_factory and using a model with an optional ForeignKey, how can I make empty (null) associations to validate on that form?[详细]
2022-12-29 16:15 分类:问答Django 1.1.1, need custom validation dependent on other fields
I have 3 models in a Django app, each one has a \"hostname\" field.For several reasons, these are tracked in different models:[详细]
2022-12-19 08:14 分类:问答Django: Does model_instance.clean() run before basic validators?
Let\'s say that I have a model: class Ticket(models.Model): client = models.ForeignKey(Client) color = models.CharField(max_length=255)[详细]
2022-12-18 16:48 分类:问答
加载中,请稍侯......