Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

I use the SelectDateWidget in my form and want to give default values for year and month, but show the empty_label (----) on day. I either get all three fields to be empty_label, or all fields showing ...
ManuelCosmo's user avatar
1 vote
1 answer
117 views

I am on Django 5.0.7. I wanted to define a custom widget SearchBar, which when associated with a CharField, would automatically render a text input box for search, followed by a search button. I ...
fishfin's user avatar
  • 313
1 vote
2 answers
227 views

I have a django 4 form having some widgets for the user to select some values: from django import forms from .app.model import MyModel from bootstrap_datepicker_plus.widgets import DatePickerInput ...
swiss_knight's user avatar
  • 8,381
0 votes
1 answer
470 views

I don't want to use my own JS or alter the template when Django has other mechanisms. I've tried three methods, first as described in how-to-add-placeholder-text-to-a-django-admin-field and in the ...
Ron's user avatar
  • 255
0 votes
0 answers
55 views

I have a form that works both for when creating a new instance or editing one, on django. The problem is that no matter what scenario, even when I fill the input file fields, it always returns error ...
Fabíola's user avatar
  • 134
0 votes
1 answer
453 views

I am creating a simple app to do product reviews. I have a Product, Manufacturer and Review models which I will now summarize class Manufacturer(models.Model): name = models.CharField() class ...
Tiziano Pedrazzoli's user avatar
2 votes
1 answer
202 views

I wrote a model form. I used widgets to make radio buttons and I want a particular radio button to be checked by default while rendering the form in my html file. Model: class Room(models.Model): ...
Anshul Gupta's user avatar
1 vote
2 answers
711 views

I have dealt with only ModelForm previously, so it is my first time using Form. I'd like to get rid of labels from my form, however, how I get rid of labels in ModelForm does not seem to work with ...
gtj520's user avatar
  • 327
0 votes
1 answer
265 views

Django Form fields needs to be encrypted at server side and needs to be decrypted in client browser while rendering and vice versa for form submission One approach is using JS cryptographic libraries ...
N2022's user avatar
  • 1
2 votes
1 answer
123 views

Tried to make custom widget for RangeFilter. Every time django raises TemplateDoesNotExist Template-loader postmortem Django tried loading these templates, in this order: Using engine django: django....
Danza's user avatar
  • 93
1 vote
1 answer
1k views

I have a model for a group that has two fields: leader and description. models.py class Group(models.Model): leader = models.ForeignKey(User, on_delete=models.CASCADE) description = models....
Yehuda's user avatar
  • 133
0 votes
1 answer
1k views

Am wondering how i can get this html code into a forms.py in my ReviewForm as widgets. This code: 'rating': forms.Select(attrs={'class': 'form-control',}), Should be as the html code under with 1-5. ...
tobias's user avatar
  • 79
0 votes
1 answer
226 views

#view.py class JobCreateView(CreateView): model = Job template_name = 'Job_create.html' fields = ['Company' ,'Job_title','Department','Start_date','end_date','Consent'] def form_valid(...
YANAKORN SITTIWAN's user avatar
2 votes
2 answers
2k views

I am trying to change the date format from mm/dd/yyyy to dd/mm/yyyy in a DateInput widget. I am trying to change the format the following way. class Meta: model = Patient fields = '__all__' ...
SwaggyPP1130's user avatar
0 votes
1 answer
96 views

My models: class Ingredient(models.Model): BASE_UNIT_CHOICES = [("g", "Grams"), ("ml", "Mililiters")] CURRENCY_CHOICES = [("USD", "US ...
Guillermo's user avatar
0 votes
0 answers
1k views

I've defined the following custom widget in forms.py, which over rides the standard HTML to create a "live search" select menu (user can enter free text to search options, useful when there ...
rcx935's user avatar
  • 327
1 vote
1 answer
1k views

Plugged in TempusDominus widget for DateTimeField in Django admin. The task is to enable date selection with scaling by months and years. The standard widget doesn't have that option. But Django, when ...
Oleg Glazunov's user avatar
1 vote
1 answer
1k views

I am trying to use the FilteredSelectMultiple widget from the admin widgets library. I was able to get the widget displayed on the web page. However, I cannot get the buttons to move the selections to ...
don's user avatar
  • 597
0 votes
2 answers
633 views

I have been looking for a way to find out who the current logged-in user is in Django Wagtail so that I could create a widget to render a base setting field to be editable/non-editable. I was able to ...
leol's user avatar
  • 69
0 votes
1 answer
2k views

I am trying to stylize my form using bootstrap. As you know bootstrap uses a lot of classes in order to do what it does. By googling I have found to inject some new classes into my form I could use ...
mharre's user avatar
  • 293
0 votes
1 answer
652 views

I have used package "django-yearmonth-widget" to have year and month selection and not complete date. Here, day is fixed i.e. 1st of every month. This implementation is working fine. Package:...
Ronak's user avatar
  • 215
1 vote
0 answers
152 views

I have a date field of a form and I want it to have a format like '21 jan 2020' but I can't find a way to pass it on the selectDate widget class MemoryForm(ModelForm): class Meta: model = ...
Guilherme Luiz's user avatar
0 votes
1 answer
235 views

I am new to this field. I am working on Dependent Dropdowns for which i took reference from here. On replicating the same with the following code: Forms.py class AddressForm(forms.ModelForm): class ...
Ritu's user avatar
  • 1
1 vote
0 answers
352 views

models.py class MyModel(models.Model): company = models.ForeignKey(Company, db_column="company", default=None, on_delete=models.DO_NOTHING, null=True) forms.py class myform(forms....
90's_jaddu's user avatar
0 votes
1 answer
483 views

For a M2O relation what field should I be using in forms? models.py class Studio(models.Model): name = models.SlugField(max_length=100) rating = models.CharField(max_length=10, default=None) ...
Dragos Neata's user avatar

1
2 3 4 5
7