修改raw_id_fields字段的输入文本框小部件的大小

时间:2013-05-30 16:21:18

标签: django-admin

我正在尝试使raw_id_fields的输入文本框宽于默认大小,但没有成功。 这是我尝试过的('codarticolo'是raw_id_fields)无济于事:

admin.py

class MovimentomagInline(admin.TabularInline):
    codarticolo = forms.CharField(widget=forms.TextInput(attrs={'size': 80}))
    raw_id_fields = ['codarticolo',]
    fields = ('codarticolo', 'numconfezioni', 'numerounita','totalepezzi')
    model = Movimentomag
    extra=3


class MovimentomagOption(admin.ModelAdmin):
    list_display = ('codarticolo', 'numconfezioni', 'numerounita','totalepezzi')
    fields = ('codarticolo', ('numconfezioni', 'numerounita','totalepezzi',))

class MovimentoOperazioneOption(admin.ModelAdmin):
    list_display = ('segno', 'data_movimento', 'paziente','operatore')
    fields = (('segno','data_movimento'),('paziente','operatore'))
    inlines = [MovimentomagInline,]
    order_by = ['-data_movimento',]

我该怎么办? 再见 维托里奥

1 个答案:

答案 0 :(得分:1)

可能已经晚了5年:(。

我遇到了同样的问题。以下应该有效。

FROM python:3
MAINTAINER dev@temboinc.com
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
ENV MODE dev
EXPOSE 8080
VOLUME /static
COPY src/static /static
RUN python3 setup.py install
#CMD python3 wsgi.py
CMD gunicorn -w 3 -b 0.0.0.0:8080 wsgi --reload

它的作用是设置HTML 输入元素的样式属性。

希望它有所帮助。