Re: [Dbix-class] How do I make global attribute for schema?

2018-06-22 Thread Patrick Meidl
. for Log::Log4perl, it's get_logger()), so there is no need to pass the logger around. cheers patrick -- Patrick Meidl, Mag. Senior Expert Software Engineering IST - Institute of Science and Technology Austria Am Campus 1 A-3400 Klosterneuburg, Austria R I21.O3.201 (Building West, BT02) T

Re: [Dbix-class] VOTE: Relinquish firstcome rights to Peter Rabbitson

2018-01-18 Thread Patrick Meidl
+1 -- Patrick Meidl, Mag. Senior Expert Software Engineering IST - Institute of Science and Technology Austria Am Campus 1 A-3400 Klosterneuburg, Austria R I21.O3.201 (Building West, BT02) T +43 2243 9000 1313 E pme...@ist.ac.at W https://icp.ist.ac.at/search/users/pmeidl

Re: [Dbix-class] ★ VOTE NOW: DBIC Governance and Namespace Control ★

2016-12-05 Thread Patrick Meidl
Proposal A -- Patrick Meidl, Mag. Senior Expert Software Engineering IST - Institute of Science and Technology Austria Am Campus 1 A-3400 Klosterneuburg, Austria R I21.EG.115 (Building West, BT01) T +43 2243 9000 1313 E pme...@ist.ac.at W https://icp.ist.ac.at/search/users/pmeidl

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Patrick Meidl
> >> discussed, people would still be able to use DBIx::Class::* modules in > >> both namespaces. > >> > > > > -1 on this proposal from me. I favor getting on with the existing proposal. > > -1 from me too. I think forking will harm both sides,

Re: [Dbix-class] GOVERNANCE: An actually concrete proposal w/bootstrap governance system

2016-10-19 Thread Patrick Meidl
hat > can evolve to fit what is needed at the time. > > +1 > > Anything more is just detail which can be added as required by the > community or core updating the governance in accordance with these rules. +1 patrick -- Patrick Meidl, Mag. Senior Expert Software Engineering

Re: [Dbix-class] Unicode woes

2014-01-08 Thread Patrick Meidl
te to file), are you using an utf8 filehandle? e.g. use open ":encoding(utf8)"; or binmode(OUT, ":utf8"); other than that, I found this page quite informative: http://mysql.rjweb.org/doc.php/charcoll HTH patrick -- Patrick Meidl, Mag. Senior Expert Soft

Re: [Dbix-class] Features comparison among ORMS?

2013-11-14 Thread Patrick Meidl
amming language. so in that sense, a comparison of ORMs in different languages (as requested by the OP) would be interesting. my personal experience is that Java (with Hibernate as the ORM) performs better there, but this is just my feeling and not actual benchmark results. cheers patrick --

Re: [Dbix-class] Features comparison among ORMS?

2013-11-12 Thread Patrick Meidl
properly designed your tables, and in particular if you do proper normalization, the object instantiation is a major overhead, which we could only overcome by using HashrefInflator in some of our use cases. patrick -- Patrick Meidl, Mag. Senior Expert Software Engineering IST - Institute of Sc

[Dbix-class] missing "require DBI" in DBIx::Class::Storage::DBI::SQLite

2013-04-12 Thread Patrick Meidl
{ require DBI; DBI::SQL_INTEGER() } : undef ; } so the problem is that DBI is no longer required, so the sql type subroutines are not imported. die question is: which distro should at this require? (DBIx::Class or HTML::FormHandler::Model::DBIC) cheers patrick -- Patrick Meidl,

Re: [Dbix-class] Prefetch and join on different tables

2013-01-18 Thread Patrick Meidl
. this should do what you want: my $rs1 = $c->model('weight::Mdata')->search($where, { %$attr, prefetch => 'mc' }); or alternatively: push @{ $attr->{join} }, 'mt'; push @{ $attr->{join} }, 'mc'; $attr->{prefetch} = 'mc'; my $rs1 =

Re: [Dbix-class] Ideas for database versioning.

2012-11-06 Thread Patrick Meidl
expected schema_version in my application, but that actually sounds like a good idea (ticket created ;-) patrick -- Patrick Meidl, Mag. Senior Expert Software Engineering IST - Institute of Science and Technology Austria Am Campus 1 A-3400 Klosterneuburg, Austria R 03.EG.003 T +43 2243 9000 1

