Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

make django admin page text box smaller

from django.forms import TextInput, Textarea
from django.db import models

class YourModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.CharField: {'widget': TextInput(attrs={'size':'20'})},
        models.TextField: {'widget': Textarea(attrs={'rows':4, 'cols':40})},
    }
Comment

PREVIOUS NEXT
Code Example
Python :: change a coolumn datatype in pandas 
Python :: sum of fraction numbers in python 
Python :: python how to write array into matlab file 
Python :: rename last layer of keras model 
Python :: python emoji convert 
Python :: Python NumPy transpose Function Syntax 
Python :: tensorflow use growing memory 
Python :: check if element is in list 
Python :: no exception message supplied django template 
Python :: reverse relationship in django for one to one field for usage in Django rest serializer 
Python :: gpu DBSCAN python 
Python :: python string to lowercase 
Python :: python logging repeated messages 
Python :: Acticating virtual environment 
Python :: open python file with read write permissions 
Python :: python get dir from path 
Python :: python download chromebook 
Python :: python prevent print output 
Python :: check command 
Python :: looping through the list 
Python :: decode a qrcode inpython 
Python :: get coordinates of an image from a pdf python 
Python :: how to split strings in python 
Python :: import pyx file 
Python :: os module 
Python :: Python Program to Shuffle Deck of Cards 
Python :: multiple model search in django rest framework 
Python :: como poner estado a un bot en discord 
Python :: python linter 
Python :: cpickle python 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =