Duh, right after I clicked send I saw the mistake. don't need to put quotes around '0' and it works.

however it screws up my layout but I don't know why it screw up my table cells. Argh.. !! kid is a pain, I don't know Geshi, but hopefully it won't hurt as much.


On 10/27/06, Michael Steinfeld <[EMAIL PROTECTED]> wrote:


Now to address your problem I would try something like this
<td py:for="" in d">
    <span py:if="data="" py:strip=''><br/></span>
    <span py:if="data!='0'" py:strip=''>${data}</span>
</td>

And the py:strip should get rid of the span tags in the final output
so they aren't taking up preciuos page size.
-Ian

Thanks Ian, this seems not to work :( Here is my code

    <tr>
        <tr py:for="" in monthcal">
            <td py:for="" in days">
                <span py:if="day=='0'" py:strip=''><br/></span>
                  <span py:if="day!='0'" py:strip=''>${day}</span>
            </td>
        </tr>
    </tr>

It's seems quite ridiculous to create control flow like this, almost absurd.

here is my code that I am converting, Hopefully you can offer another suggestion

         for days in self.getMonthCal ():
                for day in days:
                    if day == 0:
                        print '<td bgcolor=eeeeee></td>'
                    else:
                        print '<td  bgcolor=#29558D align=middle>'
                        print '<a class=links href="">                        print '</td>'

The style is not such concern, above python code works perfect in my CGI, I just can't get it to work in .kid

thanks again.










 

On 10/27/06, Michael Steinfeld < [EMAIL PROTECTED]> wrote:
> I don't know .. is it just me to spend more time trying to get thing done
> with kid templates then working with turbogears?
> I have a project that has been a lot of fun to working except for kid, it
> occupies the majority of my team and delays my project completion.
>
> If I was a bully, I would beat that kid up!
>
> Anyhow, I am simply trying to do a simple if/else statement and it is
> driving me mad. I need your guys help. What would be the best way to do it?
>
> Python Code I am converting:
>
> if data = "">>    print "<td class='lightsout'></td>"
> else:
>    print  "<td class='lightson'> data </td>"
>
>
> kid template code
>
>
>  <tr py:for="" in results">
>       <td py:for="" in d">
>          ${data}
>
> actually, easier said.. I am trying to replace all occurrences of string "0"
> with an empty string ""
>
> I have read the kid docs but they seem to be pretty brief and missing a lot
> of helpful information.
>
> thanks in advance.
>
>
>
> --
> -mike
>
>
>  >
>






--
-mike




--
-mike


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to