[Catalyst-commits] r9384 - in trunk/Catalyst-Example-InstantCRUD:
lib/Catalyst/Helper lib/Catalyst/Helper/View script
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Mon Feb 23 16:57:15 GMT 2009
Author: zby
Date: 2009-02-23 16:57:15 +0000 (Mon, 23 Feb 2009)
New Revision: 9384
Modified:
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl
Log:
UTF-8
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm 2009-02-23 05:03:06 UTC (rev 9383)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm 2009-02-23 16:57:15 UTC (rev 9384)
@@ -47,6 +47,7 @@
-Debug
ConfigLoader
Static::Simple
+ Unicode
[% IF auth -%]
[% END -%]
/;
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm 2009-02-23 05:03:06 UTC (rev 9383)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm 2009-02-23 16:57:15 UTC (rev 9384)
@@ -10,6 +10,10 @@
sub mk_compclass {
my ( $self, $helper, $schema, $m2m, $bridges ) = @_;
+
+ my $file = $helper->{file};
+ $helper->render_file( 'compclass', $file );
+
my @classes = map {
$bridges->{ $_ } ? () : $_
} $schema->sources;
@@ -121,6 +125,42 @@
=begin pod_to_ignore
+__compclass__
+package [% class %];
+
+use strict;
+use base 'Catalyst::View::TT';
+
+__PACKAGE__->config(
+ TEMPLATE_EXTENSION => '.tt',
+ ENCODING => 'UTF-8',
+);
+
+=head1 NAME
+
+[% class %] - TT View for [% app %]
+
+=head1 DESCRIPTION
+
+TT View for [% app %].
+
+=head1 AUTHOR
+
+=head1 SEE ALSO
+
+L<[% app %]>
+
+[% author %]
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
+
__list__
[% TAGS <+ +> %]
<table>
@@ -172,12 +212,6 @@
<a href="[% c.uri_for( 'list' ) %]">List</a>
-__compclass__
-package [% class %];
-use base Catalyst::Example::Controller::InstantCRUD;
-use strict;
-
-1;
__wrapper__
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
Modified: trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl 2009-02-23 05:03:06 UTC (rev 9383)
+++ trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl 2009-02-23 16:57:15 UTC (rev 9384)
@@ -15,8 +15,8 @@
use DBIx::Class::Schema::Loader::RelBuilder;
use List::Util qw(first);
use DBI;
+use utf8;
-
my $appname = $ARGV[0];
my $help = 0;
@@ -97,6 +97,7 @@
dump_directory => dir( $appdir , 'lib')->absolute->stringify,
use_namespaces => 1,
default_resultset_class => '+DBIx::Class::ResultSet::RecursiveUpdate',
+ components => 'UTF8Columns',
},
[ $dsn, $duser, $dpassword ],
);
@@ -124,6 +125,8 @@
my $a2 = $m->[2];
$addition .= "__PACKAGE__->many_to_many('$a0', '$a1' => '$a2');\n";
}
+ my @columns = $result_source->columns;
+ $addition .= "__PACKAGE__->utf8_columns(qw/@columns/);\n";
$content =~ s/1;\s*/$addition\n1;/;
File::Slurp::write_file( $file, $content );
}
@@ -195,6 +198,7 @@
my $filename = shift;
my $dsn ||= 'dbi:SQLite:dbname=' . $filename;
my $dbh = DBI->connect( $dsn ) or die "Cannot connect to $dsn\n";
+ $dbh->{unicode} = 1;
my $sql;
{
@@ -463,4 +467,13 @@
INSERT INTO "user_role" VALUES(1,1);
INSERT INTO "user_role" VALUES(1,2);
INSERT INTO "user_role" VALUES(3,0);
+CREATE TABLE unicode_examples (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ iso_country_code CHAR(2),
+ language_name varchar(255),
+ main_unicode_set varchar(255),
+ example_text text
+);
+
+INSERT INTO "unicode_examples" VALUES(1,'PL','Polish','Latin Extended A','Literki z ogonkami alfabetycznie: ąćęłńóśżźĄĆĘŁŃÓŚŹŻ (acelnoszzACELNOSZZ)');
COMMIT;
More information about the Catalyst-commits
mailing list