我的十进制 ModelForm 字段会在字段内部显示“向上/向下箭头”,这会增加/减少字段的值。有什么方法可以去除/隐藏这些箭头吗?
表单:
表单:
class PriceAssessment1Form(forms.ModelForm):
class Meta:
model = Component
fields = ['size_height','size_width','size_length','weight','base_material_price']
模型
class Component(models.Model):
name = models.CharField(max_length=255)
created_date= models.DateTimeField(default=datetime.now)
user = models.ForeignKey(User)
price_assessment_started = models.BooleanField(default=False)
size_height = models.DecimalField(null=True,blank=True, max_digits=9, decimal_places=2)
size_width = models.DecimalField(null=True,blank=True, max_digits=9, decimal_places=2)
size_length = models.DecimalField(null=True,blank=True, max_digits=9, decimal_places=2)
weight = models.DecimalField(null=True,blank=True, max_digits=9, decimal_places=2)
base_material_price = models.DecimalField(null=True,blank=True, max_digits=9, decimal_places=2)
Template
<form action="{% url 'portal_price_assessment' component_id %}" method="post"> {% csrf_token %}
<div>
<div>size_height {{ form.size_height }}</div>
<div>size_width {{ form.size_width }}</div>
<div>size_length {{ form.size_length }}</div>
<div>weight {{ form.weight }}</div>
<div>base_material_price {{ form.base_material_price }}</div>
</div>
<div style="margin-top:18px;">
<a href="{% url 'portal_home' %}" class="btn btn-link">Cancel</a>
<button class="btn" type="submit" > Save & Close</button>
</div>
</form>