New upstream version 2.03
Florian Schlichting
6 years ago
0 | 2.03 2018-04-09 21:56:26+00:00 UTC | |
1 | ||
2 | - New 'expand_stash_dots' config option | |
3 | ||
4 | - remove bundled/renamed MooseX::Attribute::Chained and depend on the | |
5 | fixed version | |
6 | ||
0 | 7 | 2.02 2016-06-24 |
1 | 8 | |
2 | 9 | - documentation fixes |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.047. | |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.011. | |
1 | 1 | Changes |
2 | 2 | LICENSE |
3 | 3 | MANIFEST |
8 | 8 | dist.ini |
9 | 9 | lib/HTML/FormFu/Constraint/DBIC/Unique.pm |
10 | 10 | lib/HTML/FormFu/Model/DBIC.pm |
11 | t/author-critic.t | |
12 | t/author-eol.t | |
13 | t/author-pod-syntax.t | |
11 | t/00-report-prereqs.dd | |
12 | t/00-report-prereqs.t | |
14 | 13 | t/constraints/dbic_unique.t |
15 | 14 | t/constraints/dbic_unique.yml |
16 | 15 | t/constraints/dbic_unique_column.yml |
114 | 113 | t/options_from_model/condition_from_stash_combobox.yml |
115 | 114 | t/options_from_model/condition_from_stash_combobox_complex.t |
116 | 115 | t/options_from_model/condition_from_stash_complex.t |
116 | t/options_from_model/condition_from_stash_expand.t | |
117 | t/options_from_model/condition_from_stash_expand.yml | |
117 | 118 | t/options_from_model/constraint_autoset.t |
118 | 119 | t/options_from_model/constraint_autoset.yml |
119 | 120 | t/options_from_model/enum_select.t |
124 | 125 | t/options_from_model/many_to_many_select.yml |
125 | 126 | t/options_from_model/many_to_many_select_restricted.t |
126 | 127 | t/options_from_model/many_to_many_select_restricted.yml |
127 | t/release-distmeta.t | |
128 | t/release-kwalitee.t | |
129 | t/release-pause-permissions.t | |
130 | 128 | t/update/add_valid.t |
131 | 129 | t/update/basic.yml |
132 | 130 | t/update/basic_create.t |
208 | 206 | t/x_roundtrip/checkbox.yml |
209 | 207 | t/x_roundtrip/checkbox_false2true.t |
210 | 208 | t/x_roundtrip/checkbox_true2false.t |
209 | xt/author/00-compile.t | |
210 | xt/author/critic.t | |
211 | xt/author/eol.t | |
212 | xt/author/pod-syntax.t | |
213 | xt/release/distmeta.t | |
214 | xt/release/kwalitee.t | |
215 | xt/release/pause-permissions.t |
3 | 3 | "Carl Franks <cpan@fireartist.com>" |
4 | 4 | ], |
5 | 5 | "dynamic_config" : 0, |
6 | "generated_by" : "Dist::Zilla version 5.047, CPAN::Meta::Converter version 2.150005", | |
6 | "generated_by" : "Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010", | |
7 | 7 | "license" : [ |
8 | 8 | "perl_5" |
9 | 9 | ], |
14 | 14 | "name" : "HTML-FormFu-Model-DBIC", |
15 | 15 | "no_index" : { |
16 | 16 | "directory" : [ |
17 | "eg", | |
17 | 18 | "examples", |
19 | "inc", | |
20 | "share", | |
18 | 21 | "t", |
19 | "t-aggregate", | |
20 | 22 | "xt" |
21 | 23 | ] |
22 | 24 | }, |
28 | 30 | }, |
29 | 31 | "develop" : { |
30 | 32 | "requires" : { |
33 | "File::Spec" : "0", | |
34 | "IO::Handle" : "0", | |
35 | "IPC::Open3" : "0", | |
31 | 36 | "Test::CPAN::Meta" : "0", |
32 | 37 | "Test::EOL" : "0", |
33 | 38 | "Test::Kwalitee" : "1.21", |
34 | 39 | "Test::More" : "0.88", |
35 | 40 | "Test::PAUSE::Permissions" : "0", |
41 | "Test::Perl::Critic" : "0", | |
36 | 42 | "Test::Pod" : "1.41" |
37 | 43 | } |
38 | 44 | }, |
42 | 48 | "DBIx::Class" : "0.08108", |
43 | 49 | "HTML::FormFu" : "2.00", |
44 | 50 | "List::MoreUtils" : "0", |
51 | "MooseX::Attribute::Chained" : "v1.0.2", | |
45 | 52 | "Storable" : "0", |
46 | 53 | "Task::Weaken" : "0", |
47 | 54 | "perl" : "5.008001" |
48 | 55 | } |
49 | 56 | }, |
50 | 57 | "test" : { |
58 | "recommends" : { | |
59 | "CPAN::Meta" : "2.120900" | |
60 | }, | |
51 | 61 | "requires" : { |
52 | 62 | "DateTime::Format::SQLite" : "0", |
63 | "ExtUtils::MakeMaker" : "0", | |
64 | "File::Spec" : "0", | |
53 | 65 | "Locale::Maketext" : "0", |
54 | 66 | "SQL::Translator" : "0.11016", |
55 | 67 | "Test::More" : "0.99" |
56 | 68 | } |
57 | 69 | } |
58 | 70 | }, |
71 | "provides" : { | |
72 | "HTML::FormFu::Constraint::DBIC::Unique" : { | |
73 | "file" : "lib/HTML/FormFu/Constraint/DBIC/Unique.pm", | |
74 | "version" : "2.03" | |
75 | }, | |
76 | "HTML::FormFu::Model::DBIC" : { | |
77 | "file" : "lib/HTML/FormFu/Model/DBIC.pm", | |
78 | "version" : "2.03" | |
79 | } | |
80 | }, | |
59 | 81 | "release_status" : "stable", |
60 | 82 | "resources" : { |
83 | "homepage" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC", | |
61 | 84 | "repository" : { |
62 | 85 | "type" : "git", |
63 | "url" : "git://github.com/fireartist/HTML-FormFu-Model-DBIC.git", | |
64 | "web" : "https://github.com/fireartist/HTML-FormFu-Model-DBIC" | |
86 | "url" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC.git", | |
87 | "web" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC" | |
65 | 88 | } |
66 | 89 | }, |
67 | "version" : "2.02" | |
90 | "version" : "2.03", | |
91 | "x_Dist_Zilla" : { | |
92 | "perl" : { | |
93 | "version" : "5.014004" | |
94 | }, | |
95 | "plugins" : [ | |
96 | { | |
97 | "class" : "Dist::Zilla::Plugin::Prereqs", | |
98 | "config" : { | |
99 | "Dist::Zilla::Plugin::Prereqs" : { | |
100 | "phase" : "runtime", | |
101 | "type" : "requires" | |
102 | } | |
103 | }, | |
104 | "name" : "Prereqs", | |
105 | "version" : "6.011" | |
106 | }, | |
107 | { | |
108 | "class" : "Dist::Zilla::Plugin::Prereqs", | |
109 | "config" : { | |
110 | "Dist::Zilla::Plugin::Prereqs" : { | |
111 | "phase" : "test", | |
112 | "type" : "requires" | |
113 | } | |
114 | }, | |
115 | "name" : "TestRequires", | |
116 | "version" : "6.011" | |
117 | }, | |
118 | { | |
119 | "class" : "Dist::Zilla::Plugin::Prereqs", | |
120 | "config" : { | |
121 | "Dist::Zilla::Plugin::Prereqs" : { | |
122 | "phase" : "develop", | |
123 | "type" : "requires" | |
124 | } | |
125 | }, | |
126 | "name" : "DevelopRequires", | |
127 | "version" : "6.011" | |
128 | }, | |
129 | { | |
130 | "class" : "Dist::Zilla::Plugin::Test::Perl::Critic", | |
131 | "name" : "Test::Perl::Critic", | |
132 | "version" : "3.001" | |
133 | }, | |
134 | { | |
135 | "class" : "Dist::Zilla::Plugin::MetaTests", | |
136 | "name" : "MetaTests", | |
137 | "version" : "6.011" | |
138 | }, | |
139 | { | |
140 | "class" : "Dist::Zilla::Plugin::OurPkgVersion", | |
141 | "name" : "OurPkgVersion", | |
142 | "version" : "0.12" | |
143 | }, | |
144 | { | |
145 | "class" : "Dist::Zilla::Plugin::PodVersion", | |
146 | "name" : "PodVersion", | |
147 | "version" : "6.011" | |
148 | }, | |
149 | { | |
150 | "class" : "Dist::Zilla::Plugin::Test::Kwalitee", | |
151 | "config" : { | |
152 | "Dist::Zilla::Plugin::Test::Kwalitee" : { | |
153 | "filename" : "xt/release/kwalitee.t", | |
154 | "skiptest" : [] | |
155 | } | |
156 | }, | |
157 | "name" : "Test::Kwalitee", | |
158 | "version" : "2.12" | |
159 | }, | |
160 | { | |
161 | "class" : "Dist::Zilla::Plugin::Test::EOL", | |
162 | "config" : { | |
163 | "Dist::Zilla::Plugin::Test::EOL" : { | |
164 | "filename" : "xt/author/eol.t", | |
165 | "finder" : [ | |
166 | ":InstallModules" | |
167 | ], | |
168 | "trailing_whitespace" : 1 | |
169 | } | |
170 | }, | |
171 | "name" : "Test::EOL", | |
172 | "version" : "0.19" | |
173 | }, | |
174 | { | |
175 | "class" : "Dist::Zilla::Plugin::Test::PAUSE::Permissions", | |
176 | "name" : "Test::PAUSE::Permissions", | |
177 | "version" : "0.003" | |
178 | }, | |
179 | { | |
180 | "class" : "Dist::Zilla::Plugin::GithubMeta", | |
181 | "name" : "GithubMeta", | |
182 | "version" : "0.54" | |
183 | }, | |
184 | { | |
185 | "class" : "Dist::Zilla::Plugin::NextRelease", | |
186 | "name" : "NextRelease", | |
187 | "version" : "6.011" | |
188 | }, | |
189 | { | |
190 | "class" : "Dist::Zilla::Plugin::Git::GatherDir", | |
191 | "config" : { | |
192 | "Dist::Zilla::Plugin::GatherDir" : { | |
193 | "exclude_filename" : [], | |
194 | "exclude_match" : [], | |
195 | "follow_symlinks" : 0, | |
196 | "include_dotfiles" : 0, | |
197 | "prefix" : "", | |
198 | "prune_directory" : [], | |
199 | "root" : "." | |
200 | }, | |
201 | "Dist::Zilla::Plugin::Git::GatherDir" : { | |
202 | "include_untracked" : 0 | |
203 | } | |
204 | }, | |
205 | "name" : "Git::GatherDir", | |
206 | "version" : "2.043" | |
207 | }, | |
208 | { | |
209 | "class" : "Dist::Zilla::Plugin::Git::NextVersion", | |
210 | "config" : { | |
211 | "Dist::Zilla::Plugin::Git::NextVersion" : { | |
212 | "first_version" : "0.001", | |
213 | "version_by_branch" : 0, | |
214 | "version_regexp" : "(?^:^v(.+)$)" | |
215 | }, | |
216 | "Dist::Zilla::Role::Git::Repo" : { | |
217 | "git_version" : "1.9.1", | |
218 | "repo_root" : "." | |
219 | } | |
220 | }, | |
221 | "name" : "Git::NextVersion", | |
222 | "version" : "2.043" | |
223 | }, | |
224 | { | |
225 | "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", | |
226 | "config" : { | |
227 | "Dist::Zilla::Role::Git::Repo" : { | |
228 | "git_version" : "1.9.1", | |
229 | "repo_root" : "." | |
230 | } | |
231 | }, | |
232 | "name" : "Git::CheckFor::CorrectBranch", | |
233 | "version" : "0.014" | |
234 | }, | |
235 | { | |
236 | "class" : "Dist::Zilla::Plugin::Git::Remote::Check", | |
237 | "name" : "Git::Remote::Check", | |
238 | "version" : "0.1.2" | |
239 | }, | |
240 | { | |
241 | "class" : "Dist::Zilla::Plugin::PruneCruft", | |
242 | "name" : "@Starter/PruneCruft", | |
243 | "version" : "6.011" | |
244 | }, | |
245 | { | |
246 | "class" : "Dist::Zilla::Plugin::ManifestSkip", | |
247 | "name" : "@Starter/ManifestSkip", | |
248 | "version" : "6.011" | |
249 | }, | |
250 | { | |
251 | "class" : "Dist::Zilla::Plugin::MetaConfig", | |
252 | "name" : "@Starter/MetaConfig", | |
253 | "version" : "6.011" | |
254 | }, | |
255 | { | |
256 | "class" : "Dist::Zilla::Plugin::MetaProvides::Package", | |
257 | "config" : { | |
258 | "Dist::Zilla::Plugin::MetaProvides::Package" : { | |
259 | "finder_objects" : [ | |
260 | { | |
261 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
262 | "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", | |
263 | "version" : "6.011" | |
264 | } | |
265 | ], | |
266 | "include_underscores" : 0 | |
267 | }, | |
268 | "Dist::Zilla::Role::MetaProvider::Provider" : { | |
269 | "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", | |
270 | "inherit_missing" : 1, | |
271 | "inherit_version" : 1, | |
272 | "meta_noindex" : 1 | |
273 | }, | |
274 | "Dist::Zilla::Role::ModuleMetadata" : { | |
275 | "Module::Metadata" : "1.000033", | |
276 | "version" : "0.005" | |
277 | } | |
278 | }, | |
279 | "name" : "@Starter/MetaProvides::Package", | |
280 | "version" : "2.004003" | |
281 | }, | |
282 | { | |
283 | "class" : "Dist::Zilla::Plugin::MetaNoIndex", | |
284 | "name" : "@Starter/MetaNoIndex", | |
285 | "version" : "6.011" | |
286 | }, | |
287 | { | |
288 | "class" : "Dist::Zilla::Plugin::MetaYAML", | |
289 | "name" : "@Starter/MetaYAML", | |
290 | "version" : "6.011" | |
291 | }, | |
292 | { | |
293 | "class" : "Dist::Zilla::Plugin::MetaJSON", | |
294 | "name" : "@Starter/MetaJSON", | |
295 | "version" : "6.011" | |
296 | }, | |
297 | { | |
298 | "class" : "Dist::Zilla::Plugin::License", | |
299 | "name" : "@Starter/License", | |
300 | "version" : "6.011" | |
301 | }, | |
302 | { | |
303 | "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", | |
304 | "config" : { | |
305 | "Dist::Zilla::Role::FileWatcher" : { | |
306 | "version" : "0.006" | |
307 | } | |
308 | }, | |
309 | "name" : "@Starter/ReadmeAnyFromPod", | |
310 | "version" : "0.163250" | |
311 | }, | |
312 | { | |
313 | "class" : "Dist::Zilla::Plugin::ExecDir", | |
314 | "name" : "@Starter/ExecDir", | |
315 | "version" : "6.011" | |
316 | }, | |
317 | { | |
318 | "class" : "Dist::Zilla::Plugin::ShareDir", | |
319 | "name" : "@Starter/ShareDir", | |
320 | "version" : "6.011" | |
321 | }, | |
322 | { | |
323 | "class" : "Dist::Zilla::Plugin::PodSyntaxTests", | |
324 | "name" : "@Starter/PodSyntaxTests", | |
325 | "version" : "6.011" | |
326 | }, | |
327 | { | |
328 | "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", | |
329 | "name" : "@Starter/Test::ReportPrereqs", | |
330 | "version" : "0.027" | |
331 | }, | |
332 | { | |
333 | "class" : "Dist::Zilla::Plugin::Test::Compile", | |
334 | "config" : { | |
335 | "Dist::Zilla::Plugin::Test::Compile" : { | |
336 | "bail_out_on_fail" : 0, | |
337 | "fail_on_warning" : "author", | |
338 | "fake_home" : 0, | |
339 | "filename" : "xt/author/00-compile.t", | |
340 | "module_finder" : [ | |
341 | ":InstallModules" | |
342 | ], | |
343 | "needs_display" : 0, | |
344 | "phase" : "develop", | |
345 | "script_finder" : [ | |
346 | ":PerlExecFiles" | |
347 | ], | |
348 | "skips" : [], | |
349 | "switch" : [] | |
350 | } | |
351 | }, | |
352 | "name" : "@Starter/Test::Compile", | |
353 | "version" : "2.058" | |
354 | }, | |
355 | { | |
356 | "class" : "Dist::Zilla::Plugin::MakeMaker", | |
357 | "config" : { | |
358 | "Dist::Zilla::Role::TestRunner" : { | |
359 | "default_jobs" : 1 | |
360 | } | |
361 | }, | |
362 | "name" : "@Starter/MakeMaker", | |
363 | "version" : "6.011" | |
364 | }, | |
365 | { | |
366 | "class" : "Dist::Zilla::Plugin::Manifest", | |
367 | "name" : "@Starter/Manifest", | |
368 | "version" : "6.011" | |
369 | }, | |
370 | { | |
371 | "class" : "Dist::Zilla::Plugin::TestRelease", | |
372 | "name" : "@Starter/TestRelease", | |
373 | "version" : "6.011" | |
374 | }, | |
375 | { | |
376 | "class" : "Dist::Zilla::Plugin::RunExtraTests", | |
377 | "config" : { | |
378 | "Dist::Zilla::Role::TestRunner" : { | |
379 | "default_jobs" : 1 | |
380 | } | |
381 | }, | |
382 | "name" : "@Starter/RunExtraTests", | |
383 | "version" : "0.029" | |
384 | }, | |
385 | { | |
386 | "class" : "Dist::Zilla::Plugin::ConfirmRelease", | |
387 | "name" : "@Starter/ConfirmRelease", | |
388 | "version" : "6.011" | |
389 | }, | |
390 | { | |
391 | "class" : "Dist::Zilla::Plugin::UploadToCPAN", | |
392 | "name" : "@Starter/UploadToCPAN", | |
393 | "version" : "6.011" | |
394 | }, | |
395 | { | |
396 | "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", | |
397 | "config" : { | |
398 | "Dist::Zilla::Role::FileWatcher" : { | |
399 | "version" : "0.006" | |
400 | } | |
401 | }, | |
402 | "name" : "Pod_Readme", | |
403 | "version" : "0.163250" | |
404 | }, | |
405 | { | |
406 | "class" : "Dist::Zilla::Plugin::Git::Check", | |
407 | "config" : { | |
408 | "Dist::Zilla::Plugin::Git::Check" : { | |
409 | "untracked_files" : "die" | |
410 | }, | |
411 | "Dist::Zilla::Role::Git::DirtyFiles" : { | |
412 | "allow_dirty" : [ | |
413 | "Changes", | |
414 | "README.pod", | |
415 | "dist.ini" | |
416 | ], | |
417 | "allow_dirty_match" : [], | |
418 | "changelog" : "Changes" | |
419 | }, | |
420 | "Dist::Zilla::Role::Git::Repo" : { | |
421 | "git_version" : "1.9.1", | |
422 | "repo_root" : "." | |
423 | } | |
424 | }, | |
425 | "name" : "@Git/Check", | |
426 | "version" : "2.043" | |
427 | }, | |
428 | { | |
429 | "class" : "Dist::Zilla::Plugin::Git::Commit", | |
430 | "config" : { | |
431 | "Dist::Zilla::Plugin::Git::Commit" : { | |
432 | "add_files_in" : [], | |
433 | "commit_msg" : "v%v%t - %d%n%n%c" | |
434 | }, | |
435 | "Dist::Zilla::Role::Git::DirtyFiles" : { | |
436 | "allow_dirty" : [ | |
437 | "Changes", | |
438 | "README.pod", | |
439 | "dist.ini" | |
440 | ], | |
441 | "allow_dirty_match" : [], | |
442 | "changelog" : "Changes" | |
443 | }, | |
444 | "Dist::Zilla::Role::Git::Repo" : { | |
445 | "git_version" : "1.9.1", | |
446 | "repo_root" : "." | |
447 | }, | |
448 | "Dist::Zilla::Role::Git::StringFormatter" : { | |
449 | "time_zone" : "local" | |
450 | } | |
451 | }, | |
452 | "name" : "@Git/Commit", | |
453 | "version" : "2.043" | |
454 | }, | |
455 | { | |
456 | "class" : "Dist::Zilla::Plugin::Git::Tag", | |
457 | "config" : { | |
458 | "Dist::Zilla::Plugin::Git::Tag" : { | |
459 | "branch" : null, | |
460 | "changelog" : "Changes", | |
461 | "signed" : 0, | |
462 | "tag" : "v2.03", | |
463 | "tag_format" : "v%v%t", | |
464 | "tag_message" : "v%v%t - %d" | |
465 | }, | |
466 | "Dist::Zilla::Role::Git::Repo" : { | |
467 | "git_version" : "1.9.1", | |
468 | "repo_root" : "." | |
469 | }, | |
470 | "Dist::Zilla::Role::Git::StringFormatter" : { | |
471 | "time_zone" : "local" | |
472 | } | |
473 | }, | |
474 | "name" : "@Git/Tag", | |
475 | "version" : "2.043" | |
476 | }, | |
477 | { | |
478 | "class" : "Dist::Zilla::Plugin::Git::Push", | |
479 | "config" : { | |
480 | "Dist::Zilla::Plugin::Git::Push" : { | |
481 | "push_to" : [ | |
482 | "origin" | |
483 | ], | |
484 | "remotes_must_exist" : 1 | |
485 | }, | |
486 | "Dist::Zilla::Role::Git::Repo" : { | |
487 | "git_version" : "1.9.1", | |
488 | "repo_root" : "." | |
489 | } | |
490 | }, | |
491 | "name" : "@Git/Push", | |
492 | "version" : "2.043" | |
493 | }, | |
494 | { | |
495 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
496 | "name" : ":InstallModules", | |
497 | "version" : "6.011" | |
498 | }, | |
499 | { | |
500 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
501 | "name" : ":IncModules", | |
502 | "version" : "6.011" | |
503 | }, | |
504 | { | |
505 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
506 | "name" : ":TestFiles", | |
507 | "version" : "6.011" | |
508 | }, | |
509 | { | |
510 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
511 | "name" : ":ExtraTestFiles", | |
512 | "version" : "6.011" | |
513 | }, | |
514 | { | |
515 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
516 | "name" : ":ExecFiles", | |
517 | "version" : "6.011" | |
518 | }, | |
519 | { | |
520 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
521 | "name" : ":PerlExecFiles", | |
522 | "version" : "6.011" | |
523 | }, | |
524 | { | |
525 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
526 | "name" : ":ShareFiles", | |
527 | "version" : "6.011" | |
528 | }, | |
529 | { | |
530 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
531 | "name" : ":MainModule", | |
532 | "version" : "6.011" | |
533 | }, | |
534 | { | |
535 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
536 | "name" : ":AllFiles", | |
537 | "version" : "6.011" | |
538 | }, | |
539 | { | |
540 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
541 | "name" : ":NoFiles", | |
542 | "version" : "6.011" | |
543 | }, | |
544 | { | |
545 | "class" : "Dist::Zilla::Plugin::FinderCode", | |
546 | "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", | |
547 | "version" : "6.011" | |
548 | } | |
549 | ], | |
550 | "zilla" : { | |
551 | "class" : "Dist::Zilla::Dist::Builder", | |
552 | "config" : { | |
553 | "is_trial" : 0 | |
554 | }, | |
555 | "version" : "6.011" | |
556 | } | |
557 | }, | |
558 | "x_serialization_backend" : "Cpanel::JSON::XS version 4.02" | |
68 | 559 | } |
69 | 560 |
3 | 3 | - 'Carl Franks <cpan@fireartist.com>' |
4 | 4 | build_requires: |
5 | 5 | DateTime::Format::SQLite: '0' |
6 | ExtUtils::MakeMaker: '0' | |
7 | File::Spec: '0' | |
6 | 8 | Locale::Maketext: '0' |
7 | 9 | SQL::Translator: '0.11016' |
8 | 10 | Test::More: '0.99' |
9 | 11 | configure_requires: |
10 | 12 | ExtUtils::MakeMaker: '0' |
11 | 13 | dynamic_config: 0 |
12 | generated_by: 'Dist::Zilla version 5.047, CPAN::Meta::Converter version 2.150005' | |
14 | generated_by: 'Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010' | |
13 | 15 | license: perl |
14 | 16 | meta-spec: |
15 | 17 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
17 | 19 | name: HTML-FormFu-Model-DBIC |
18 | 20 | no_index: |
19 | 21 | directory: |
22 | - eg | |
20 | 23 | - examples |
24 | - inc | |
25 | - share | |
21 | 26 | - t |
22 | - t-aggregate | |
23 | 27 | - xt |
28 | provides: | |
29 | HTML::FormFu::Constraint::DBIC::Unique: | |
30 | file: lib/HTML/FormFu/Constraint/DBIC/Unique.pm | |
31 | version: '2.03' | |
32 | HTML::FormFu::Model::DBIC: | |
33 | file: lib/HTML/FormFu/Model/DBIC.pm | |
34 | version: '2.03' | |
24 | 35 | requires: |
25 | 36 | DBD::SQLite: '0' |
26 | 37 | DBIx::Class: '0.08108' |
27 | 38 | HTML::FormFu: '2.00' |
28 | 39 | List::MoreUtils: '0' |
40 | MooseX::Attribute::Chained: v1.0.2 | |
29 | 41 | Storable: '0' |
30 | 42 | Task::Weaken: '0' |
31 | 43 | perl: '5.008001' |
32 | 44 | resources: |
33 | repository: git://github.com/fireartist/HTML-FormFu-Model-DBIC.git | |
34 | version: '2.02' | |
45 | homepage: https://github.com/FormFu/HTML-FormFu-Model-DBIC | |
46 | repository: https://github.com/FormFu/HTML-FormFu-Model-DBIC.git | |
47 | version: '2.03' | |
48 | x_Dist_Zilla: | |
49 | perl: | |
50 | version: '5.014004' | |
51 | plugins: | |
52 | - | |
53 | class: Dist::Zilla::Plugin::Prereqs | |
54 | config: | |
55 | Dist::Zilla::Plugin::Prereqs: | |
56 | phase: runtime | |
57 | type: requires | |
58 | name: Prereqs | |
59 | version: '6.011' | |
60 | - | |
61 | class: Dist::Zilla::Plugin::Prereqs | |
62 | config: | |
63 | Dist::Zilla::Plugin::Prereqs: | |
64 | phase: test | |
65 | type: requires | |
66 | name: TestRequires | |
67 | version: '6.011' | |
68 | - | |
69 | class: Dist::Zilla::Plugin::Prereqs | |
70 | config: | |
71 | Dist::Zilla::Plugin::Prereqs: | |
72 | phase: develop | |
73 | type: requires | |
74 | name: DevelopRequires | |
75 | version: '6.011' | |
76 | - | |
77 | class: Dist::Zilla::Plugin::Test::Perl::Critic | |
78 | name: Test::Perl::Critic | |
79 | version: '3.001' | |
80 | - | |
81 | class: Dist::Zilla::Plugin::MetaTests | |
82 | name: MetaTests | |
83 | version: '6.011' | |
84 | - | |
85 | class: Dist::Zilla::Plugin::OurPkgVersion | |
86 | name: OurPkgVersion | |
87 | version: '0.12' | |
88 | - | |
89 | class: Dist::Zilla::Plugin::PodVersion | |
90 | name: PodVersion | |
91 | version: '6.011' | |
92 | - | |
93 | class: Dist::Zilla::Plugin::Test::Kwalitee | |
94 | config: | |
95 | Dist::Zilla::Plugin::Test::Kwalitee: | |
96 | filename: xt/release/kwalitee.t | |
97 | skiptest: [] | |
98 | name: Test::Kwalitee | |
99 | version: '2.12' | |
100 | - | |
101 | class: Dist::Zilla::Plugin::Test::EOL | |
102 | config: | |
103 | Dist::Zilla::Plugin::Test::EOL: | |
104 | filename: xt/author/eol.t | |
105 | finder: | |
106 | - ':InstallModules' | |
107 | trailing_whitespace: 1 | |
108 | name: Test::EOL | |
109 | version: '0.19' | |
110 | - | |
111 | class: Dist::Zilla::Plugin::Test::PAUSE::Permissions | |
112 | name: Test::PAUSE::Permissions | |
113 | version: '0.003' | |
114 | - | |
115 | class: Dist::Zilla::Plugin::GithubMeta | |
116 | name: GithubMeta | |
117 | version: '0.54' | |
118 | - | |
119 | class: Dist::Zilla::Plugin::NextRelease | |
120 | name: NextRelease | |
121 | version: '6.011' | |
122 | - | |
123 | class: Dist::Zilla::Plugin::Git::GatherDir | |
124 | config: | |
125 | Dist::Zilla::Plugin::GatherDir: | |
126 | exclude_filename: [] | |
127 | exclude_match: [] | |
128 | follow_symlinks: 0 | |
129 | include_dotfiles: 0 | |
130 | prefix: '' | |
131 | prune_directory: [] | |
132 | root: . | |
133 | Dist::Zilla::Plugin::Git::GatherDir: | |
134 | include_untracked: 0 | |
135 | name: Git::GatherDir | |
136 | version: '2.043' | |
137 | - | |
138 | class: Dist::Zilla::Plugin::Git::NextVersion | |
139 | config: | |
140 | Dist::Zilla::Plugin::Git::NextVersion: | |
141 | first_version: '0.001' | |
142 | version_by_branch: 0 | |
143 | version_regexp: (?^:^v(.+)$) | |
144 | Dist::Zilla::Role::Git::Repo: | |
145 | git_version: 1.9.1 | |
146 | repo_root: . | |
147 | name: Git::NextVersion | |
148 | version: '2.043' | |
149 | - | |
150 | class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch | |
151 | config: | |
152 | Dist::Zilla::Role::Git::Repo: | |
153 | git_version: 1.9.1 | |
154 | repo_root: . | |
155 | name: Git::CheckFor::CorrectBranch | |
156 | version: '0.014' | |
157 | - | |
158 | class: Dist::Zilla::Plugin::Git::Remote::Check | |
159 | name: Git::Remote::Check | |
160 | version: 0.1.2 | |
161 | - | |
162 | class: Dist::Zilla::Plugin::PruneCruft | |
163 | name: '@Starter/PruneCruft' | |
164 | version: '6.011' | |
165 | - | |
166 | class: Dist::Zilla::Plugin::ManifestSkip | |
167 | name: '@Starter/ManifestSkip' | |
168 | version: '6.011' | |
169 | - | |
170 | class: Dist::Zilla::Plugin::MetaConfig | |
171 | name: '@Starter/MetaConfig' | |
172 | version: '6.011' | |
173 | - | |
174 | class: Dist::Zilla::Plugin::MetaProvides::Package | |
175 | config: | |
176 | Dist::Zilla::Plugin::MetaProvides::Package: | |
177 | finder_objects: | |
178 | - | |
179 | class: Dist::Zilla::Plugin::FinderCode | |
180 | name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' | |
181 | version: '6.011' | |
182 | include_underscores: 0 | |
183 | Dist::Zilla::Role::MetaProvider::Provider: | |
184 | $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' | |
185 | inherit_missing: '1' | |
186 | inherit_version: '1' | |
187 | meta_noindex: '1' | |
188 | Dist::Zilla::Role::ModuleMetadata: | |
189 | Module::Metadata: '1.000033' | |
190 | version: '0.005' | |
191 | name: '@Starter/MetaProvides::Package' | |
192 | version: '2.004003' | |
193 | - | |
194 | class: Dist::Zilla::Plugin::MetaNoIndex | |
195 | name: '@Starter/MetaNoIndex' | |
196 | version: '6.011' | |
197 | - | |
198 | class: Dist::Zilla::Plugin::MetaYAML | |
199 | name: '@Starter/MetaYAML' | |
200 | version: '6.011' | |
201 | - | |
202 | class: Dist::Zilla::Plugin::MetaJSON | |
203 | name: '@Starter/MetaJSON' | |
204 | version: '6.011' | |
205 | - | |
206 | class: Dist::Zilla::Plugin::License | |
207 | name: '@Starter/License' | |
208 | version: '6.011' | |
209 | - | |
210 | class: Dist::Zilla::Plugin::ReadmeAnyFromPod | |
211 | config: | |
212 | Dist::Zilla::Role::FileWatcher: | |
213 | version: '0.006' | |
214 | name: '@Starter/ReadmeAnyFromPod' | |
215 | version: '0.163250' | |
216 | - | |
217 | class: Dist::Zilla::Plugin::ExecDir | |
218 | name: '@Starter/ExecDir' | |
219 | version: '6.011' | |
220 | - | |
221 | class: Dist::Zilla::Plugin::ShareDir | |
222 | name: '@Starter/ShareDir' | |
223 | version: '6.011' | |
224 | - | |
225 | class: Dist::Zilla::Plugin::PodSyntaxTests | |
226 | name: '@Starter/PodSyntaxTests' | |
227 | version: '6.011' | |
228 | - | |
229 | class: Dist::Zilla::Plugin::Test::ReportPrereqs | |
230 | name: '@Starter/Test::ReportPrereqs' | |
231 | version: '0.027' | |
232 | - | |
233 | class: Dist::Zilla::Plugin::Test::Compile | |
234 | config: | |
235 | Dist::Zilla::Plugin::Test::Compile: | |
236 | bail_out_on_fail: '0' | |
237 | fail_on_warning: author | |
238 | fake_home: 0 | |
239 | filename: xt/author/00-compile.t | |
240 | module_finder: | |
241 | - ':InstallModules' | |
242 | needs_display: 0 | |
243 | phase: develop | |
244 | script_finder: | |
245 | - ':PerlExecFiles' | |
246 | skips: [] | |
247 | switch: [] | |
248 | name: '@Starter/Test::Compile' | |
249 | version: '2.058' | |
250 | - | |
251 | class: Dist::Zilla::Plugin::MakeMaker | |
252 | config: | |
253 | Dist::Zilla::Role::TestRunner: | |
254 | default_jobs: 1 | |
255 | name: '@Starter/MakeMaker' | |
256 | version: '6.011' | |
257 | - | |
258 | class: Dist::Zilla::Plugin::Manifest | |
259 | name: '@Starter/Manifest' | |
260 | version: '6.011' | |
261 | - | |
262 | class: Dist::Zilla::Plugin::TestRelease | |
263 | name: '@Starter/TestRelease' | |
264 | version: '6.011' | |
265 | - | |
266 | class: Dist::Zilla::Plugin::RunExtraTests | |
267 | config: | |
268 | Dist::Zilla::Role::TestRunner: | |
269 | default_jobs: 1 | |
270 | name: '@Starter/RunExtraTests' | |
271 | version: '0.029' | |
272 | - | |
273 | class: Dist::Zilla::Plugin::ConfirmRelease | |
274 | name: '@Starter/ConfirmRelease' | |
275 | version: '6.011' | |
276 | - | |
277 | class: Dist::Zilla::Plugin::UploadToCPAN | |
278 | name: '@Starter/UploadToCPAN' | |
279 | version: '6.011' | |
280 | - | |
281 | class: Dist::Zilla::Plugin::ReadmeAnyFromPod | |
282 | config: | |
283 | Dist::Zilla::Role::FileWatcher: | |
284 | version: '0.006' | |
285 | name: Pod_Readme | |
286 | version: '0.163250' | |
287 | - | |
288 | class: Dist::Zilla::Plugin::Git::Check | |
289 | config: | |
290 | Dist::Zilla::Plugin::Git::Check: | |
291 | untracked_files: die | |
292 | Dist::Zilla::Role::Git::DirtyFiles: | |
293 | allow_dirty: | |
294 | - Changes | |
295 | - README.pod | |
296 | - dist.ini | |
297 | allow_dirty_match: [] | |
298 | changelog: Changes | |
299 | Dist::Zilla::Role::Git::Repo: | |
300 | git_version: 1.9.1 | |
301 | repo_root: . | |
302 | name: '@Git/Check' | |
303 | version: '2.043' | |
304 | - | |
305 | class: Dist::Zilla::Plugin::Git::Commit | |
306 | config: | |
307 | Dist::Zilla::Plugin::Git::Commit: | |
308 | add_files_in: [] | |
309 | commit_msg: 'v%v%t - %d%n%n%c' | |
310 | Dist::Zilla::Role::Git::DirtyFiles: | |
311 | allow_dirty: | |
312 | - Changes | |
313 | - README.pod | |
314 | - dist.ini | |
315 | allow_dirty_match: [] | |
316 | changelog: Changes | |
317 | Dist::Zilla::Role::Git::Repo: | |
318 | git_version: 1.9.1 | |
319 | repo_root: . | |
320 | Dist::Zilla::Role::Git::StringFormatter: | |
321 | time_zone: local | |
322 | name: '@Git/Commit' | |
323 | version: '2.043' | |
324 | - | |
325 | class: Dist::Zilla::Plugin::Git::Tag | |
326 | config: | |
327 | Dist::Zilla::Plugin::Git::Tag: | |
328 | branch: ~ | |
329 | changelog: Changes | |
330 | signed: 0 | |
331 | tag: v2.03 | |
332 | tag_format: v%v%t | |
333 | tag_message: 'v%v%t - %d' | |
334 | Dist::Zilla::Role::Git::Repo: | |
335 | git_version: 1.9.1 | |
336 | repo_root: . | |
337 | Dist::Zilla::Role::Git::StringFormatter: | |
338 | time_zone: local | |
339 | name: '@Git/Tag' | |
340 | version: '2.043' | |
341 | - | |
342 | class: Dist::Zilla::Plugin::Git::Push | |
343 | config: | |
344 | Dist::Zilla::Plugin::Git::Push: | |
345 | push_to: | |
346 | - origin | |
347 | remotes_must_exist: 1 | |
348 | Dist::Zilla::Role::Git::Repo: | |
349 | git_version: 1.9.1 | |
350 | repo_root: . | |
351 | name: '@Git/Push' | |
352 | version: '2.043' | |
353 | - | |
354 | class: Dist::Zilla::Plugin::FinderCode | |
355 | name: ':InstallModules' | |
356 | version: '6.011' | |
357 | - | |
358 | class: Dist::Zilla::Plugin::FinderCode | |
359 | name: ':IncModules' | |
360 | version: '6.011' | |
361 | - | |
362 | class: Dist::Zilla::Plugin::FinderCode | |
363 | name: ':TestFiles' | |
364 | version: '6.011' | |
365 | - | |
366 | class: Dist::Zilla::Plugin::FinderCode | |
367 | name: ':ExtraTestFiles' | |
368 | version: '6.011' | |
369 | - | |
370 | class: Dist::Zilla::Plugin::FinderCode | |
371 | name: ':ExecFiles' | |
372 | version: '6.011' | |
373 | - | |
374 | class: Dist::Zilla::Plugin::FinderCode | |
375 | name: ':PerlExecFiles' | |
376 | version: '6.011' | |
377 | - | |
378 | class: Dist::Zilla::Plugin::FinderCode | |
379 | name: ':ShareFiles' | |
380 | version: '6.011' | |
381 | - | |
382 | class: Dist::Zilla::Plugin::FinderCode | |
383 | name: ':MainModule' | |
384 | version: '6.011' | |
385 | - | |
386 | class: Dist::Zilla::Plugin::FinderCode | |
387 | name: ':AllFiles' | |
388 | version: '6.011' | |
389 | - | |
390 | class: Dist::Zilla::Plugin::FinderCode | |
391 | name: ':NoFiles' | |
392 | version: '6.011' | |
393 | - | |
394 | class: Dist::Zilla::Plugin::FinderCode | |
395 | name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' | |
396 | version: '6.011' | |
397 | zilla: | |
398 | class: Dist::Zilla::Dist::Builder | |
399 | config: | |
400 | is_trial: '0' | |
401 | version: '6.011' | |
402 | x_serialization_backend: 'YAML::Tiny version 1.73' |
0 | # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.047. | |
0 | # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.011. | |
1 | 1 | use strict; |
2 | 2 | use warnings; |
3 | 3 | |
20 | 20 | "DBIx::Class" => "0.08108", |
21 | 21 | "HTML::FormFu" => "2.00", |
22 | 22 | "List::MoreUtils" => 0, |
23 | "MooseX::Attribute::Chained" => "1.0.2", | |
23 | 24 | "Storable" => 0, |
24 | 25 | "Task::Weaken" => 0 |
25 | 26 | }, |
26 | 27 | "TEST_REQUIRES" => { |
27 | 28 | "DateTime::Format::SQLite" => 0, |
29 | "ExtUtils::MakeMaker" => 0, | |
30 | "File::Spec" => 0, | |
28 | 31 | "Locale::Maketext" => 0, |
29 | 32 | "SQL::Translator" => "0.11016", |
30 | 33 | "Test::More" => "0.99" |
31 | 34 | }, |
32 | "VERSION" => "2.02", | |
35 | "VERSION" => "2.03", | |
33 | 36 | "test" => { |
34 | 37 | "TESTS" => "t/*.t t/constraints/*.t t/create/*.t t/default_values/*.t t/options_from_model/*.t t/update/*.t t/x_roundtrip/*.t" |
35 | 38 | } |
40 | 43 | "DBD::SQLite" => 0, |
41 | 44 | "DBIx::Class" => "0.08108", |
42 | 45 | "DateTime::Format::SQLite" => 0, |
46 | "ExtUtils::MakeMaker" => 0, | |
47 | "File::Spec" => 0, | |
43 | 48 | "HTML::FormFu" => "2.00", |
44 | 49 | "List::MoreUtils" => 0, |
45 | 50 | "Locale::Maketext" => 0, |
51 | "MooseX::Attribute::Chained" => "1.0.2", | |
46 | 52 | "SQL::Translator" => "0.11016", |
47 | 53 | "Storable" => 0, |
48 | 54 | "Task::Weaken" => 0, |
0 | ||
1 | ||
2 | This archive contains the distribution HTML-FormFu-Model-DBIC, | |
3 | version 2.02: | |
4 | ||
5 | Integrate HTML::FormFu with DBIx::Class | |
6 | ||
7 | This software is copyright (c) 2016 by Carl Franks. | |
8 | ||
9 | This is free software; you can redistribute it and/or modify it under | |
10 | the same terms as the Perl 5 programming language system itself. | |
11 | ||
12 | ||
13 | This README file was generated by Dist::Zilla::Plugin::Readme v5.047. | |
14 | ||
0 | NAME | |
1 | ||
2 | HTML::FormFu::Model::DBIC - Integrate HTML::FormFu with DBIx::Class | |
3 | ||
4 | VERSION | |
5 | ||
6 | version 2.03 | |
7 | ||
8 | SYNOPSIS | |
9 | ||
10 | Example of typical use in a Catalyst controller: | |
11 | ||
12 | sub edit : Chained { | |
13 | my ( $self, $c ) = @_; | |
14 | ||
15 | my $form = $c->stash->{form}; | |
16 | my $book = $c->stash->{book}; | |
17 | ||
18 | if ( $form->submitted_and_valid ) { | |
19 | ||
20 | # update dbic row with submitted values from form | |
21 | ||
22 | $form->model->update( $book ); | |
23 | ||
24 | $c->response->redirect( $c->uri_for('view', $book->id) ); | |
25 | return; | |
26 | } | |
27 | elsif ( !$form->submitted ) { | |
28 | ||
29 | # use dbic row to set form's default values | |
30 | ||
31 | $form->model->default_values( $book ); | |
32 | } | |
33 | ||
34 | return; | |
35 | } | |
36 | ||
37 | SETUP | |
38 | ||
39 | For the form object to be able to access your DBIx::Class schema, it | |
40 | needs to be placed on the form stash, with the name schema. | |
41 | ||
42 | This is easy if you're using Catalyst-Controller-HTML-FormFu, as you | |
43 | can set this up to happen in your Catalyst app's config file. | |
44 | ||
45 | For example, if your model is named MyApp::Model::Corp, you would set | |
46 | this (in Config::General format): | |
47 | ||
48 | <Controller::HTML::FormFu> | |
49 | <model_stash> | |
50 | schema Corp | |
51 | </model_stash> | |
52 | </Controller::HTML::FormFu> | |
53 | ||
54 | Or if your app's config file is in YAML format: | |
55 | ||
56 | 'Controller::HTML::FormFu': | |
57 | model_stash: | |
58 | schema: Corp | |
59 | ||
60 | METHODS | |
61 | ||
62 | default_values | |
63 | ||
64 | Arguments: $dbic_row, [\%config] | |
65 | ||
66 | Return Value: $form | |
67 | ||
68 | $form->model->default_values( $dbic_row ); | |
69 | ||
70 | Set a form's default values from the database, to allow a user to edit | |
71 | them. | |
72 | ||
73 | update | |
74 | ||
75 | Arguments: [$dbic_row], [\%config] | |
76 | ||
77 | Return Value: $dbic_row | |
78 | ||
79 | $form->model->update( $dbic_row ); | |
80 | ||
81 | Update the database with the submitted form values. | |
82 | ||
83 | create | |
84 | ||
85 | Arguments: [\%config] | |
86 | ||
87 | Return Value: $dbic_row | |
88 | ||
89 | my $dbic_row = $form->model->create( {resultset => 'Book'} ); | |
90 | ||
91 | Like "update", but doesn't require a $dbic_row argument. | |
92 | ||
93 | You need to ensure the DBIC schema is available on the form stash - see | |
94 | "SYNOPSIS" for an example config. | |
95 | ||
96 | The resultset must be set either in the method arguments, or the form | |
97 | or block's model_config. | |
98 | ||
99 | An example of setting the ResultSet name on a Form: | |
100 | ||
101 | --- | |
102 | model_config: | |
103 | resultset: FooTable | |
104 | ||
105 | elements: | |
106 | # [snip] | |
107 | ||
108 | options_from_model | |
109 | ||
110 | Populates a multi-valued field with values from the database. | |
111 | ||
112 | This method should not be called directly, but is called for you during | |
113 | $form->process by fields that inherit from | |
114 | HTML::FormFu::Element::_Group. This includes: | |
115 | ||
116 | HTML::FormFu::Element::Select | |
117 | ||
118 | HTML::FormFu::Element::Checkboxgroup | |
119 | ||
120 | HTML::FormFu::Element::Radiogroup | |
121 | ||
122 | HTML::FormFu::Element::ComboBox | |
123 | ||
124 | To use you must set the appropriate resultset on the element | |
125 | model_config: | |
126 | ||
127 | element: | |
128 | - type: Select | |
129 | name: foo | |
130 | model_config: | |
131 | resultset: TableClass | |
132 | ||
133 | BUILDING FORMS | |
134 | ||
135 | single table | |
136 | ||
137 | To edit the values in a row with no related rows, the field names | |
138 | simply have to correspond to the database column names. | |
139 | ||
140 | For the following DBIx::Class schema: | |
141 | ||
142 | package MySchema::Book; | |
143 | use base 'DBIx::Class'; | |
144 | ||
145 | __PACKAGE__->load_components(qw/ Core /); | |
146 | ||
147 | __PACKAGE__->table("book"); | |
148 | ||
149 | __PACKAGE__->add_columns( | |
150 | id => { data_type => "INTEGER" }, | |
151 | title => { data_type => "TEXT" }, | |
152 | author => { data_type => "TEXT" }, | |
153 | blurb => { data_type => "TEXT" }, | |
154 | ); | |
155 | ||
156 | __PACKAGE__->set_primary_key("id"); | |
157 | ||
158 | 1; | |
159 | ||
160 | A suitable form for this might be: | |
161 | ||
162 | elements: | |
163 | - type: Text | |
164 | name: title | |
165 | ||
166 | - type: Text | |
167 | name: author | |
168 | ||
169 | - type: Textarea | |
170 | name: blurb | |
171 | ||
172 | might_have and has_one relationships | |
173 | ||
174 | Set field values from a related row with a might_have or has_one | |
175 | relationship by placing the fields within a Block (or any element that | |
176 | inherits from Block, such as Fieldset) with its "nested_name" in | |
177 | HTML::FormFu set to the relationship name. | |
178 | ||
179 | For the following DBIx::Class schemas: | |
180 | ||
181 | package MySchema::Book; | |
182 | use base 'DBIx::Class'; | |
183 | ||
184 | __PACKAGE__->load_components(qw/ Core /); | |
185 | ||
186 | __PACKAGE__->table("book"); | |
187 | ||
188 | __PACKAGE__->add_columns( | |
189 | id => { data_type => "INTEGER" }, | |
190 | title => { data_type => "TEXT" }, | |
191 | ); | |
192 | ||
193 | __PACKAGE__->set_primary_key("id"); | |
194 | ||
195 | __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); | |
196 | ||
197 | 1; | |
198 | ||
199 | ||
200 | package MySchema::Review; | |
201 | use base 'DBIx::Class'; | |
202 | ||
203 | __PACKAGE__->load_components(qw/ Core /); | |
204 | ||
205 | __PACKAGE__->table("review"); | |
206 | ||
207 | __PACKAGE__->add_columns( | |
208 | id => { data_type => "INTEGER" }, | |
209 | book => { data_type => "INTEGER", is_nullable => 1 }, | |
210 | review_text => { data_type => "TEXT" }, | |
211 | ); | |
212 | ||
213 | __PACKAGE__->set_primary_key("book"); | |
214 | ||
215 | __PACKAGE__->belongs_to( book => 'MySchema::Book' ); | |
216 | ||
217 | 1; | |
218 | ||
219 | A suitable form for this would be: | |
220 | ||
221 | elements: | |
222 | - type: Text | |
223 | name: title | |
224 | ||
225 | - type: Block | |
226 | nested_name: review | |
227 | elements: | |
228 | - type: Textarea | |
229 | name: review_text | |
230 | ||
231 | For might_have and has_one relationships, you generally shouldn't need | |
232 | to have a field for the related table's primary key, as DBIx::Class | |
233 | will handle retrieving the correct row automatically. | |
234 | ||
235 | You can also set a has_one or might_have relationship using a multi | |
236 | value field like Select. | |
237 | ||
238 | elements: | |
239 | - type: Text | |
240 | name: title | |
241 | ||
242 | - type: Select | |
243 | nested: review | |
244 | model_config: | |
245 | resultset: Review | |
246 | ||
247 | This will load all reviews into the select field. If you select a | |
248 | review from that list, a current relationship to a review is removed | |
249 | and the new one is added. This requires that the primary key of the | |
250 | Review table and the foreign key do not match. | |
251 | ||
252 | has_many and many_to_many relationships | |
253 | ||
254 | The general principle is the same as for might_have and has_one above, | |
255 | except you should use a Repeatable element instead of a Block, and it | |
256 | needs to contain a Hidden field corresponding to the primary key of the | |
257 | related table. | |
258 | ||
259 | The Repeatable block's nested_name must be set to the name of the | |
260 | relationship. | |
261 | ||
262 | The Repeable block's increment_field_names must be true (which is the | |
263 | default value). | |
264 | ||
265 | The Repeable block's counter_name must be set to the name of a Hidden | |
266 | field, which is placed outside of the Repeatable block. This field is | |
267 | used to store a count of the number of repetitions of the Repeatable | |
268 | block were created. When the form is submitted, this value is used | |
269 | during $form->process to ensure the form is rebuilt with the correct | |
270 | number of repetitions. | |
271 | ||
272 | To allow the user to add new related rows, either empty_rows or | |
273 | new_rows_max must be set - see "Config options for Repeatable blocks" | |
274 | below. | |
275 | ||
276 | For the following DBIx::Class schemas: | |
277 | ||
278 | package MySchema::Book; | |
279 | use base 'DBIx::Class'; | |
280 | ||
281 | __PACKAGE__->load_components(qw/ Core /); | |
282 | ||
283 | __PACKAGE__->table("book"); | |
284 | ||
285 | __PACKAGE__->add_columns( | |
286 | id => { data_type => "INTEGER" }, | |
287 | title => { data_type => "TEXT" }, | |
288 | ); | |
289 | ||
290 | __PACKAGE__->set_primary_key("id"); | |
291 | ||
292 | __PACKAGE__->has_many( review => 'MySchema::Review', 'book' ); | |
293 | ||
294 | 1; | |
295 | ||
296 | ||
297 | package MySchema::Review; | |
298 | use base 'DBIx::Class'; | |
299 | ||
300 | __PACKAGE__->load_components(qw/ Core /); | |
301 | ||
302 | __PACKAGE__->table("review"); | |
303 | ||
304 | __PACKAGE__->add_columns( | |
305 | book => { data_type => "INTEGER" }, | |
306 | review_text => { data_type => "TEXT" }, | |
307 | ); | |
308 | ||
309 | __PACKAGE__->set_primary_key("book"); | |
310 | ||
311 | __PACKAGE__->belongs_to( book => 'MySchema::Book' ); | |
312 | ||
313 | 1; | |
314 | ||
315 | A suitable form for this might be: | |
316 | ||
317 | elements: | |
318 | - type: Text | |
319 | name: title | |
320 | ||
321 | - type: Hidden | |
322 | name: review_count | |
323 | ||
324 | - type: Repeatable | |
325 | nested_name: review | |
326 | counter_name: review_count | |
327 | model_config: | |
328 | empty_rows: 1 | |
329 | elements: | |
330 | - type: Hidden | |
331 | name: book | |
332 | ||
333 | - type: Textarea | |
334 | name: review_text | |
335 | ||
336 | belongs_to relationships | |
337 | ||
338 | Belongs-to relationships can be edited / created with a ComboBox | |
339 | element. If the user selects a value with the Select field, the | |
340 | belongs-to will be set to an already-existing row in the related table. | |
341 | If the user enters a value into the Text field, the belongs-to will be | |
342 | set using a newly-created row in the related table. | |
343 | ||
344 | elements: | |
345 | - type: ComboBox | |
346 | name: author | |
347 | model_config: | |
348 | resultset: Author | |
349 | select_column: id | |
350 | text_column: name | |
351 | ||
352 | The element name should match the relationship name. | |
353 | $field->model_config->{select_column} should match the related primary | |
354 | column. $field->model_config->{text_column} should match the related | |
355 | text column. | |
356 | ||
357 | many_to_many selection | |
358 | ||
359 | To select / deselect rows from a many_to_many relationship, you must | |
360 | use a multi-valued element, such as a Checkboxgroup or a Select with | |
361 | multiple set. | |
362 | ||
363 | The field's name must be set to the name of the many_to_many | |
364 | relationship. | |
365 | ||
366 | default_column | |
367 | ||
368 | If you want to search / associate the related table by a column other | |
369 | it's primary key, set $field->model_config->{default_column}. | |
370 | ||
371 | --- | |
372 | element: | |
373 | - type: Checkboxgroup | |
374 | name: authors | |
375 | model_config: | |
376 | default_column: foo | |
377 | ||
378 | link_values | |
379 | ||
380 | If you want to set columns on the link table you can do so if you add a | |
381 | link_values attribute to model_config: | |
382 | ||
383 | --- | |
384 | element: | |
385 | - type: Checkboxgroup | |
386 | name: authors | |
387 | model_config: | |
388 | link_values: | |
389 | foo: bar | |
390 | ||
391 | additive | |
392 | ||
393 | The default implementation will first remove all related objects and | |
394 | set the new ones (see | |
395 | http://search.cpan.org/perldoc?DBIx::Class::Relationship::Base#set_$rel). | |
396 | If you want to add the selected objects to the current set of objects | |
397 | set additive in the model_config. | |
398 | ||
399 | --- | |
400 | element: | |
401 | - type: Checkboxgroup | |
402 | name: authors | |
403 | model_config: | |
404 | additive: 1 | |
405 | options_from_model: 0 | |
406 | ||
407 | "options_from_model" is set to 0 because it will try to fetch all | |
408 | objects from the result class Authors if model_config is specified | |
409 | without a resultset attribute.) | |
410 | ||
411 | COMMON ARGUMENTS | |
412 | ||
413 | The following items are supported in the optional config hash-ref | |
414 | argument to the methods default_values, update and create. | |
415 | ||
416 | base | |
417 | ||
418 | If you want the method to process a particular Block element, rather | |
419 | than the whole form, you can pass the element as a base argument. | |
420 | ||
421 | $form->default_values( | |
422 | $row, | |
423 | { | |
424 | base => $formfu_element, | |
425 | }, | |
426 | ); | |
427 | ||
428 | nested_base | |
429 | ||
430 | If you want the method to process a particular Block element by name, | |
431 | you can pass the name as an argument. | |
432 | ||
433 | $form->default_values( | |
434 | $row, | |
435 | { | |
436 | nested_base => 'foo', | |
437 | }' | |
438 | ); | |
439 | ||
440 | CONFIGURATION | |
441 | ||
442 | Config options for fields | |
443 | ||
444 | The following items are supported as model_config options on form | |
445 | fields. | |
446 | ||
447 | accessor | |
448 | ||
449 | If set, accessor will be used as a method-name accessor on the | |
450 | DBIx::Class row object, instead of using the field name. | |
451 | ||
452 | ignore_if_empty | |
453 | ||
454 | If the submitted value is blank, no attempt will be made to save it | |
455 | to the database. | |
456 | ||
457 | null_if_empty | |
458 | ||
459 | If the submitted value is blank, save it as NULL to the database. | |
460 | Normally an empty string is saved as NULL when its corresponding | |
461 | field is numeric, and as an empty string when its corresponding field | |
462 | is a text field. This option is useful for changing the default | |
463 | behavior for text fields. | |
464 | ||
465 | delete_if_empty | |
466 | ||
467 | Useful for editing a "might_have" related row containing only one | |
468 | field. | |
469 | ||
470 | If the submitted value is blank, the related row is deleted. | |
471 | ||
472 | For the following DBIx::Class schemas: | |
473 | ||
474 | package MySchema::Book; | |
475 | use base 'DBIx::Class'; | |
476 | ||
477 | __PACKAGE__->load_components(qw/ Core /); | |
478 | ||
479 | __PACKAGE__->table("book"); | |
480 | ||
481 | __PACKAGE__->add_columns( | |
482 | id => { data_type => "INTEGER" }, | |
483 | title => { data_type => "TEXT" }, | |
484 | ); | |
485 | ||
486 | __PACKAGE__->set_primary_key("id"); | |
487 | ||
488 | __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); | |
489 | ||
490 | 1; | |
491 | ||
492 | ||
493 | package MySchema::Review; | |
494 | use base 'DBIx::Class'; | |
495 | ||
496 | __PACKAGE__->load_components(qw/ Core /); | |
497 | ||
498 | __PACKAGE__->table("review"); | |
499 | ||
500 | __PACKAGE__->add_columns( | |
501 | book => { data_type => "INTEGER" }, | |
502 | review_text => { data_type => "TEXT" }, | |
503 | ); | |
504 | ||
505 | __PACKAGE__->set_primary_key("book"); | |
506 | ||
507 | __PACKAGE__->belongs_to( book => 'MySchema::Book' ); | |
508 | ||
509 | 1; | |
510 | ||
511 | A suitable form for this would be: | |
512 | ||
513 | elements: | |
514 | - type: Text | |
515 | name: title | |
516 | ||
517 | - type: Block | |
518 | nested_name: review | |
519 | elements: | |
520 | - type: Text | |
521 | name: review_text | |
522 | model_config: | |
523 | delete_if_empty: 1 | |
524 | ||
525 | label | |
526 | ||
527 | To use a column value for a form field's label. | |
528 | ||
529 | Config options for fields within a Repeatable block | |
530 | ||
531 | delete_if_true | |
532 | ||
533 | Intended for use on a Checkbox field. | |
534 | ||
535 | If the checkbox is checked, the following occurs: for a has-many | |
536 | relationship, the related row is deleted; for a many-to-many | |
537 | relationship, the relationship link is removed. | |
538 | ||
539 | An example of use might be: | |
540 | ||
541 | elements: | |
542 | - type: Text | |
543 | name: title | |
544 | ||
545 | - type: Hidden | |
546 | name: review_count | |
547 | ||
548 | - type: Repeatable | |
549 | nested_name: review | |
550 | counter_name: review_count | |
551 | elements: | |
552 | - type: Hidden | |
553 | name: book | |
554 | ||
555 | - type: Textarea | |
556 | name: review_text | |
557 | ||
558 | - type: Checkbox | |
559 | name: delete_review | |
560 | label: 'Delete Review?' | |
561 | model_config: | |
562 | delete_if_true: 1 | |
563 | ||
564 | Note: make sure the name of this field does not clash with one of | |
565 | your DBIx::Class::Row method names (e.g. "delete") - see "CAVEATS". | |
566 | ||
567 | Config options for Repeatable blocks | |
568 | ||
569 | empty_rows | |
570 | ||
571 | For a Repeatable block corresponding to a has-many or many-to-many | |
572 | relationship, to allow the user to insert new rows, set empty_rows to | |
573 | the number of extra repetitions you wish added to the end of the | |
574 | Repeatable block. | |
575 | ||
576 | new_rows_max | |
577 | ||
578 | Set to the maximum number of new rows that a Repeatable block is | |
579 | allowed to add. | |
580 | ||
581 | If not set, it will fallback to the value of empty_rows. | |
582 | ||
583 | Config options for options_from_model | |
584 | ||
585 | The column used for the element values is set with the model_config | |
586 | value id_column - or if not set, the table's primary column is used. | |
587 | ||
588 | element: | |
589 | - type: Select | |
590 | name: foo | |
591 | model_config: | |
592 | resultset: TableClass | |
593 | id_column: pk_col | |
594 | ||
595 | The column used for the element labels is set with the model_config | |
596 | value label_column - or if not set, the first text/varchar column found | |
597 | in the table is used - or if one is not found, the id_column is used | |
598 | instead. | |
599 | ||
600 | element: | |
601 | - type: Select | |
602 | name: foo | |
603 | model_config: | |
604 | resultset: TableClass | |
605 | label_column: label_col | |
606 | ||
607 | To pass the database label values via the form's localization object, | |
608 | set localize_label | |
609 | ||
610 | element: | |
611 | - type: Select | |
612 | name: foo | |
613 | model_config: | |
614 | localize_label: 1 | |
615 | ||
616 | You can set a condition, which will be passed as the 1st argument to | |
617 | "search" in DBIx::Class::ResultSet. | |
618 | ||
619 | element: | |
620 | - type: Select | |
621 | name: foo | |
622 | model_config: | |
623 | resultset: TableClass | |
624 | condition: | |
625 | type: is_foo | |
626 | ||
627 | You can set a condition_from_stash, which will be passed as the 1st | |
628 | argument to "search" in DBIx::Class::ResultSet. | |
629 | ||
630 | key is the column-name to be passed to search, and stash_key is the | |
631 | name of a key on the form stash from which the value to be passed to | |
632 | search is found. | |
633 | ||
634 | element: | |
635 | - type: Select | |
636 | name: foo | |
637 | model_config: | |
638 | resultset: TableClass | |
639 | condition_from_stash: | |
640 | key: stash_key | |
641 | ||
642 | Is comparable to: | |
643 | ||
644 | $form->element({ | |
645 | type => 'Select', | |
646 | name => 'foo', | |
647 | model_config => { | |
648 | resultset => 'TableClass', | |
649 | condition => { | |
650 | key => $form->stash->{stash_key} | |
651 | } | |
652 | } | |
653 | }) | |
654 | ||
655 | If the value in the stash is nested in a data-structure, you can access | |
656 | it by setting expand_stash_dots. As you can see in the example below, | |
657 | it automatically handles calling methods on objects, accessing | |
658 | hash-keys on hash-references, and accessing array-slots on array | |
659 | references. | |
660 | ||
661 | element: | |
662 | - type: Select | |
663 | name: foo | |
664 | model_config: | |
665 | resultset: TableClass | |
666 | condition_from_stash: | |
667 | key: foo.bar.0 | |
668 | expand_stash_dots: 1 | |
669 | ||
670 | Is comparable to: | |
671 | ||
672 | $form->element({ | |
673 | type => 'Select', | |
674 | name => 'foo', | |
675 | model_config => { | |
676 | resultset => 'TableClass', | |
677 | condition => { | |
678 | key => $form->stash->{foo}->bar->[0]; | |
679 | } | |
680 | } | |
681 | }) | |
682 | # Where stash returns a hashref. | |
683 | # The 'foo' hash-key returns an object. | |
684 | # The object-method 'bar' returns an arrayref. | |
685 | # The first array slot returns the value used in the query. | |
686 | ||
687 | You can set attributes, which will be passed as the 2nd argument to | |
688 | "search" in DBIx::Class::ResultSet. | |
689 | ||
690 | ENUM Column Type | |
691 | ||
692 | If the field name matches (case-insensitive) a column name with type | |
693 | 'ENUM' and the Schema contains enum values in | |
694 | $resultset->column_info($name)->{extra}{list}, the field's options will | |
695 | be populated with the enum values. | |
696 | ||
697 | FAQ | |
698 | ||
699 | Add extra values not in the form | |
700 | ||
701 | To update values to the database which weren't submitted to the form, | |
702 | you can first add them to the form with add_valid. | |
703 | ||
704 | my $passwd = generate_passwd(); | |
705 | ||
706 | $form->add_valid( passwd => $passwd ); | |
707 | ||
708 | $form->model->update( $row ); | |
709 | ||
710 | add_valid works for fieldnames that don't exist in the form. | |
711 | ||
712 | Set a field read only | |
713 | ||
714 | You can make a field read only. The value of such fields cannot be | |
715 | changed by the user even if they submit a value for it. | |
716 | ||
717 | $field->model_config->{read_only} = 1; | |
718 | ||
719 | - Name: field | |
720 | model_config: | |
721 | read_only: 1 | |
722 | ||
723 | See HTML::FormFu::Element::Label. | |
724 | ||
725 | CAVEATS | |
726 | ||
727 | To ensure your column's inflators and deflators are called, we have to | |
728 | get / set values using their named methods, and not with get_column / | |
729 | set_column. | |
730 | ||
731 | Because of this, beware of having column names which clash with | |
732 | DBIx::Class built-in method-names, such as delete. - It will have | |
733 | obviously undesirable results! | |
734 | ||
735 | REMOVED METHODS | |
736 | ||
737 | new_empty_row | |
738 | ||
739 | See empty_rows in "Config options for Repeatable blocks" instead. | |
740 | ||
741 | new_empty_row_multi | |
742 | ||
743 | See new_rows_max in "Config options for Repeatable blocks" instead. | |
744 | ||
745 | Range constraint | |
746 | ||
747 | See empty_rows in "Config options for Repeatable blocks" instead. | |
748 | ||
749 | SUPPORT | |
750 | ||
751 | Project Page: | |
752 | ||
753 | http://code.google.com/p/html-formfu/ | |
754 | ||
755 | Mailing list: | |
756 | ||
757 | http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu | |
758 | ||
759 | Mailing list archives: | |
760 | ||
761 | http://lists.scsys.co.uk/pipermail/html-formfu/ | |
762 | ||
763 | BUGS | |
764 | ||
765 | Please submit bugs / feature requests to | |
766 | http://code.google.com/p/html-formfu/issues/list (preferred) or | |
767 | http://rt.perl.org. | |
768 | ||
769 | GITHUB REPOSITORY | |
770 | ||
771 | This module's sourcecode is maintained in a git repository at | |
772 | git://github.com/fireartist/HTML-FormFu-Model-DBIC.git | |
773 | ||
774 | The project page is | |
775 | https://github.com/fireartist/HTML-FormFu-Model-DBIC | |
776 | ||
777 | SEE ALSO | |
778 | ||
779 | HTML::FormFu, DBIx::Class, Catalyst::Controller::HTML::FormFu | |
780 | ||
781 | AUTHOR | |
782 | ||
783 | Carl Franks | |
784 | ||
785 | CONTRIBUTORS | |
786 | ||
787 | Based on the code of DBIx::Class::HTML::FormFu, which was contributed | |
788 | to by: | |
789 | ||
790 | Adam Herzog | |
791 | ||
792 | Daisuke Maki | |
793 | ||
794 | Mario Minati | |
795 | ||
796 | COPYRIGHT AND LICENSE | |
797 | ||
798 | Copyright (C) 2007 by Carl Franks | |
799 | ||
800 | Based on the original source code of DBIx::Class::HTMLWidget, copyright | |
801 | Thomas Klausner. | |
802 | ||
803 | This library is free software; you can redistribute it and/or modify it | |
804 | under the same terms as Perl itself, either Perl version 5.8.8 or, at | |
805 | your option, any later version of Perl 5 you may have available. | |
806 |
9 | 9 | DBIx::Class = 0.08108 |
10 | 10 | HTML::FormFu = 2.00 |
11 | 11 | List::MoreUtils = 0 |
12 | MooseX::Attribute::Chained = 1.0.2 | |
12 | 13 | Storable = 0 |
13 | 14 | Task::Weaken = 0 ; make sure Scalar::Util has weaken() |
14 | 15 | |
21 | 22 | [Prereqs / DevelopRequires] |
22 | 23 | Test::Pod = 0 |
23 | 24 | |
24 | [MetaNoIndex] | |
25 | directory = examples | |
26 | directory = t | |
27 | directory = t-aggregate | |
28 | directory = xt | |
29 | ||
25 | ;; -- | |
26 | ;; -- Sets of additional tests we want to do as part of release | |
30 | 27 | [Test::Perl::Critic] |
31 | [MetaJSON] | |
32 | 28 | [MetaTests] |
33 | 29 | ;; [PodCoverageTests] ; Currently we comprehensively fail these |
34 | [PodSyntaxTests] | |
35 | 30 | [OurPkgVersion] |
36 | 31 | [PodVersion] |
37 | 32 | [Test::Kwalitee] |
38 | 33 | [Test::EOL] |
34 | finder = :InstallModules ; prevents test inputs being flagged | |
39 | 35 | [Test::PAUSE::Permissions] ; if doing a release make sure we have PAUSE perms |
40 | 36 | |
41 | [Git::NextVersion] | |
42 | [Git::CheckFor::CorrectBranch] ; ensure on master branch | |
43 | [Git::Remote::Check] | |
37 | ;; -- Additional information | |
38 | [GithubMeta] ; Grab the repo metadata | |
39 | [NextRelease] ; Mark up the next release in changes | |
44 | 40 | |
45 | [Repository] | |
41 | ;; -- Additional git | |
42 | [Git::GatherDir] | |
43 | [Git::NextVersion] ; Get the next version tag from git | |
44 | [Git::CheckFor::CorrectBranch] ; ensure on master branch for release | |
45 | [Git::Remote::Check] ; ensure our branch is ahead of remote | |
46 | 46 | |
47 | [NextRelease] | |
48 | format = %v %{yyyy-MM-dd}d | |
47 | ;; -- We base the release stuff on the starter module, and tweak a bit | |
48 | [@Starter] | |
49 | -remove = GatherDir ; this is replaced by [Git::GatherDir] | |
50 | ReadmeAnyFromPod.source_filename = lib/HTML/FormFu/Model/DBIC.pm | |
51 | ||
52 | [ReadmeAnyFromPod / Pod_Readme] | |
53 | type = pod | |
54 | location = root ; do not include pod readmes in the build! | |
49 | 55 | |
50 | ; This keeps github happier by putting a README.pod into the repo | |
51 | [ReadmeAnyFromPod / ReadmePodInRoot] | |
52 | type = pod | |
53 | filename = README.pod | |
54 | location = root | |
55 | ||
56 | [@Basic] | |
57 | 56 | [@Git] |
57 | changelog = Changes | |
58 | 58 | allow_dirty = dist.ini |
59 | 59 | allow_dirty = README.pod |
60 | allow_dirty = Changes | |
61 | commit_msg = v%v%t - %d%n%n%c | |
62 | tag_format = v%v%t ; see Git::Tag | |
63 | tag_message = v%v%t - %d ; see Git::Tag⏎ |
0 | 0 | package HTML::FormFu::Constraint::DBIC::Unique; |
1 | 1 | |
2 | 2 | use strict; |
3 | our $VERSION = '2.02'; # VERSION | |
3 | our $VERSION = '2.03'; # VERSION | |
4 | 4 | |
5 | 5 | use Moose; |
6 | use MooseX::Attribute::FormFuChained; | |
6 | use MooseX::Attribute::Chained; | |
7 | 7 | |
8 | 8 | extends 'HTML::FormFu::Constraint'; |
9 | 9 | |
11 | 11 | |
12 | 12 | use HTML::FormFu::Util qw( DEBUG_CONSTRAINTS debug ); |
13 | 13 | |
14 | has model => ( is => 'rw', traits => ['FormFuChained'] ); | |
15 | has resultset => ( is => 'rw', traits => ['FormFuChained'] ); | |
16 | has column => ( is => 'rw', traits => ['FormFuChained'] ); | |
17 | has method_name => ( is => 'rw', traits => ['FormFuChained'] ); | |
18 | has self_stash_key => ( is => 'rw', traits => ['FormFuChained'] ); | |
19 | has others => ( is => 'rw', traits => ['FormFuChained'] ); | |
20 | has id_field => ( is => 'rw', traits => ['FormFuChained'] ); | |
14 | has model => ( is => 'rw', traits => ['Chained'] ); | |
15 | has resultset => ( is => 'rw', traits => ['Chained'] ); | |
16 | has column => ( is => 'rw', traits => ['Chained'] ); | |
17 | has method_name => ( is => 'rw', traits => ['Chained'] ); | |
18 | has self_stash_key => ( is => 'rw', traits => ['Chained'] ); | |
19 | has others => ( is => 'rw', traits => ['Chained'] ); | |
20 | has id_field => ( is => 'rw', traits => ['Chained'] ); | |
21 | 21 | |
22 | 22 | sub constrain_value { |
23 | 23 | my ( $self, $value ) = @_; |
167 | 167 | |
168 | 168 | =head1 VERSION |
169 | 169 | |
170 | version 2.02 | |
170 | version 2.03 | |
171 | 171 | |
172 | 172 | =head1 SYNOPSIS |
173 | 173 |
3 | 3 | use warnings; |
4 | 4 | use base 'HTML::FormFu::Model'; |
5 | 5 | |
6 | our $VERSION = '2.02'; # VERSION | |
6 | our $VERSION = '2.03'; # VERSION | |
7 | 7 | |
8 | 8 | use HTML::FormFu::Util qw( _merge_hashes ); |
9 | 9 | use List::MoreUtils qw( none notall ); |
10 | 10 | use List::Util qw( first ); |
11 | use Scalar::Util qw( blessed ); | |
11 | use Scalar::Util qw( blessed reftype ); | |
12 | 12 | use Storable qw( dclone ); |
13 | 13 | use Carp qw( croak ); |
14 | 14 | |
60 | 60 | : {}; # avoid overwriting attrs->{condition} |
61 | 61 | for my $name ( keys %$from_stash ) { |
62 | 62 | croak "config value must not be a reference" if ref $from_stash->{$name}; |
63 | my $value = $form->stash->{ $from_stash->{$name} }; | |
64 | $condition->{$name} = $value; | |
63 | if ( $attrs->{expand_stash_dots} ) { | |
64 | $condition->{$name} = $self->_get_stash_value( $form->stash, $from_stash->{$name} ); | |
65 | } | |
66 | else { | |
67 | $condition->{$name} = $form->stash->{ $from_stash->{$name} }; | |
68 | } | |
65 | 69 | } |
66 | 70 | } |
67 | 71 | |
91 | 95 | } |
92 | 96 | |
93 | 97 | return @defaults; |
98 | } | |
99 | ||
100 | sub _get_stash_value { | |
101 | my ( $self, $stash, $key ) = @_; | |
102 | my $base = $stash; | |
103 | ||
104 | if ( $key =~ /\./ ) { | |
105 | for my $part ( grep {length} split qr/\./, $key ) { | |
106 | if ( blessed($base) && $base->can($part) ) { | |
107 | $base = $base->$part; | |
108 | } | |
109 | elsif ( 'HASH' eq reftype($base) ) { | |
110 | $base = $base->{$part}; | |
111 | } | |
112 | elsif ( 'ARRAY' eq reftype($base) && $key =~ /^[0-9]+\z/ ) { | |
113 | $base = $base->[$key]; | |
114 | } | |
115 | else { | |
116 | croak "don't know what to do with part '$part' in key '$key'"; | |
117 | } | |
118 | } | |
119 | } | |
120 | ||
121 | return $base; | |
94 | 122 | } |
95 | 123 | |
96 | 124 | sub _get_resultset { |
1143 | 1171 | |
1144 | 1172 | =head1 VERSION |
1145 | 1173 | |
1146 | version 2.02 | |
1174 | version 2.03 | |
1147 | 1175 | |
1148 | 1176 | =head1 SYNOPSIS |
1149 | 1177 | |
1814 | 1842 | } |
1815 | 1843 | }) |
1816 | 1844 | |
1845 | If the value in the stash is nested in a data-structure, you can access it by | |
1846 | setting C<expand_stash_dots>. As you can see in the example below, it | |
1847 | automatically handles calling methods on objects, accessing hash-keys on | |
1848 | hash-references, and accessing array-slots on array references. | |
1849 | ||
1850 | element: | |
1851 | - type: Select | |
1852 | name: foo | |
1853 | model_config: | |
1854 | resultset: TableClass | |
1855 | condition_from_stash: | |
1856 | key: foo.bar.0 | |
1857 | expand_stash_dots: 1 | |
1858 | ||
1859 | Is comparable to: | |
1860 | ||
1861 | $form->element({ | |
1862 | type => 'Select', | |
1863 | name => 'foo', | |
1864 | model_config => { | |
1865 | resultset => 'TableClass', | |
1866 | condition => { | |
1867 | key => $form->stash->{foo}->bar->[0]; | |
1868 | } | |
1869 | } | |
1870 | }) | |
1871 | # Where stash returns a hashref. | |
1872 | # The 'foo' hash-key returns an object. | |
1873 | # The object-method 'bar' returns an arrayref. | |
1874 | # The first array slot returns the value used in the query. | |
1875 | ||
1817 | 1876 | You can set C<attributes>, which will be passed as the 2nd argument to |
1818 | 1877 | L<DBIx::Class::ResultSet/search>. |
1819 | 1878 |
0 | do { my $x = { | |
1 | 'configure' => { | |
2 | 'requires' => { | |
3 | 'ExtUtils::MakeMaker' => '0' | |
4 | } | |
5 | }, | |
6 | 'develop' => { | |
7 | 'requires' => { | |
8 | 'File::Spec' => '0', | |
9 | 'IO::Handle' => '0', | |
10 | 'IPC::Open3' => '0', | |
11 | 'Test::CPAN::Meta' => '0', | |
12 | 'Test::EOL' => '0', | |
13 | 'Test::Kwalitee' => '1.21', | |
14 | 'Test::More' => '0.88', | |
15 | 'Test::PAUSE::Permissions' => '0', | |
16 | 'Test::Perl::Critic' => '0', | |
17 | 'Test::Pod' => '1.41' | |
18 | } | |
19 | }, | |
20 | 'runtime' => { | |
21 | 'requires' => { | |
22 | 'DBD::SQLite' => '0', | |
23 | 'DBIx::Class' => '0.08108', | |
24 | 'HTML::FormFu' => '2.00', | |
25 | 'List::MoreUtils' => '0', | |
26 | 'MooseX::Attribute::Chained' => 'v1.0.2', | |
27 | 'Storable' => '0', | |
28 | 'Task::Weaken' => '0', | |
29 | 'perl' => '5.008001' | |
30 | } | |
31 | }, | |
32 | 'test' => { | |
33 | 'recommends' => { | |
34 | 'CPAN::Meta' => '2.120900' | |
35 | }, | |
36 | 'requires' => { | |
37 | 'DateTime::Format::SQLite' => '0', | |
38 | 'ExtUtils::MakeMaker' => '0', | |
39 | 'File::Spec' => '0', | |
40 | 'Locale::Maketext' => '0', | |
41 | 'SQL::Translator' => '0.11016', | |
42 | 'Test::More' => '0.99' | |
43 | } | |
44 | } | |
45 | }; | |
46 | $x; | |
47 | }⏎ |
0 | #!perl | |
1 | ||
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 | |
6 | ||
7 | use Test::More tests => 1; | |
8 | ||
9 | use ExtUtils::MakeMaker; | |
10 | use File::Spec; | |
11 | ||
12 | # from $version::LAX | |
13 | my $lax_version_re = | |
14 | qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | |
15 | | | |
16 | (?:\.[0-9]+) (?:_[0-9]+)? | |
17 | ) | (?: | |
18 | v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | |
19 | | | |
20 | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? | |
21 | ) | |
22 | )/x; | |
23 | ||
24 | # hide optional CPAN::Meta modules from prereq scanner | |
25 | # and check if they are available | |
26 | my $cpan_meta = "CPAN::Meta"; | |
27 | my $cpan_meta_pre = "CPAN::Meta::Prereqs"; | |
28 | my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic | |
29 | ||
30 | # Verify requirements? | |
31 | my $DO_VERIFY_PREREQS = 1; | |
32 | ||
33 | sub _max { | |
34 | my $max = shift; | |
35 | $max = ( $_ > $max ) ? $_ : $max for @_; | |
36 | return $max; | |
37 | } | |
38 | ||
39 | sub _merge_prereqs { | |
40 | my ($collector, $prereqs) = @_; | |
41 | ||
42 | # CPAN::Meta::Prereqs object | |
43 | if (ref $collector eq $cpan_meta_pre) { | |
44 | return $collector->with_merged_prereqs( | |
45 | CPAN::Meta::Prereqs->new( $prereqs ) | |
46 | ); | |
47 | } | |
48 | ||
49 | # Raw hashrefs | |
50 | for my $phase ( keys %$prereqs ) { | |
51 | for my $type ( keys %{ $prereqs->{$phase} } ) { | |
52 | for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { | |
53 | $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; | |
54 | } | |
55 | } | |
56 | } | |
57 | ||
58 | return $collector; | |
59 | } | |
60 | ||
61 | my @include = qw( | |
62 | ||
63 | ); | |
64 | ||
65 | my @exclude = qw( | |
66 | ||
67 | ); | |
68 | ||
69 | # Add static prereqs to the included modules list | |
70 | my $static_prereqs = do './t/00-report-prereqs.dd'; | |
71 | ||
72 | # Merge all prereqs (either with ::Prereqs or a hashref) | |
73 | my $full_prereqs = _merge_prereqs( | |
74 | ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), | |
75 | $static_prereqs | |
76 | ); | |
77 | ||
78 | # Add dynamic prereqs to the included modules list (if we can) | |
79 | my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; | |
80 | my $cpan_meta_error; | |
81 | if ( $source && $HAS_CPAN_META | |
82 | && (my $meta = eval { CPAN::Meta->load_file($source) } ) | |
83 | ) { | |
84 | $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); | |
85 | } | |
86 | else { | |
87 | $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) | |
88 | $source = 'static metadata'; | |
89 | } | |
90 | ||
91 | my @full_reports; | |
92 | my @dep_errors; | |
93 | my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; | |
94 | ||
95 | # Add static includes into a fake section | |
96 | for my $mod (@include) { | |
97 | $req_hash->{other}{modules}{$mod} = 0; | |
98 | } | |
99 | ||
100 | for my $phase ( qw(configure build test runtime develop other) ) { | |
101 | next unless $req_hash->{$phase}; | |
102 | next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); | |
103 | ||
104 | for my $type ( qw(requires recommends suggests conflicts modules) ) { | |
105 | next unless $req_hash->{$phase}{$type}; | |
106 | ||
107 | my $title = ucfirst($phase).' '.ucfirst($type); | |
108 | my @reports = [qw/Module Want Have/]; | |
109 | ||
110 | for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { | |
111 | next if $mod eq 'perl'; | |
112 | next if grep { $_ eq $mod } @exclude; | |
113 | ||
114 | my $file = $mod; | |
115 | $file =~ s{::}{/}g; | |
116 | $file .= ".pm"; | |
117 | my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; | |
118 | ||
119 | my $want = $req_hash->{$phase}{$type}{$mod}; | |
120 | $want = "undef" unless defined $want; | |
121 | $want = "any" if !$want && $want == 0; | |
122 | ||
123 | my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; | |
124 | ||
125 | if ($prefix) { | |
126 | my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); | |
127 | $have = "undef" unless defined $have; | |
128 | push @reports, [$mod, $want, $have]; | |
129 | ||
130 | if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { | |
131 | if ( $have !~ /\A$lax_version_re\z/ ) { | |
132 | push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; | |
133 | } | |
134 | elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { | |
135 | push @dep_errors, "$mod version '$have' is not in required range '$want'"; | |
136 | } | |
137 | } | |
138 | } | |
139 | else { | |
140 | push @reports, [$mod, $want, "missing"]; | |
141 | ||
142 | if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { | |
143 | push @dep_errors, "$mod is not installed ($req_string)"; | |
144 | } | |
145 | } | |
146 | } | |
147 | ||
148 | if ( @reports ) { | |
149 | push @full_reports, "=== $title ===\n\n"; | |
150 | ||
151 | my $ml = _max( map { length $_->[0] } @reports ); | |
152 | my $wl = _max( map { length $_->[1] } @reports ); | |
153 | my $hl = _max( map { length $_->[2] } @reports ); | |
154 | ||
155 | if ($type eq 'modules') { | |
156 | splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; | |
157 | push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; | |
158 | } | |
159 | else { | |
160 | splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; | |
161 | push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; | |
162 | } | |
163 | ||
164 | push @full_reports, "\n"; | |
165 | } | |
166 | } | |
167 | } | |
168 | ||
169 | if ( @full_reports ) { | |
170 | diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; | |
171 | } | |
172 | ||
173 | if ( $cpan_meta_error || @dep_errors ) { | |
174 | diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; | |
175 | } | |
176 | ||
177 | if ( $cpan_meta_error ) { | |
178 | my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; | |
179 | diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; | |
180 | } | |
181 | ||
182 | if ( @dep_errors ) { | |
183 | diag join("\n", | |
184 | "\nThe following REQUIRED prerequisites were not satisfied:\n", | |
185 | @dep_errors, | |
186 | "\n" | |
187 | ); | |
188 | } | |
189 | ||
190 | pass; | |
191 | ||
192 | # vim: ts=4 sts=4 sw=4 et: |
0 | #!perl | |
1 | ||
2 | BEGIN { | |
3 | unless ($ENV{AUTHOR_TESTING}) { | |
4 | require Test::More; | |
5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); | |
6 | } | |
7 | } | |
8 | ||
9 | ||
10 | use strict; | |
11 | use warnings; | |
12 | ||
13 | use Test::More; | |
14 | use English qw(-no_match_vars); | |
15 | ||
16 | eval "use Test::Perl::Critic"; | |
17 | plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; | |
18 | Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; | |
19 | all_critic_ok(); |
0 | ||
1 | BEGIN { | |
2 | unless ($ENV{AUTHOR_TESTING}) { | |
3 | require Test::More; | |
4 | Test::More::plan(skip_all => 'these tests are for testing by the author'); | |
5 | } | |
6 | } | |
7 | ||
8 | use strict; | |
9 | use warnings; | |
10 | ||
11 | # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18 | |
12 | ||
13 | use Test::More 0.88; | |
14 | use Test::EOL; | |
15 | ||
16 | my @files = ( | |
17 | 'lib/HTML/FormFu/Constraint/DBIC/Unique.pm', | |
18 | 'lib/HTML/FormFu/Model/DBIC.pm', | |
19 | 't/constraints/dbic_unique.t', | |
20 | 't/constraints/dbic_unique.yml', | |
21 | 't/constraints/dbic_unique_column.yml', | |
22 | 't/constraints/dbic_unique_id_field.yml', | |
23 | 't/constraints/dbic_unique_method.yml', | |
24 | 't/constraints/dbic_unique_others.yml', | |
25 | 't/constraints/dbic_unique_repeatable_id_field.t', | |
26 | 't/constraints/dbic_unique_repeatable_id_field.yml', | |
27 | 't/create/basic.t', | |
28 | 't/create/basic.yml', | |
29 | 't/default_values/basic.t', | |
30 | 't/default_values/basic.yml', | |
31 | 't/default_values/basic_nested.t', | |
32 | 't/default_values/basic_nested.yml', | |
33 | 't/default_values/belongs_to_lookup_table.t', | |
34 | 't/default_values/belongs_to_lookup_table.yml', | |
35 | 't/default_values/belongs_to_lookup_table_combobox.t', | |
36 | 't/default_values/belongs_to_lookup_table_combobox.yml', | |
37 | 't/default_values/empty_rows_zero.t', | |
38 | 't/default_values/empty_rows_zero.yml', | |
39 | 't/default_values/has_many_combobox.t', | |
40 | 't/default_values/has_many_combobox.yml', | |
41 | 't/default_values/has_many_repeatable.t', | |
42 | 't/default_values/has_many_repeatable.yml', | |
43 | 't/default_values/has_many_repeatable_delete_true.t', | |
44 | 't/default_values/has_many_repeatable_delete_true.yml', | |
45 | 't/default_values/has_many_repeatable_label.t', | |
46 | 't/default_values/has_many_repeatable_label.yml', | |
47 | 't/default_values/has_many_repeatable_nested.t', | |
48 | 't/default_values/has_many_repeatable_nested.yml', | |
49 | 't/default_values/has_many_repeatable_new.t', | |
50 | 't/default_values/has_many_repeatable_new.yml', | |
51 | 't/default_values/has_many_select.t', | |
52 | 't/default_values/has_many_select.yml', | |
53 | 't/default_values/has_one.t', | |
54 | 't/default_values/has_one.yml', | |
55 | 't/default_values/has_one_nested.t', | |
56 | 't/default_values/has_one_nested.yml', | |
57 | 't/default_values/label.t', | |
58 | 't/default_values/label.yml', | |
59 | 't/default_values/many_to_many-has_many.t', | |
60 | 't/default_values/many_to_many-has_many.yml', | |
61 | 't/default_values/many_to_many_checkboxgroup.t', | |
62 | 't/default_values/many_to_many_checkboxgroup.yml', | |
63 | 't/default_values/many_to_many_repeatable.t', | |
64 | 't/default_values/many_to_many_repeatable.yml', | |
65 | 't/default_values/many_to_many_repeatable_nested.t', | |
66 | 't/default_values/many_to_many_repeatable_nested.yml', | |
67 | 't/default_values/many_to_many_repeatable_new.t', | |
68 | 't/default_values/many_to_many_repeatable_new.yml', | |
69 | 't/default_values/many_to_many_select.t', | |
70 | 't/default_values/many_to_many_select.yml', | |
71 | 't/default_values/many_to_many_select_nested.t', | |
72 | 't/default_values/many_to_many_select_nested.yml', | |
73 | 't/default_values/methods.t', | |
74 | 't/default_values/methods.yml', | |
75 | 't/default_values/might_have.t', | |
76 | 't/default_values/might_have.yml', | |
77 | 't/default_values/might_have_missing.t', | |
78 | 't/default_values/multi_label.t', | |
79 | 't/default_values/multi_label.yml', | |
80 | 't/default_values/nested_name_accessor.t', | |
81 | 't/default_values/nested_name_accessor.yml', | |
82 | 't/default_values/opt_accessor.t', | |
83 | 't/default_values/opt_accessor.yml', | |
84 | 't/default_values/opt_accessor_nested.t', | |
85 | 't/default_values/opt_accessor_nested.yml', | |
86 | 't/lib/DBICTestLib.pm', | |
87 | 't/lib/HTMLFormFu/I18N.pm', | |
88 | 't/lib/HTMLFormFu/I18N/en.pm', | |
89 | 't/lib/HTMLFormFu/MockContext.pm', | |
90 | 't/lib/MySchema.pm', | |
91 | 't/lib/MySchema/Address.pm', | |
92 | 't/lib/MySchema/Band.pm', | |
93 | 't/lib/MySchema/HasMany.pm', | |
94 | 't/lib/MySchema/ManagedBand.pm', | |
95 | 't/lib/MySchema/Manager.pm', | |
96 | 't/lib/MySchema/Master.pm', | |
97 | 't/lib/MySchema/Note.pm', | |
98 | 't/lib/MySchema/Schedule.pm', | |
99 | 't/lib/MySchema/Task.pm', | |
100 | 't/lib/MySchema/TwoNote.pm', | |
101 | 't/lib/MySchema/Type.pm', | |
102 | 't/lib/MySchema/Type2.pm', | |
103 | 't/lib/MySchema/User.pm', | |
104 | 't/lib/MySchema/UserBand.pm', | |
105 | 't/lib/MySchemaRS/User.pm', | |
106 | 't/options_from_model/belongs_to.t', | |
107 | 't/options_from_model/belongs_to.yml', | |
108 | 't/options_from_model/belongs_to_combobox.t', | |
109 | 't/options_from_model/belongs_to_combobox.yml', | |
110 | 't/options_from_model/belongs_to_config_zero.t', | |
111 | 't/options_from_model/belongs_to_config_zero.yml', | |
112 | 't/options_from_model/belongs_to_config_zero_combobox.t', | |
113 | 't/options_from_model/belongs_to_config_zero_combobox.yml', | |
114 | 't/options_from_model/belongs_to_localize_label.t', | |
115 | 't/options_from_model/belongs_to_localize_label.yml', | |
116 | 't/options_from_model/condition_from_stash.t', | |
117 | 't/options_from_model/condition_from_stash.yml', | |
118 | 't/options_from_model/condition_from_stash_combobox.t', | |
119 | 't/options_from_model/condition_from_stash_combobox.yml', | |
120 | 't/options_from_model/condition_from_stash_combobox_complex.t', | |
121 | 't/options_from_model/condition_from_stash_complex.t', | |
122 | 't/options_from_model/constraint_autoset.t', | |
123 | 't/options_from_model/constraint_autoset.yml', | |
124 | 't/options_from_model/enum_select.t', | |
125 | 't/options_from_model/enum_select.yml', | |
126 | 't/options_from_model/has_many_repeatable_select.t', | |
127 | 't/options_from_model/has_many_repeatable_select.yml', | |
128 | 't/options_from_model/many_to_many_select.t', | |
129 | 't/options_from_model/many_to_many_select.yml', | |
130 | 't/options_from_model/many_to_many_select_restricted.t', | |
131 | 't/options_from_model/many_to_many_select_restricted.yml', | |
132 | 't/update/add_valid.t', | |
133 | 't/update/basic.yml', | |
134 | 't/update/basic_create.t', | |
135 | 't/update/basic_update.t', | |
136 | 't/update/belongs_to.t', | |
137 | 't/update/belongs_to_combobox.t', | |
138 | 't/update/belongs_to_create.t', | |
139 | 't/update/belongs_to_create_required.t', | |
140 | 't/update/belongs_to_lookup_table_combobox.t', | |
141 | 't/update/belongs_to_lookup_table_combobox.yml', | |
142 | 't/update/belongs_to_select.t', | |
143 | 't/update/belongs_to_select.yml', | |
144 | 't/update/belongs_to_select_two.yml', | |
145 | 't/update/column_without_field.t', | |
146 | 't/update/column_without_field.yml', | |
147 | 't/update/has_many_repeatable.t', | |
148 | 't/update/has_many_repeatable.yml', | |
149 | 't/update/has_many_repeatable_delete_true.t', | |
150 | 't/update/has_many_repeatable_delete_true.yml', | |
151 | 't/update/has_many_repeatable_many_new.t', | |
152 | 't/update/has_many_repeatable_many_new.yml', | |
153 | 't/update/has_many_repeatable_many_new_exceed_max.t', | |
154 | 't/update/has_many_repeatable_new.t', | |
155 | 't/update/has_many_repeatable_new.yml', | |
156 | 't/update/has_many_repeatable_new_date.t', | |
157 | 't/update/has_many_repeatable_new_date.yml', | |
158 | 't/update/has_many_repeatable_new_dependon.t', | |
159 | 't/update/has_many_repeatable_new_dependon.yml', | |
160 | 't/update/has_many_repeatable_new_empty.t', | |
161 | 't/update/has_many_repeatable_new_implicit.t', | |
162 | 't/update/has_many_repeatable_new_implicit.yml', | |
163 | 't/update/has_many_repeatable_new_required_when.t', | |
164 | 't/update/has_many_repeatable_new_required_when.yml', | |
165 | 't/update/has_one.t', | |
166 | 't/update/has_one.yml', | |
167 | 't/update/has_one_create.t', | |
168 | 't/update/has_one_no_id.t', | |
169 | 't/update/has_one_no_id.yml', | |
170 | 't/update/has_one_select.t', | |
171 | 't/update/has_one_select.yml', | |
172 | 't/update/ignore_if_empty.t', | |
173 | 't/update/ignore_if_empty.yml', | |
174 | 't/update/many_to_many-has_many.t', | |
175 | 't/update/many_to_many_checkboxgroup.t', | |
176 | 't/update/many_to_many_checkboxgroup.yml', | |
177 | 't/update/many_to_many_checkboxgroup_read_only.t', | |
178 | 't/update/many_to_many_checkboxgroup_read_only.yml', | |
179 | 't/update/many_to_many_checkboxgroup_restricted.t', | |
180 | 't/update/many_to_many_checkboxgroup_restricted.yml', | |
181 | 't/update/many_to_many_checkboxgroup_unselected.t', | |
182 | 't/update/many_to_many_repeatable.t', | |
183 | 't/update/many_to_many_repeatable.yml', | |
184 | 't/update/many_to_many_repeatable_new.t', | |
185 | 't/update/many_to_many_repeatable_new.yml', | |
186 | 't/update/many_to_many_select.t', | |
187 | 't/update/many_to_many_select.yml', | |
188 | 't/update/many_to_many_select_additive.yml', | |
189 | 't/update/many_to_many_select_unselected.t', | |
190 | 't/update/methods.t', | |
191 | 't/update/methods.yml', | |
192 | 't/update/might_have.t', | |
193 | 't/update/might_have.yml', | |
194 | 't/update/might_have_create.t', | |
195 | 't/update/might_have_delete_if_empty.t', | |
196 | 't/update/might_have_delete_if_empty.yml', | |
197 | 't/update/nested.yml', | |
198 | 't/update/nested_create.t', | |
199 | 't/update/nested_create_checkbox.t', | |
200 | 't/update/nested_name_accessor.t', | |
201 | 't/update/nested_repeatable_write.t', | |
202 | 't/update/nested_repeatable_write.yml', | |
203 | 't/update/null_if_empty.t', | |
204 | 't/update/null_if_empty.yml', | |
205 | 't/update/opt_accessor.t', | |
206 | 't/update/opt_accessor.yml', | |
207 | 't/update/opt_accessor_nested.t', | |
208 | 't/update/opt_accessor_nested.yml', | |
209 | 't/update/unchecked_not_null_checkbox.t', | |
210 | 't/x_roundtrip/checkbox.yml', | |
211 | 't/x_roundtrip/checkbox_false2true.t', | |
212 | 't/x_roundtrip/checkbox_true2false.t' | |
213 | ); | |
214 | ||
215 | eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; | |
216 | done_testing; |
0 | #!perl | |
1 | ||
2 | BEGIN { | |
3 | unless ($ENV{AUTHOR_TESTING}) { | |
4 | require Test::More; | |
5 | Test::More::plan(skip_all => 'these tests are for testing by the author'); | |
6 | } | |
7 | } | |
8 | ||
9 | # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. | |
10 | use strict; use warnings; | |
11 | use Test::More; | |
12 | use Test::Pod 1.41; | |
13 | ||
14 | all_pod_files_ok(); |
0 | use strict; | |
1 | use warnings; | |
2 | use Test::More tests => 4; | |
3 | ||
4 | use HTML::FormFu; | |
5 | use lib 't/lib'; | |
6 | use DBICTestLib 'new_schema'; | |
7 | use MySchema; | |
8 | my $form = HTML::FormFu->new; | |
9 | ||
10 | $form->load_config_file('t/options_from_model/condition_from_stash.yml'); | |
11 | ||
12 | my $schema = new_schema(); | |
13 | ||
14 | $form->stash->{schema} = $schema; | |
15 | ||
16 | my $master_rs = $schema->resultset('Master'); | |
17 | my $user_rs = $schema->resultset('User'); | |
18 | ||
19 | { | |
20 | my $m1 = $master_rs->create({ text_col => 'foo' }); | |
21 | ||
22 | $m1->create_related( 'user', { name => 'a' } ); | |
23 | $m1->create_related( 'user', { name => 'b' } ); | |
24 | $m1->create_related( 'user', { name => 'c' } ); | |
25 | } | |
26 | ||
27 | { | |
28 | my $m2 = $master_rs->create({ text_col => 'bar' }); | |
29 | ||
30 | $m2->create_related( 'user', { name => 'd' } ); | |
31 | $m2->create_related( 'user', { name => 'e' } ); | |
32 | $m2->create_related( 'user', { name => 'f' } ); | |
33 | $m2->create_related( 'user', { name => 'g' } ); | |
34 | ||
35 | $form->stash->{foo}{bar}[0] = $m2->id; | |
36 | } | |
37 | ||
38 | $form->stash->{schema} = $schema; | |
39 | $form->stash->{master_id} = {'!=' => '2' }; | |
40 | $form->process; | |
41 | ||
42 | { | |
43 | my $option = $form->get_field('user')->options; | |
44 | ||
45 | ok( @$option == 3 ); | |
46 | ||
47 | is( $option->[0]->{label}, 'a' ); | |
48 | is( $option->[1]->{label}, 'b' ); | |
49 | is( $option->[2]->{label}, 'c' ); | |
50 | } | |
51 |
0 | --- | |
1 | auto_fieldset: 1 | |
2 | ||
3 | elements: | |
4 | - type: Select | |
5 | name: user | |
6 | model_config: | |
7 | resultset: User | |
8 | condition_from_stash: | |
9 | master: foo.bar.0 | |
10 | expand_stash_dots: 1 |
0 | #!perl | |
1 | ||
2 | BEGIN { | |
3 | unless ($ENV{RELEASE_TESTING}) { | |
4 | require Test::More; | |
5 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); | |
6 | } | |
7 | } | |
8 | ||
9 | # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. | |
10 | ||
11 | use Test::CPAN::Meta; | |
12 | ||
13 | meta_yaml_ok(); |
0 | ||
1 | BEGIN { | |
2 | unless ($ENV{RELEASE_TESTING}) { | |
3 | require Test::More; | |
4 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); | |
5 | } | |
6 | } | |
7 | ||
8 | # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 | |
9 | use strict; | |
10 | use warnings; | |
11 | use Test::More 0.88; | |
12 | use Test::Kwalitee 1.21 'kwalitee_ok'; | |
13 | ||
14 | kwalitee_ok(); | |
15 | ||
16 | done_testing; |
0 | ||
1 | BEGIN { | |
2 | unless ($ENV{RELEASE_TESTING}) { | |
3 | require Test::More; | |
4 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); | |
5 | } | |
6 | } | |
7 | ||
8 | use strict; | |
9 | use warnings; | |
10 | ||
11 | # this test was generated with Dist::Zilla::Plugin::Test::PAUSE::Permissions 0.003 | |
12 | ||
13 | use Test::More; | |
14 | BEGIN { | |
15 | plan skip_all => 'Test::PAUSE::Permissions required for testing pause permissions' | |
16 | if $] < 5.010; | |
17 | } | |
18 | use Test::PAUSE::Permissions; | |
19 | ||
20 | all_permissions_ok(); |
0 | use 5.006; | |
1 | use strict; | |
2 | use warnings; | |
3 | ||
4 | # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 | |
5 | ||
6 | use Test::More; | |
7 | ||
8 | plan tests => 3; | |
9 | ||
10 | my @module_files = ( | |
11 | 'HTML/FormFu/Constraint/DBIC/Unique.pm', | |
12 | 'HTML/FormFu/Model/DBIC.pm' | |
13 | ); | |
14 | ||
15 | ||
16 | ||
17 | # no fake home requested | |
18 | ||
19 | my @switches = ( | |
20 | -d 'blib' ? '-Mblib' : '-Ilib', | |
21 | ); | |
22 | ||
23 | use File::Spec; | |
24 | use IPC::Open3; | |
25 | use IO::Handle; | |
26 | ||
27 | open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; | |
28 | ||
29 | my @warnings; | |
30 | for my $lib (@module_files) | |
31 | { | |
32 | # see L<perlfaq8/How can I capture STDERR from an external command?> | |
33 | my $stderr = IO::Handle->new; | |
34 | ||
35 | diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } | |
36 | $^X, @switches, '-e', "require q[$lib]")) | |
37 | if $ENV{PERL_COMPILE_TEST_DEBUG}; | |
38 | ||
39 | my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); | |
40 | binmode $stderr, ':crlf' if $^O eq 'MSWin32'; | |
41 | my @_warnings = <$stderr>; | |
42 | waitpid($pid, 0); | |
43 | is($?, 0, "$lib loaded ok"); | |
44 | ||
45 | shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ | |
46 | and not eval { +require blib; blib->VERSION('1.01') }; | |
47 | ||
48 | if (@_warnings) | |
49 | { | |
50 | warn @_warnings; | |
51 | push @warnings, @_warnings; | |
52 | } | |
53 | } | |
54 | ||
55 | ||
56 | ||
57 | is(scalar(@warnings), 0, 'no warnings found') | |
58 | or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ); | |
59 | ||
60 |
0 | #!perl | |
1 | ||
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; | |
6 | all_critic_ok(); |
0 | use strict; | |
1 | use warnings; | |
2 | ||
3 | # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 | |
4 | ||
5 | use Test::More 0.88; | |
6 | use Test::EOL; | |
7 | ||
8 | my @files = ( | |
9 | 'lib/HTML/FormFu/Constraint/DBIC/Unique.pm', | |
10 | 'lib/HTML/FormFu/Model/DBIC.pm' | |
11 | ); | |
12 | ||
13 | eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; | |
14 | done_testing; |
0 | #!perl | |
1 | # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. | |
2 | use strict; use warnings; | |
3 | use Test::More; | |
4 | use Test::Pod 1.41; | |
5 | ||
6 | all_pod_files_ok(); |
0 | #!perl | |
1 | # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. | |
2 | ||
3 | use Test::CPAN::Meta; | |
4 | ||
5 | meta_yaml_ok(); |
0 | # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 | |
1 | use strict; | |
2 | use warnings; | |
3 | use Test::More 0.88; | |
4 | use Test::Kwalitee 1.21 'kwalitee_ok'; | |
5 | ||
6 | kwalitee_ok(); | |
7 | ||
8 | done_testing; |
0 | use strict; | |
1 | use warnings; | |
2 | ||
3 | # this test was generated with Dist::Zilla::Plugin::Test::PAUSE::Permissions 0.003 | |
4 | ||
5 | use Test::More; | |
6 | BEGIN { | |
7 | plan skip_all => 'Test::PAUSE::Permissions required for testing pause permissions' | |
8 | if $] < 5.010; | |
9 | } | |
10 | use Test::PAUSE::Permissions; | |
11 | ||
12 | all_permissions_ok(); |