You can override _fs_column_dir to provide directory tree nesting
however you like. I would still like to make this a config option,
somehow, but this is a start.
Hi Marc,
I think your code covers everything. Well, actually there is one more
thing:
It would be great if one could specify a column which takes care of
storing the file extension. If such a column is present the filename
should contain this file extension. This is useful if you deliver
these files using a webserver which needs to know which MIME type
to send and guesses that from the file extension.
example:
__PACKAGE__->add_columns(
id => {
data_type => 'INT',
is_auto_increment => 1,
},
file => {
data_type => 'TEXT',
is_fs_column => 1,
fs_column_path => '/var/lib/myapp/myfiles',
},
extension => {
data_type => 'TEXT',
is_fs_extension => 1,
},
);
Another improvement I'd suggest is to handle the generation of the
filename with external modules like
http://search.cpan.org/perldoc?DBIx::Class::UUIDColumns does it.
And to be even more flexible you could factor out the generation
of the directories as external modules.
If you need any help with that I can contribute some code.
Aout the name: InflateColumn::File::Advanced/Turbo/Awesome/Extended
or something :-)
greets,
moritz
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]