Hi All, I am trying to display Data from a database table to display in a Table format. Right now the results are just being bunched up together. For example, when displayed in the web browser the ${ids} returns 1922 instead of 19 22 Now I know that this seems like a basic question, but I looked all over the tutorials, and they seem to concentrate on displaying ALL the data at once, and not to display one row at a time.
model.py contains:
class WebAppPages(SQLObject): class sqlmeta: style=Style(longID=True) idName='pageID'
pageName= UnicodeCol() url = UnicodeCol(notNone=True) post = BoolCol(default=False)
controllers.py contains. And I am sure this is wrong...:
i'm about to finish a small piece of code that will display all rows in a table of your choice, with the option to also add, delete and update rows through ajax.
SMERSH009 wrote: > Hi All, > I am trying to display Data from a database table to display in a > Table format. > Right now the results are just being bunched up together. For example, > when displayed in the web browser the ${ids} returns 1922 instead of > 19 > 22 > Now I know that this seems like a basic question, but I looked all > over the tutorials, and they seem to concentrate on displaying ALL the > data at once, and not to display one row at a time.
> model.py contains:
> class WebAppPages(SQLObject): > class sqlmeta: > style=Style(longID=True) > idName='pageID'
> Hi All, > I am trying to display Data from a database table to display in a > Table format. > Right now the results are just being bunched up together. For example, > when displayed in the web browser the ${ids} returns 1922 instead of > 19 > 22 > Now I know that this seems like a basic question, but I looked all > over the tutorials, and they seem to concentrate on displaying ALL the > data at once, and not to display one row at a time.
> model.py contains:
> class WebAppPages(SQLObject): > class sqlmeta: > style=Style(longID=True) > idName='pageID'
Hi Johnny, your code was close, but is returning an error in the .kid file <tr py:for="row in result"> This line returns: the prefix "py" for attribute "py:for" associated with an element type tr is not bound
Alex, since having to edit these rows was going to be the next step in this difficult project (I am a newbie to Python), you are going to be my lifesaver if your code will work. I will keep checking the thread for your guys' updates.
On Jul 3, 4:12 am, Johnny Blonde <frank.wagner.1...@googlemail.com> wrote:
SMERSH009 wrote: > Hi Johnny, your code was close, but is returning an error in the .kid > file > <tr py:for="row in result"> This line returns: the prefix "py" for > attribute "py:for" associated with an element type tr > is not bound
> Alex, since having to edit these rows was going to be the next step > in this difficult project (I am a newbie to Python), you are going to > be my lifesaver if your code will work. I will keep checking the > thread for your guys' updates.
> On Jul 3, 4:12 am, Johnny Blonde <frank.wagner.1...@googlemail.com> > wrote:
Sorry Jim, I should have specified that this error pops up whether or not I have it set to 'result' or 'results.' "the prefix "py" for attribute "py:for" associated with an element type tr is not bound "
Turbogears1.0 Python v2.5.1c Here is what the template file looks like in my code to match the columns in my DB. Thanks...
> In the sample below you'll need to change the 'result' to 'results' in > the html portion. That is what is being returned in the dict.
> -Jim
> SMERSH009 wrote: > > Hi Johnny, your code was close, but is returning an error in the .kid > > file > > <tr py:for="row in result"> This line returns: the prefix "py" for > > attribute "py:for" associated with an element type tr > > is not bound
> > Alex, since having to edit these rows was going to be the next step > > in this difficult project (I am a newbie to Python), you are going to > > be my lifesaver if your code will work. I will keep checking the > > thread for your guys' updates.
> > On Jul 3, 4:12 am, Johnny Blonde <frank.wagner.1...@googlemail.com> > > wrote:
I believe that you need to specify the proper namespace in the kid template and give it the "py" alias. Check the example in any quickstart application.
Regards, Alaa Salman
On 7/3/07, SMERSH009 <SMERSH0...@gmail.com> wrote:
> Sorry Jim, I should have specified that this error pops up whether or > not I have it set to 'result' or 'results.' > "the prefix "py" for attribute "py:for" associated with an element > type tr is not bound "
> Turbogears1.0 Python v2.5.1c > Here is what the template file looks like in my code to match the > columns in my DB. > Thanks...
> On Jul 3, 11:42 am, Jim Steil <s...@mailbag.com> wrote: > > In the sample below you'll need to change the 'result' to 'results' in > > the html portion. That is what is being returned in the dict.
> > -Jim
> > SMERSH009 wrote: > > > Hi Johnny, your code was close, but is returning an error in the .kid > > > file > > > <tr py:for="row in result"> This line returns: the prefix "py" for > > > attribute "py:for" associated with an element type tr > > > is not bound
> > > Alex, since having to edit these rows was going to be the next step > > > in this difficult project (I am a newbie to Python), you are going to > > > be my lifesaver if your code will work. I will keep checking the > > > thread for your guys' updates.
> > > On Jul 3, 4:12 am, Johnny Blonde <frank.wagner.1...@googlemail.com> > > > wrote:
SMERSH009 wrote: > Sorry Jim, I should have specified that this error pops up whether or > not I have it set to 'result' or 'results.' > "the prefix "py" for attribute "py:for" associated with an element > type tr is not bound "
> Turbogears1.0 Python v2.5.1c > Here is what the template file looks like in my code to match the > columns in my DB. > Thanks...
> On Jul 3, 11:42 am, Jim Steil <s...@mailbag.com> wrote:
>> In the sample below you'll need to change the 'result' to 'results' in >> the html portion. That is what is being returned in the dict.
>> -Jim
>> SMERSH009 wrote:
>>> Hi Johnny, your code was close, but is returning an error in the .kid >>> file >>> <tr py:for="row in result"> This line returns: the prefix "py" for >>> attribute "py:for" associated with an element type tr >>> is not bound
>>> Alex, since having to edit these rows was going to be the next step >>> in this difficult project (I am a newbie to Python), you are going to >>> be my lifesaver if your code will work. I will keep checking the >>> thread for your guys' updates.
>>> On Jul 3, 4:12 am, Johnny Blonde <frank.wagner.1...@googlemail.com> >>> wrote:
Ahh, I finally got it... with your guys' help of course :) This was the way to display the Column value of a specific row: <td py:content="row.pageName"></td> The format: <td py:content="row['name']"> was throwing errors for me. The final product is below... I am still eagerly awaiting for the kind of good stuff Alex has in mind.