Re: [Dbix-class] DynamicColumns

2012-09-18 Thread Patrick Meidl
I suggested is much more powerful because you can use it in conditions and arguments as if it were a real column name. patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl

Re: [Dbix-class] DynamicColumns

2012-09-18 Thread Patrick Meidl
--------- not sure though about your other intentions with the dynamic columns class. patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl __

Re: [Dbix-class] DBIx schema loader (dump schema using make_schema_at) wierd behaviour

2012-08-08 Thread Patrick Meidl
d: http://stackoverflow.com/questions/338156/table-naming-dilemma-singular-vs-plural-names I always use singular, since this is easiest to handle for ORMs (as your question shows, plurals can cause confusion). HTH patrick -- Patrick Meidl pat

Re: [Dbix-class] Rows

2012-07-27 Thread Patrick Meidl
Row.pm#is_changed HTH patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbi

Re: [Dbix-class] Re: Result, ResultSet and load_namespaces

2012-07-26 Thread Patrick Meidl
gt; in the Result classes below the checksum created by Loader? exactly. patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl ___ List: http://lists.scsys.co.uk/cgi-bin/

Re: [Dbix-class] Result, ResultSet and load_namespaces

2012-07-26 Thread Patrick Meidl
o.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk HTH patrick -- Patrick Meidl patr...@panthe

Re: [Dbix-class] many_to_many data access

2012-07-13 Thread Patrick Meidl
On Fri, Jul 13 2012, Dave Howorth wrote: > Patrick Meidl wrote: > > > there are two reasons why you want to model the relationship city -> > > state -> country in such a rigid (and maybe simplified) way: > > > > first, it helps you maintain data integrity. a

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
>get_territory_from_code($code); $code = uc($code); $country_rs->create( { iso => $code, name_en => $name_en, } ); } --8<----------- anyway, all this is just my 2p, I'm no

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
On Thu, Jul 12 2012, fREW Schmidt wrote: > On Thu, Jul 12, 2012 at 2:48 AM, Patrick Meidl wrote: > > > first, to get the cities associated to the store, use the many_to_many > > relationship you defined; if you have such a relationship, you usually > > neve

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
and treat this as > free-form data. I agree, due to such maintenance nightmares I fell back to this approach myself before. Normalisation is great, as long as you have a reliable data source :) patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
On Thu, Jul 12 2012, Frank Schwach wrote: nice to see a "colleague" from one of my former employers on this thread ;-) > On 12/07/12 09:29, Patrick Meidl wrote: > >On Thu, Jul 12 2012, Robyn Jonahs wrote: > > > >>The cities, states and country relationships

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
uot; . $city->city . "\n"; print "State: " . $city->state->name . "\n"; print "Country: " . $city->state->country->name . "\n"; } you could also use the proxy attribute on your belongs_to relations to shortcut these calls to so

Re: [Dbix-class] many_to_many data access

2012-07-12 Thread Patrick Meidl
= $self->store; my @cities = $self->cities; foreach my $city (@cities) { $result .= sprintf(' | %s, %s %s', $city->city, $self->states->abb, $self->countries->abb); } return $result; } --8<

Re: [Dbix-class] The Definitive Guide to Catalyst ... p. 165 listing all users and their roles

2012-07-12 Thread Patrick Meidl
n: in your User Result class, you have a many_to_many called 'roles' which returns the Role's associated with the user (joining via the user_role table), then you can call the accessors on the Role object to display the data you need. HTH patrick -- Patrick Meidl ..

Re: [Dbix-class] Problem getting data from resultset

