Code

Changes between Version 35 and Version 36 of NewformsHOWTO


Ignore:
Timestamp:
06/09/08 06:33:54 (6 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewformsHOWTO

    v35 v36  
    108108#!python 
    109109    def formfield_for_dbfield(self, db_field, **kwargs): 
    110         field = super(MyModel, self).formfield_for_dbfield(db_field, **kwargs) # Get the default field 
     110        field = super(MyModelAdmin, self).formfield_for_dbfield(db_field, **kwargs) # Get the default field 
    111111        if db_field.name == "the_field_I_want_to_change": # Check if it's the one you want 
    112112            field.widget.attrs['class'] = "my_new_class" # Poke in the new  
     
    211211 
    212212def results(cl, col_templates):     
     213 
    213214    for res in cl.result_list: 
    214215        rl = list(admin_list.items_for_result(cl, res))