Zope with Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Holger Butschek

    Zope with Python

    Hy,

    I'm using following code.

    <dtml-in expr="sqlBestan dGetKuerzel(KUR ZFORM='B',BEREI CH='01')">
    B/<dtml-var RUBRIK>/<dtml-var expr="_.math.in t(ANZAHL) + 1">
    </dtml-in>

    Whats wrong with it. I'm always getting the following error:
    Error Type: AttributeError
    Error Value: 'math' module has no attribute 'int'

    Can anybody help me please.

    Bye,
    Holger


  • Wolfram Kraus

    #2
    Re: Zope with Python

    Heyho!

    Holger Butschek wrote:[color=blue]
    > Hy,
    >
    > I'm using following code.
    >
    > <dtml-in expr="sqlBestan dGetKuerzel(KUR ZFORM='B',BEREI CH='01')">
    > B/<dtml-var RUBRIK>/<dtml-var expr="_.math.in t(ANZAHL) + 1">
    > </dtml-in>[/color]
    int is a bulit-in function, you don't need math here.
    [...]
    [color=blue]
    >
    > Bye, Holger[/color]

    HTH,
    Wolfram

    Comment

    • Dragos Chirila

      #3
      Re: Zope with Python

      Hi

      int is a "global" method not a method from math module, so write like this:

      <dtml-var expr="_.int(ANZ AHL) + 1">

      Dragos


      [color=blue]
      > Hy,
      >
      > I'm using following code.
      >
      > <dtml-in expr="sqlBestan dGetKuerzel(KUR ZFORM='B',BEREI CH='01')">
      > B/<dtml-var RUBRIK>/<dtml-var expr="_.math.in t(ANZAHL) + 1">
      > </dtml-in>
      >
      > Whats wrong with it. I'm always getting the following error:
      > Error Type: AttributeError
      > Error Value: 'math' module has no attribute 'int'
      >
      > Can anybody help me please.
      >
      > Bye,
      > Holger
      >
      >
      > --
      > http://mail.python.org/mailman/listinfo/python-list
      >[/color]


      Comment

      • Holger Butschek

        #4
        Re: Zope with Python

        OK. Thanks very much to you both.

        "Holger Butschek" <spam@butsche k-consult.de> schrieb im Newsbeitrag
        news:c3ennc$26i p36$1@ID-65440.news.uni-berlin.de...[color=blue]
        > Hy,
        >
        > I'm using following code.
        >
        > <dtml-in expr="sqlBestan dGetKuerzel(KUR ZFORM='B',BEREI CH='01')">
        > B/<dtml-var RUBRIK>/<dtml-var expr="_.math.in t(ANZAHL) + 1">
        > </dtml-in>
        >
        > Whats wrong with it. I'm always getting the following error:
        > Error Type: AttributeError
        > Error Value: 'math' module has no attribute 'int'
        >
        > Can anybody help me please.
        >
        > Bye,
        > Holger
        >
        >[/color]


        Comment

        Working...