Tuesday, March 3, 2015

Re: icons let the template or resolve in the view?

I didn't thing to put them as classes LOL.
thanks!


On Tuesday, March 3, 2015 at 3:17:58 PM UTC-6, felix wrote:
El 03/03/15 13:54, dk escribió:
right now  I am not using models, form the database,  as concept I am pinging the computer,  and making a list of lists with the ip and if the machines is up or down, like this.

this is what I am passing to the template.
[ [up, machine1],[up, machine2],[down, machine3]  ]


should I pass something like
[ [path/to/icon, machine1], [path/to/icon, machine2], [path/to/icon, machine3] ]

or make and if then in the loop of the template and get the icons from there?


I prefer the first way, just like you are doing now and then I would define a CSS class for UP and another for DOWN states to set the src property of the img tag (this is HTML) showing the state of the computer.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/66909157-fd08-409c-9ded-790e8b60af9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment