I solved this by sorting the tuple of tuples outside of the add/create
custom manipulators, then using that sorted list instead of
ColorAccount.COLORS:
col_list = list(ColorAccount.COLORS)
col_list.sort(lambda x, y: cmp(x[1], y[1]))
col_tuple = tuple(col_list)
And then:
forms.Selec
Hello,
This is a simplified example of what I'm trying to accomplish. In my
model I have the following objects and fields:
class ColorAccount(models.Model):
COLORS = (
(0, 'Red'),
(1, 'Orange'),
(2, 'Yellow'),
(3, 'Green'),
...
)
fav_color = mode
Hello,
This is a simplified example of what I'm trying to accomplish. In my
model I have the following objects and fields:
class ColorAccount(models.Model):
WINE_VARIETALS = (
(0, 'Red'),
(1, 'Orange'),
(2, 'Yellow'),
(3, 'Green'),
...
)
fav_colo
3 matches
Mail list logo