Permalink
Browse files

unlock form sizes

  • Loading branch information...
1 parent 9e38b74 commit 8719aaf3c083a8f655fdeae7e3609fb028d0845e @dfalk committed Apr 6, 2012
Showing with 26 additions and 9 deletions.
  1. +0 −9 fprice/forms.py
  2. +26 −0 fprice/static/css/fprice.css
View
@@ -20,11 +20,8 @@ class Meta:
def __init__(self, *args, **kwargs):
super(TitleForm, self).__init__(*args, **kwargs)
- self.fields['shop_visual'].widget.attrs['size'] = 50
self.fields['shop_visual'].widget.attrs['autofocus'] = 'autofocus'
- self.fields['time'].widget.attrs['size'] = 16
self.fields['time'].widget.format = '%Y-%m-%d %H:%M:%S'
- self.fields['summary'].widget.attrs['size'] = 10
class TradeForm(forms.ModelForm):
product_visual = forms.CharField(max_length=200, label="Product", required=True)
@@ -36,10 +33,4 @@ class Meta:
fields = ('product_visual', 'price_visual', 'amount')
#exclude = ('customer', 'price')
- def __init__(self, *args, **kwargs):
- super(TradeForm, self).__init__(*args, **kwargs)
- self.fields['product_visual'].widget.attrs['size'] = 50
- self.fields['price_visual'].widget.attrs['size'] = 10
- self.fields['amount'].widget.attrs['size'] = 9
-
TradeFormSet = formset_factory(TradeForm)
@@ -7,3 +7,29 @@
.prodshop h1 a, a:visited {
text-decoration: underline;
}
+
+/* ============================ FORM =============================== */
+
+#id_shop_visual {
+ width: 350px;
+}
+
+#id_time {
+ width: 140px;
+}
+
+#id_summary {
+ width: 80px;
+}
+
+#id_form-0-product_visual {
+ width: 350px;
+}
+
+#id_form-0-price_visual {
+ width: 80px;
+}
+
+#id_form-0-amount {
+ width: 50px;
+}

0 comments on commit 8719aaf

Please sign in to comment.