2012-07-09 Thread Patrick Meidl
data = $sr->next) { # call accessors on your Accountv object ... } HTH patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl ___ List: http://lists.scsys.co.u

Re: [Dbix-class] Problem getting data from resultset

2012-07-07 Thread Patrick Meidl
On Fri, Jul 06 2012, Patrick Meidl wrote: > On Fri, Jul 06 2012, Kenneth S Mclane wrote: > > > > Subject: > > > > > > Re: [Dbix-class] Problem getting data from resultset > > > > > > > > > foreach my $method (split(/\./, $f

Re: [Dbix-class] Problem getting data from resultset

2012-07-07 Thread Patrick Meidl
On Thu, Jul 05 2012, Patrick Meidl wrote: > On Thu, Jul 05 2012, Kenneth S Mclane wrote: > > > my $wb = > > Spreadsheet::WriteExcel->new('/opt/catalyst/dbms/lib/dbms/output/output.xls'); > > my $ws = $wb->add_worksheet('O

Re: [Dbix-class] Problem getting data from resultset

2012-07-06 Thread Patrick Meidl
t never ends. I comment it out and > it acts like it is hung, my browser just says "Waiting for local Host". if you posted your code it would be easier to help debug it... patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .

Re: [Dbix-class] Problem getting data from resultset

2012-07-06 Thread Patrick Meidl
;perldoc perlfunc'). as I mentioned before, you should use can() for this. so something like this should put you on the right track: foreach my $method (split(/\./, $field)) { if (defined($val) and ref($val) and $val->can($method)) { $val = $val->$method;

Re: [Dbix-class] Problem getting data from resultset

2012-07-06 Thread Patrick Meidl
;$method; > > } > > $ws->write($row, $col, $val); > > > > to make your code more robust, you should add some sanity checking, like > > > > if ($val->can($method)) { ... } > > > > HTH > > > > patrick > > > > -- >

Re: [Dbix-class] Problem getting data from resultset

2012-07-06 Thread Patrick Meidl
it to. you would have to do something like my $val = $data; foreach my $method (split(/\./, $field)) { $val = $val->$method; } $ws->write($row, $col, $val); to make your code more robust, you should add some sanity checking, like if ($val->can($method)) { ... } HTH patrick

Re: [Dbix-class] Problem getting data from resultset

2012-07-05 Thread Patrick Meidl
$col++; > } > $row++; > $col=0; > } your code will only work for fields in the main table of your resultset, but will break for relations. for example, $data->department.department_code is not a valid accessor. you will h

Re: [Dbix-class] columns and prefetch and columns => undef.

2012-06-19 Thread Patrick Meidl
uot;reset" the column selection but to all > columns. [...] > What is the correct behavior, and how can I achieve the the old behavior of > "columns => undef"? just a shot in the dark, but have you tried calling $rs->clear_cache before doing the second search? pat

Re: [Dbix-class] table-per-subclass - how it works?

2012-06-18 Thread Patrick Meidl
another framework does, even if you think the other design is nicer. HTH patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl ___ List: http://lists.scsys

Re: [Dbix-class] Is there a framework for translating raw database errors into human-readable errors

2012-05-30 Thread Patrick Meidl
framework or plain cgi, too) which does input validation with customisable error messages. HTH patrick -- Patrick Meidl patr...@pantheon.at Vienna, Austria .. http://gplus.to/pmeidl ___ List: http://li

Re: [Dbix-class] Query problem

2012-05-14 Thread Patrick Meidl
tps://metacpan.org/module/DBIx::Class::Relationship https://metacpan.org/module/DBIx::Class::ResultSet as somebody else already pointed out, it can be more difficult to get started with DBIc when you try to translate literal SQL queries into DBIx::Class queries, rather than thinki

Re: [Dbix-class] schema -> dsn?

2012-05-10 Thread Patrick Meidl
e->connect_info->{dsn}; HTH patrick -- Patrick Meidl +43 1 9688226 (home) Pazmanitengasse 4/10 . +43 680 2072780 (mobile) 1020 Wien patr...@pantheon.at Austria

Re: [Dbix-class] Throwing exceptions from exception_action

2012-04-23 Thread Patrick Meidl
sing Trycatch to handle them: https://metacpan.org/module/TryCatch this is a nice implementation of java-style exception semantics in perl. HTH patrick -- Patrick Meidl +43 1 9688226 (home) Pazmanitengasse 4/10 . +43 680 2072780 (m

[Dbix-class] relationship proxy not working for updates?

2012-03-23 Thread Patrick Meidl
'New title' }); I get an exception. the pod at https://metacpan.org/module/DBIx::Class::Relationship::Base#attributes suggests to me that this should work. so, is this expected behaviour, or a known limitation, or bug, or am I doing something wrong? cheers patrick -- Patrick M