Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

No data showing

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


ksmclane at us

Apr 27, 2012, 7:07 AM

Post #1 of 11 (274 views)
Permalink
No data showing

OK, I still can't get "->all" to work, but this:

$c->stash(accounts => [
$c->model('ORANGES::AccountView')->find({account_name => 'GHODB2'}) ]);

returns one row, as it should, but there is no data showing in my page.
Obviously the query is successful, so the data must exist or it could not
match, but I am at a loss to know where my data is and why it isn't
showing in my page.

any ideas?

Regards



Kenneth McLane
700 Locust St

Systems Compliance Services
Dubuque, 52001-6838
I1OB
USA
GTS Services Delivery


Phone:
+1-563-845-4674


Tie-Line:
946-4674


Mobile:
+1-563-940-7147


e-mail:
ksmclane [at] us


"Ideas come from everything" -- Alfred Hitchcock


steve at matsch

Apr 27, 2012, 7:36 AM

Post #2 of 11 (268 views)
Permalink
Re: No data showing [In reply to]

It looks to me like you're returning a list.
On 4/27/2012 10:07 AM, Kenneth S Mclane wrote:
> OK, I still can't get "->all" to work, but this:
>
> $c->stash(accounts => [
> $c->model('ORANGES::AccountView')->find({account_name => 'GHODB2'}) ]);
>
> returns one row, as it should, but there is no data showing in my
> page. Obviously the query is successful, so the data must exist or it
> could not match, but I am at a loss to know where my data is and why
> it isn't showing in my page.
>
> any ideas?
>
> Regards
> ------------------------------------------------------------------------
>
> *Kenneth McLane* 700 Locust St
> Systems Compliance Services Dubuque, 52001-6838
> I1OB USA
> GTS Services Delivery
> Phone: +1-563-845-4674
> Tie-Line: 946-4674
> Mobile: +1-563-940-7147
> e-mail: ksmclane [at] us
> ------------------------------------------------------------------------
> "Ideas come from everything" -- Alfred Hitchcock
>
>
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


jorge.gonzalez at daikon

Apr 27, 2012, 7:43 AM

Post #3 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

Can we see your template? How are you accesing your data there?

Just a matter of style, but if "accounts" is going to hold a list of
just one element, why not name it "account" (singular) and stick the row
directly in it, instead of a list? That way, in your template you can
access it just by [% account %] (if usint TT), instead of having to
traverse the list (with for, next, etc.) or index the first element...

Regards
J.

El 27/04/12 16:07, Kenneth S Mclane escribió:
> OK, I still can't get "->all" to work, but this:
>
> $c->stash(accounts => [
> $c->model('ORANGES::AccountView')->find({account_name => 'GHODB2'}) ]);
>
> returns one row, as it should, but there is no data showing in my
> page. Obviously the query is successful, so the data must exist or it
> could not match, but I am at a loss to know where my data is and why
> it isn't showing in my page.
>
> any ideas?
>
> Regards
> ------------------------------------------------------------------------
>
> *Kenneth McLane* 700 Locust St
> Systems Compliance Services Dubuque, 52001-6838
> I1OB USA
> GTS Services Delivery
> Phone: +1-563-845-4674
> Tie-Line: 946-4674
> Mobile: +1-563-940-7147
> e-mail: ksmclane [at] us
> ------------------------------------------------------------------------
> "Ideas come from everything" -- Alfred Hitchcock
>
>
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/


ksmclane at us

Apr 27, 2012, 7:48 AM

Post #4 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

Yes, that is my intention, however I wanted to "prove" that I was really
getting results. If I replace the "->all" I get the expected hundreds of
rows that I want, but no data shows in the page.



From:
Steve <steve [at] matsch>
To:
catalyst [at] lists
Date:
04/27/2012 09:39 AM
Subject:
Re: [Catalyst] No data showing



It looks to me like you're returning a list.
On 4/27/2012 10:07 AM, Kenneth S Mclane wrote:
> OK, I still can't get "->all" to work, but this:
>
> $c->stash(accounts => [
> $c->model('ORANGES::AccountView')->find({account_name => 'GHODB2'}) ]);
>
> returns one row, as it should, but there is no data showing in my
> page. Obviously the query is successful, so the data must exist or it
> could not match, but I am at a loss to know where my data is and why
> it isn't showing in my page.
>
> any ideas?
>
> Regards
> ------------------------------------------------------------------------
>
> *Kenneth McLane* 700 Locust St
> Systems Compliance Services Dubuque, 52001-6838
> I1OB USA
> GTS Services Delivery
> Phone: +1-563-845-4674
> Tie-Line: 946-4674
> Mobile: +1-563-940-7147
> e-mail: ksmclane [at] us
> ------------------------------------------------------------------------
> "Ideas come from everything" -- Alfred Hitchcock
>
>
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


