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

Mailing List Archive: Catalyst: Users

attrs for DBIx::Class::Row

 

 

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


orasnita at gmail

Nov 15, 2009, 3:20 AM

Post #1 of 3 (658 views)
Permalink
attrs for DBIx::Class::Row

Hi,

After I constructed a resultset object, I can get the hash of attributes
used for generating it using:
my $attrs = $rs->{attrs}

But if I get a row object from that resultset, I can't get the attributes
anymore using:

my $row = $rs->first;
my $attrs = $row->{attrs};

Is there a way of getting the attributes used for searching, ordering,
paginating... from a row object?

I want to use those attributes for generating a digest key in order to store
the object in the cache, and I need to get those attributes after I created
the row object.

Thank you.

Octavian


_______________________________________________
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/


bobtfish at bobtfish

Nov 15, 2009, 8:04 AM

Post #2 of 3 (629 views)
Permalink
Re: attrs for DBIx::Class::Row [In reply to]

On 15 Nov 2009, at 11:20, Octavian Râşniţă wrote:
> After I constructed a resultset object, I can get the hash of
> attributes used for generating it using:
> my $attrs = $rs->{attrs}

Erm, this is a bad move, you're breaking abstraction here..

>
> But if I get a row object from that resultset, I can't get the
> attributes anymore using:
>
> my $row = $rs->first;
> my $attrs = $row->{attrs};
>
> Is there a way of getting the attributes used for searching,
> ordering, paginating... from a row object?

You're better asking the DBIC list about DBIC issues..

Cheers
t0m


_______________________________________________
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/


jshirley at gmail

Nov 15, 2009, 9:38 AM

Post #3 of 3 (624 views)
Permalink
Re: attrs for DBIx::Class::Row [In reply to]

2009/11/15 Octavian Râşniţă <orasnita [at] gmail>

> Hi,
>
> After I constructed a resultset object, I can get the hash of attributes
> used for generating it using:
> my $attrs = $rs->{attrs}
>
> But if I get a row object from that resultset, I can't get the attributes
> anymore using:
>
> my $row = $rs->first;
> my $attrs = $row->{attrs};
>
> Is there a way of getting the attributes used for searching, ordering,
> paginating... from a row object?
>
> I want to use those attributes for generating a digest key in order to
> store the object in the cache, and I need to get those attributes after I
> created the row object.
>
> Thank you.
>
> Octavian
>
>
>
>
You seem to have accidentally posted to the Catalyst mailing list, the
DBIx::Class mailing list is at
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class

-J

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.