In a template, I have a list of objects, where each object has a "name" and a "group". The list is sorted by group. Is there any way in my django template for loop iteration to determine when the group changes? Basically, I'd like to add an alternating css class whenever the group changes.
rtpg has quit
aclark
jnormandeau: i suppose you could mix them all in e.g. MyAdmin(DjangoReversionAdmin, etc.)
knbk
doughj3: {% ifchanged obj.group %}
doughj3
Oh man that's awesome
Thanks, knbk!
msheiny joined the channel
natea has quit
jnormandeau
aclark: Will that work if they override the same methods?
onthestairs joined the channel
aclark
jnormandeau: probably not
I mean, no idea really. I would try it and see.
rfv
hey guys, any article on the web or some best practices for handling large models with columns that have lots of choices ?
rpkilby has quit
djm- joined the channel
Hairy has quit
crakrjak joined the channel
skyrz has quit
primehaxor has quit
Zeograd joined the channel
tianyi has quit
lacrymology joined the channel
Diegao joined the channel
autrilla_
How could I easily let someone view my django site if I can't open ports? I do have a VPS
crakrjak joined the channel
crakrjak has quit
maryokhin has quit
Genitrust has quit
themsay joined the channel
Hairy joined the channel
mberk joined the channel
drinkie
hmm, does anyone have much experience using django-gears? i'm getting a python3 syntax error, but as best I can tell, this is supposed to be supported for python3. does anyone know for sure if it's supposed to run on python3?
johnride has left the channel
crakrjak joined the channel
diphtherial
drinkie: posting the error may help. also, thanks for the heads up about gears; i was previously unaware of it
(i've been using a client-side framework, ember.js, which features a pipeline for compiling assets. i was wondering if a similar thing existed for django, but hadn't been sufficiently motivated to look.)
hi, can someone point me in the right direction for using a ForeignKey on a model, but not returning every version of that model saved to the database? I think django-cms saved a new ID for each revision I’ve made and I’d like to just return the newest revision
aminho joined the channel
juliaelman has quit
rpkilby joined the channel
graingert_ has quit
ustunozgur joined the channel
cyberspace- joined the channel
Shariq has quit
straykiwi joined the channel
straykiwi
getting performance issues with taggit similar_objects, anybody encountered this?
Shariq joined the channel
aminho has quit
robvdl joined the channel
silverfix has quit
graingert_ joined the channel
Shariq has quit
rando305 joined the channel
vdboor joined the channel
PaulN joined the channel
rando305 joined the channel
__main__ has quit
luke` has quit
c9mm9dore joined the channel
jmurphyau joined the channel
rpkilby has quit
gremly joined the channel
geisst-london joined the channel
rpkilby joined the channel
rando305 joined the channel
litewait has quit
Fervicus joined the channel
Fervicus
I have UserProfile model which has a foreign key to Django's User model.
How can I do prefetching in User.objects.all()?
juztin joined the channel
right now it is doing one query for each user instead of optimizing them
moldy
Fervicus: User.objects.prefetch_related(UserProfile), or something like that
Fervicus: check the docs. i cannot remember the details.
yeukhon joined the channel
underthehill has quit
AntiSpamMeta has quit
knbk
you need to use the related query name, probably prefetch_related('userprofile')