ksmclane at us

Apr 27, 2012, 7:50 AM

Post #5 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

This was a test to make sure I was actually getting data. My intention is
to return all rows in pager format. I haven't made it to that part yet.
Here is my template code:

<table width="100%" border="1">
<tr><th>Department</th><th>Account Code</th><th>Account
Name</th><th>Policy</th><th>Compliant</th><th>Servers</th><th>Subsystems</th><th>Complete</th><th>Status</th></tr>
[% # Display each account in a table row %]
[% FOREACH account IN accounts -%]
<tr>
<td>1[% accounts.department_id %]</td>
<td>2[% accounts.account_code %]</td>
<td>3[% accounts.account_name %]</td>
<td>4[% accounts.account_policy %]</td>
<td>5[% accounts.percent_compliant %]</td>
<td>6[% accounts.num_servers %]</td>
<td>7[% accounts.num_subsystems %]</td>
<td>8[% accounts.percent_complete %]</td>
<td>9[% accounts.account_status %]</td>
</tr>
[% END -%]
</table>



From:
Jorge Gonzalez <jorge.gonzalez [at] daikon>
To:
catalyst [at] lists
Date:
04/27/2012 09:44 AM
Subject:
Re: [Catalyst] No data showing



Can we see your template? How are you accesing your data there?

Just a matter of style, but if "accounts" is going to hold a list of just
one element, why not name it "account" (singular) and stick the row
directly in it, instead of a list? That way, in your template you can
access it just by [% account %] (if usint TT), instead of having to
traverse the list (with for, next, etc.) or index the first element...

Regards
J.

El 27/04/12 16:07, Kenneth S Mclane escribió:
OK, I still can't get "->all" to work, but this:

$c->stash(accounts => [
$c->model('ORANGES::AccountView')->find({account_name => 'GHODB2'}) ]);

returns one row, as it should, but there is no data showing in my page.
Obviously the query is successful, so the data must exist or it could not
match, but I am at a loss to know where my data is and why it isn't
showing in my page.

any ideas?

Regards


Kenneth McLane
700 Locust St

Systems Compliance Services
Dubuque, 52001-6838
I1OB
USA
GTS Services Delivery


Phone:
+1-563-845-4674


Tie-Line:
946-4674


Mobile:
+1-563-940-7147


e-mail:
ksmclane [at] us


"Ideas come from everything" -- Alfred Hitchcock





_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


billcrawford1970 at gmail

Apr 27, 2012, 7:54 AM

Post #6 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

On 27 April 2012 15:50, Kenneth S Mclane <ksmclane [at] us> wrote:

> This was a test to make sure I was actually getting data. My intention is
> to return all rows in pager format. I haven't made it to that part yet.
> Here is my template code:
>
> <table width="100%" border="1">
> <tr><th>Department</th><th>Account Code</th><th>Account
> Name</th><th>Policy</th><th>Compliant</th><th>Servers</th><th>Subsystems</th><th>Complete</th><th>Status</th></tr>
> [% # Display each account in a table row %]
> [% FOREACH account IN accounts -%]
>
^^^^^^^

> <tr>
> <td>1[% accounts.department_id %]</td>
>
^^^^^^^^

You're simply referring to the list instead of the item here.


stuart at morungos

Apr 27, 2012, 8:02 AM

Post #7 of 11 (264 views)
Permalink
Re: No data showing [In reply to]

Surely that should be [% account.department_id %], etc.

All the best
Stuart

On 2012-04-27, at 10:50 AM, Kenneth S Mclane wrote:

> [% accounts.department_id %]


ksmclane at us

Apr 27, 2012, 8:09 AM

Post #8 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

I swear I tried that and it still didn't work. It does now, thank you. Can
you tell me what I need to add to "$c->stash(accounts => [
$c->model('ORANGES::AccountView')->all ]);" to sort by the account_code in
ascending order? It's obviously "sort, but the actual syntax is what I'm
looking for. Thanks again.




From:
Will Crawford <billcrawford1970 [at] gmail>
To:
The elegant MVC web framework <catalyst [at] lists>
Date:
04/27/2012 09:55 AM
Subject:
Re: [Catalyst] No data showing





On 27 April 2012 15:50, Kenneth S Mclane <ksmclane [at] us> wrote:
This was a test to make sure I was actually getting data. My intention is
to return all rows in pager format. I haven't made it to that part yet.
Here is my template code:

<table width="100%" border="1">
<tr><th>Department</th><th>Account Code</th><th>Account
Name</th><th>Policy</th><th>Compliant</th><th>Servers</th><th>Subsystems</th><th>Complete</th><th>Status</th></tr>

[% # Display each account in a table row %]
[% FOREACH account IN accounts -%]
^^^^^^^
<tr>
<td>1[% accounts.department_id %]</td>
^^^^^^^^

You're simply referring to the list instead of the item here.
_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


ksmclane at us

Apr 27, 2012, 8:09 AM

Post #9 of 11 (265 views)
Permalink
Re: No data showing [In reply to]

Yes, William beat you to it.

Regards



Kenneth McLane
700 Locust St

Systems Compliance Services
Dubuque, 52001-6838
I1OB
USA
GTS Services Delivery


Phone:
+1-563-845-4674


Tie-Line:
946-4674


Mobile:
+1-563-940-7147


e-mail:
ksmclane [at] us


"Ideas come from everything" -- Alfred Hitchcock






From:
Stuart Watt <stuart [at] morungos>
To:
The elegant MVC web framework <catalyst [at] lists>
Date:
04/27/2012 10:03 AM
Subject:
Re: [Catalyst] No data showing



Surely that should be [% account.department_id %], etc.

All the best
Stuart

On 2012-04-27, at 10:50 AM, Kenneth S Mclane wrote:

[% accounts.department_id %]
_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


will.trillich at serensoft

Apr 27, 2012, 8:52 AM

Post #10 of 11 (254 views)
Permalink
Re: No data showing [In reply to]

$c->model('ORANGES::AccountView')->search({},{order_by=>'account_code'})->all()

I'd recommend that you look into iterating thru the recordset in the
template, instead of rendering all rows of data before it's rendered:

my $acct_rs = $c->model('ORANGE::AccountView')->*search_rs<http://search.cpan.org/~arodland/DBIx-Class-0.08196/lib/DBIx/Class/ResultSet.pm#search_rs>
*(
{},
{
order_by => 'account_code',
page => $page_no,
rows => $rows_per_page,
},
);
$c->stash( accounts => $acct_rs );

then in your template

[% WHILE ( acct = accounts.next ) %]

See
http://search.cpan.org/~danieltwc/DBIx-Class-0.07002/lib/DBIx/Class/Manual/Cookbook.pod#Searching



On Fri, Apr 27, 2012 at 10:09 AM, Kenneth S Mclane <ksmclane [at] us>wrote:

>
> I swear I tried that and it still didn't work. It does now, thank you. Can
> you tell me what I need to add to "$c->stash(accounts => [
> $c->model('ORANGES::AccountView')->all ]);" to sort by the account_code in
> ascending order? It's obviously "sort, but the actual syntax is what I'm
> looking for. Thanks again.
>
>
>
> From: Will Crawford <billcrawford1970 [at] gmail> To: The elegant MVC web
> framework <catalyst [at] lists> Date: 04/27/2012 09:55 AM Subject: Re:
> [Catalyst] No data showing
> ------------------------------
>
>
>
>
>
> On 27 April 2012 15:50, Kenneth S Mclane <*ksmclane [at] us*<ksmclane [at] us>>
> wrote:
> This was a test to make sure I was actually getting data. My intention is
> to return all rows in pager format. I haven't made it to that part yet.
> Here is my template code:
>
> <table width="100%" border="1">
> <tr><th>Department</th><th>Account Code</th><th>Account
> Name</th><th>Policy</th><th>Compliant</th><th>Servers</th><th>Subsystems</th><th>Complete</th><th>Status</th></tr>
> [% # Display each account in a table row %]
> [% FOREACH account IN accounts -%]
> ^^^^^^^
> <tr>
> <td>1[% accounts.department_id %]</td>
> ^^^^^^^^
>
> You're simply referring to the list instead of the item here.
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>
>


--
"We act as though comfort and luxury were the chief requirements of life,
when all that we need to make us happy is something to be enthusiastic
about." -- Albert Einstein


billcrawford1970 at gmail

Apr 27, 2012, 9:12 AM

Post #11 of 11 (254 views)
Permalink
Re: No data showing [In reply to]

On 27 April 2012 16:09, Kenneth S Mclane <ksmclane [at] us> wrote:

>
> I swear I tried that and it still didn't work. It does now, thank you. Can
> you tell me what I need to add to "$c->stash(accounts => [
> $c->model('ORANGES::AccountView')->all ]);" to sort by the account_code in
> ascending order? It's obviously "sort, but the actual syntax is what I'm
> looking for. Thanks again.
>

[ $c->model('ORANGES::AccountView')->search(undef, { order_by =>
'account_code' })->all ]

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.