Re: [Catalyst] Re: CMS

2007-09-26 Thread Matt Rosin
Andreas,
Thank you very much for the reply! I will check it out.
I wonder why not in CPAN or catalystframework.org.
Matt
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] + in GET param

2007-09-11 Thread Matt Rosin
I wonder if this is similar to something bug I saw a few months ago.
I tried to pass a GET url into a TT2 field but the question mark in the url
kept getting url-encoded to %3F. I was wondering if it was a Unicode
problem, but it may have been wrong url_for syntax.

Here is a snippet from the old code before I solved the problem (the chr
didn't work IIRC).

my $qm = chr(63); # my terminal can't print a question mark in utf8 it makes
a hex code %3F!
  $c-stash-{prevpageurl} =
$c-uri_for(/admin/admin_portal_transactions_list.$qm.page=$prevpagecollapsed=$collapsed);


IIRC I was unable to solve the problem using the stash, and possibly I also
tried uri_for then.
Finally I solved it by converting the function to pass parameters as virtual
folders in the url path.

However yes I just tried what Miyagawa-san had and did it with a TT template
too. It works fine with url_for.

Matt R.
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] TT and UNICODE: Garbled special characters

2007-09-05 Thread Matt Rosin
Have you tried setting shell locale to utf8? A long time ago there
were utf8 in tt threads but I haven't had trouble myself.
However I have indeed had massive trouble trying to get a simple
question mark (a GET url) to print that I put in the stash, like you
are doing now, because tt would url-encode it.
So my recommendation is, don't give it an umlaut. :)
FYI the trouble came when I was using xemacs -nw in utf8 mode due to
the default shell of the remote session being in utf8 locale, which I
was not used to. Not that emacs is amazing at utf\d+ .
Perhaps starting a utf8 terminal session to be sure, will help. There
are so many transparent re-encodings going on this is hard to trace
outside your environment.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-09-03 Thread Matt Rosin
Here is the Korean error message, from a native with whom I work.
It should show up as Hangul characters in your browser.
(kr) 나중에 오세요.

Matt Rosin
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?

2007-09-03 Thread Matt Rosin
Great, thanks Matt.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Attribute::Handlers wont work in own classes under catalyst

2007-08-31 Thread Matt Rosin
Brian said you were reinventing Moose.. if so then maybe you have the
same problem with attributes in Catalyst as mentioned in
Moose::Cookbook::WTF (Why don't inherited attributes work). Of course
you don't have Moose' extends statement...

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (en) error screen translations

2007-08-31 Thread Matt Rosin
Some have periods and some don't.
Is French SVP really polite compared to s'il vous plait (circonflex on
i I believe)?
be fi se etc. missing, perhaps not many European catalysts?

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: [Catalyst-dev] Ignoring Emacs temp files

2007-08-29 Thread Matt Rosin
Ouch. I use xemacs -nw and FindBin but haven't seen this explosion, I
think. What autodiscovery are you using that makes it require
Foo:::#Bar ?

 blows up when it tries to do something like:  eval require Foo::.#Bar

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] About output in a browser

2007-08-29 Thread Matt Rosin
FWIW I recently used keywords in TT template filenames to identify
which CSS file to use (public,admin portal, customer portal, etc.).
But the default wrapper (root/lib/site/wrapper) will use text/plain if
the filename has css|js|txt in it.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] CMS

2007-08-27 Thread Matt Rosin
Dear Matt,

Wow, you have blown me away again. So many things on the wishlist
already executed. Whew!

I had trouble finding Reaction code/docs - is it in prealpha or
actually production grade now?

I haven't used Moose before (silly me..) after reading a few
presentations I'm very impressed.

Re svk I was thinking of something for a nontechnical client, but I'll
look at svk interfaces available, thanks.

I'm not sure if I can provide a full download of the entire site as it
could give a competitor an advantage, but the portal side templates
and code I see as something that would evolve across many projects so
putting templates and modules for those portals into a tgz would be
okay. Of course then you want to start cleaning things.. for example I
have a toggle that ought to use a gif like gmail's star or a flag but
never got to that, also to refactor a little.. well we'll see I may
just say here it is and let it be torn apart.

I'd like to find out more about Reaction and how much is useable now,
where its HP/wiki is etc. Thank you very much.
Matt

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?

2007-08-27 Thread Matt Rosin
I'm curious. I was asked to clone an existing catalyst system so a
different database would be used depending on the url. Doesn't seem
like a good idea unless it is a completely separate code base...

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] CMS

2007-08-27 Thread Matt Rosin
 I'd love to see the code publically, even if it isn't re-used it's instructive
 to see how other people do it.

I'm moving a bunch of sites to a couple new hosting companies and will
do this when I get the domain moved.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] CMS

2007-08-24 Thread Matt Rosin
Catalyst::Plugin::I18N::DBIC (and Mango::Catalyst::Plugin::I18N) is
maybe a crosscutting thing like Zbigniew mentions with some useful
concepts.

I'm not looking to build Drupal or a blog platform but I have nothing
against them per se. I was thinking more of a tool to reduce the
amount of Catalyst code I type by identifying patterns.

For example:
- A multiuser pattern in which a site is separated into public, admin
and registered user portals (of which the latter two need to edit lots
of pesky data like their profiles, their virtual holdings like
coupons/listings/catalogs/resumes/banners//video clips, etc.).
Currently I would do this with a formbuilder form, view and save subs,
and TT template for each page.
- Another pattern might be to get one or a list of objects a user
owns, make a list of them and create an interface allowing them to
edit and save the data. We all keep reinventing the wheel with this.
Currently I would look at similar subs I'd made and well reinvent the wheel...

I have 3 ideas at the moment.

1a. A standard object editor with rich editor and maybe some widgets.
It would render a complex form as necessary, given the object to be
edited. I once wrote something like this that would just let you edit
object data fields with text input boxes, it's not rocket science.
1b. Online asset manager to CRUD them, with a file upload widget might
also be nice.

2a. Reduce the set of all information assets a user owns into a single
tree that may span many tables, allowing each asset (object, data
field, etc.) to be called from templates by name (could use namespaces
and dot notation maybe). This is probably most useful in the context
of having a tree of all text snippets, etc. used in display of the
public site.
2b. This reduces templates to a list of assets (snippets) called by
name interspersed with HTML tags and TT directives. Text snippets
would reside in a database and could be edited in a CMS, at least like
the utility of 1a/b above. Image pathnames or a single DIV's HTML
could also all be stored in the db. The template would just pull the
snippets out with a simple $c method like loc in the above I18N
modules. A standard facility for editing these things (a module and TT
templates) would also be useful.

3. Beyond this, I see an awful lot of programming and design going
into solving similar basic interface problems over and over. It would
be useful to provide some basic TT layouts and scripted user
interactions (I don't mean write perl script, I mean just write the
basic plot, preferably as an interpreted string of text but even yaml
could be used).  Currently we sometimes reuse templates (for example I
have a general modal dialog), but we don't really have smart systems
that DWIM the user interaction for basic data editing. For one thing,
we all look at each other's public sites but not the admin or user
portal pages which could require more programming work. Contributing
to solving repeated patterns once well will make Catalyst even more
powerful I think. A repository of such interface snippets (combination
of TT code, perl code, etc.) could be run on the dev site maybe.  At
the risk of sounding like I'm all talk I'm willing to provide my
current admin and customer portals to the project, possibly the TT
templates would be useful. Anyway they do look a little like the
Catalyst startup page. :)

Um, that was a bit long, sorry!

Regards,

Matt Rosin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] New website using Catalyst

2007-08-23 Thread Matt Rosin
Hi,
It's a very attractive site! Wonderful. What things did you use YUI for?
Matt R.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] CMS

2007-08-23 Thread Matt Rosin
Catalyst makes it easy to build a site with lots of little modules of
content composing a single page - the actual content (words/images)
being scattered in static apache directories, the database, the
templates folders and the code. At some point a content management
system of some type is needed.

While I hand-roll this sort of thing now it might be nice to have a
standard module with perhaps a rich editor and HTML form, or it might
be more powerful with the ability to manage various stories/images on
disk or db, and integrate uploads even, like some of the portal
building systems do. Perhaps one integrated well with Catalyst could
also allow the user to select template files to use in a given part of
the screen to replace not just on a story basis but on a div basis.

I'd just like to ask if anyone uses a CMS (beyond just hand-rolling
for each instance) or has been seeing similar needs. I think much
development time is spent on creating object management interfaces
which perhaps could be boiled down to some repetitive functionality.

Matt Rosin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: CMS

2007-08-23 Thread Matt Rosin
Incidentally the dev site does list something called EasyCMS but I
read somewhere that it is defunct and won't work with current version
of Catalyst. Obviously lots of people have thought about this..
Matt Rosin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Hosting

2007-08-12 Thread Matt Rosin
Thank you everyone for your information on hosting companies. (And
that new wiki page is cool, though needs comments from people now.)

I decided to take a two pronged approach: cheap low priority storage
at a shared host plus a fanatical developer-loving vps host.

So I signed up at hostgator.com for their Baby package, $10/mo. with
the first free from a coupon. This is 100GB and a terabyte of
bandwidth, for a couple family sites and to serve video content
perhaps.

For the VPS host I am deciding between linode and slicehost, I'd start
with 10GB.

Slicehost is a 5 week wait, or 2 weeks if you pay 6 months up front.
It sounds quite cool, heck I want it bad, but  from a place that says
no initial payment it give me a funny feeling. I mean, I used to run a
hosting company myself (in 1995, Tokyo) so I know what they mean when
they mention cashflow and hardware. They probably will have great
service since that is their main thing, and I hope Google or somebody
smart invests in them. There must be some rich hackers in the
vicinity.

It was not clear from either linode or slicehost what tools are
recommended for ordinary operations. A graphic login might have too
much latency from here. Perhaps webmin.. what I mean is root is fine
for apache configs but some things I'd like to use a web interface for
example to quickly change user email aliasing or whatever, if it's
plesk or whm or HSPComplete or webmin, fine. I suppose some examples
of common administration would be useful, they both mention custom
interfaces but I can't tell what.

Linode though has a he.com data center which means I can shave
50-100ms off latency to Japan if I pick them so I am leaning toward
them.for the catalyst vps... though I am wondering if slicehost has
the more advanced infrastructure, and maybe linode has more
handholding? Tough call, maybe should get both? I like slicehost's
attitude and their extra backup service, but also I've been watching
Hurricaine Electric for a long time so ++ for linode. At any rate
there has to be something said for any company that can get you
running the next day.. I already have 100GB now at hostgator even if
it is a cpanel site, and I don't know if I trust their hard disks to
stay up, but they do seem to have most positive reviews at
webhostingunleashed among shared hosts. Oh well, more agonizing to do
now but now I can enjoy it in a bittersweet way thanks to all of you.

Regards to all,

Matt Rosin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst hosting: the wiki page

2007-08-11 Thread Matt Rosin
That's very cool.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst Hosting

2007-08-09 Thread Matt Rosin
Thanks. Asmallorange looks like they don't give you so much disk
space.. though I like their style and am inclined to learn more.
However this month Dreamhost's monster package is cheap. What to do,
what to do. Hostgator's Swamp shared is looking good now.. they also
offered me an unlisted $75 dedicated server. Dreamhost has dedicated
from below 70..

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] output to tt2 and pdf

2007-08-08 Thread Matt Rosin
 http://search.cpan.org/~andrewf/Template-Latex-2.17/lib/Template/Plugin/Latex.pm

 TT can make PDFs too.

I also crawled cpan thinking there might be a magic Catalyst View. The
above looks very nice and powerful though of course requires that you
write in latex. This is of course not a big problem but I was
wondering if anyone has used PDF::Reuse with TT. For example if you
drew a PDF form in OpenOffice Writer, and printed it as a PDF, it is
my impression anyway that you could then use it as a very fast
precompiled form (well maybe the latex plugin is also precompiling I'd
presume).

I'm actually curious also since I was examining latex and other
options (inkscape?) to make a system to generate professional looking
restaurant menus for my sister's restaurant www.michaelsonthehill.com
for example the current summer menu I made in OpenOffice and printed
as a PDF. And I have another client with a PDF order form..

Anyway I will look more at the latex module too. However I may not be
able to use latex on the server I will be renting. Hm time to start
another thread..

Regards,

Matt Rosin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst Hosting

2007-08-08 Thread Matt Rosin
Hello,

I remember somewhere catalyst-friendly hosting. I'm looking for a new
hosting company. I don't relish using catalyst without root access,
having built it once locally, especially since I don't want to have to
ask the company every time to edit the apache config for me.

1. Has anyone got a good one. I'm thinking of trying a Swamp acct on
HostGator temporarily (around $20) and maybe upgrading to a VPS or
tiny dedicated server later on for about $60-70. I had a VPS at a very
bad hosting company I have to get rid of now. Anyway I understand you
can't do things like ffmpeg with a shared account there so probably a
pain to install other things. I'd probably use fastcgi I think.

2. Is it possible to do all the apache configs needed for running
catalyst (fastcgi, or mod_perl) in a config file in my own public_html
directory I wonder. Or does everyone running catalyst as a normal user
emailing their ISP admin to configure apache every time they write a
new app? Yes I know just get a root account is the answer but I'd like
to know.

Thanks,

Matt

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Subject lines?

2007-07-25 Thread Matt Rosin
Hello everyone on this wonderful List,

I have long hesitated to ask this question at the risk of lowering the signal 
to noise ratio on this list. Now seems like a good time to ask and not 
runawayscreamingfrom long long long posts. I will think of them just as a diff 
to patch my brain with. Yes.

So teh question. Or T3H ZQU3410N for those on teletypes.

Is it just me or does everyone getting this digest realize, but politely 
ignore, that every post fails to start with the post id, subject line and 
author which otherwise is listed at the very top of the digest mail? 
Because I once sent an email to someone by accident through this list (you know 
who are, sorry again) because I mistakenly used the email address in the sig of 
the previous post due to this nondelimitation (which I temporarily declare is a 
word).

It's okay if you like it that way though just pleasantly confusing.

TH4NX!

Matt Rosin


   
Ready
 for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Project Opportunity, paid gig

2007-06-20 Thread Matt Rosin
To Paul Henrich,

Hi, I'm interested but your email address is doesn't come through the mailing 
list.

Matt Rosin
mattrosin AT yahoo DOTCOM


   

Get the free Yahoo! toolbar and rest assured with the added security of spyware 
protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: plat_forms report published on June 20th. 2007.

2007-06-20 Thread Matt Rosin
Posted it to perlmonks.org.
--Matt R.


  

Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Template creates objects via belongs_to autovivification

2007-06-13 Thread Matt Rosin
Hello,

I discovered an interesting bug/feature, in which a template seems to be 
executing an SQL insert without that being intended or even visible in the 
code! I think it's worth explaining exactly what's going on so please pardon 
the length.

In my Apache/FastCGI/Catalyst/MySQL/TT/DBIx::Class application (called CatMgr) 
I have Customer and Transaction objects. An admin portal shows a list of recent 
transactions, which are created when an Instant Payment Notification from 
PayPal says a payment was made. 

Anyway, the transaction table has a field called customer storing the ID of a 
record in the customer table. I specify the relation ORMwise in 
CatMgrDB/Transaction.pm with:
__PACKAGE__-belongs_to( customer = CatMgrDB::Customer );

I decided to be clever (boom) and get the template, which is only handed a 
resultset with rows from the transaction table, to look up the company name of 
the associated Customer (r.customer.b_company, where r is a row in the 
resultset) and not have to make a more complicated search statement in the 
controller.

The thing is, then I decided to let admins add new transactions without an 
associated customer, to record in the database transactions that were made 
offline. Instead of assigning r.customer to the id of the company running the 
system I just say 0 (not using nulls). What happens is, somehow the template 
forces Catalyst (DBIx::Class) to create a NEW CUSTOMER if there wasn't one 
already. This is bad, bad, bad. Every time an admin views the list of 
transactions, it seems I get 4 blank customer records silently added 
simultaneously, or maybe even more, depending on what kind of records are shown 
on the current page it seems. I discovered this by matching the FastCGI error 
log (which is where the -Debug output goes.. all 300MB of it...) against the 
modification date of the new customer records.

It seems like I need a cascading_inserts = 0 style attribute here, though I 
can hack around it but I would like to know what the right way to deal with 
this. If I can leave the code as is and toggle a single attribute (maybe I 
should remove that belongs_to or convert it to a might_have?) that would be 
nice. It seems to be an easy pitfall. I can't find any documentation about a 
relation forcing objects to autovivify, it seems like a bug. Can anyone comment 
on this?

Thanks,

Matt


   

Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Template creates objects via belongs_to autovivification

2007-06-13 Thread Matt Rosin
Hi, thanks for your comment. But,

1. I use NOT_NULL so my program has less opportunity to ever crash :) no really 
I saw DBIxC crash in the past I'm pretty sure though cannot document now, 
perhaps the calling a method on a nonexistent object error... I would prefer it 
to say 0 than to crash. Perhaps other people have smarter ways to improve 
robustness...

2. At any rate, I do not think it is doing the right thing, regardless. It is a 
bug if you cannot test for whether the related object exists, and when an SQL 
insert is generated on another table. In particular I think this is happening 
mainly during interpretation of TT2's dot notation. I would expect 
$mytransaction-customer-b_company not to create a Customer object in the db 
too. Am I wrong in this? So should I either allow NULL in transaction.customer 
or else use might_have? The might_have docs suggest cascading updates too...

Matt


  

Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Re: Template creates objects via belongs_to

2007-06-13 Thread Matt Rosin
Hi!

Thank you very much for your help.

My response to your initial comments is Ahah. I see. Allow me to clarify the 
business logic as you recommend.

1. A customer may be associated with many transactions, or none at all.
2. A transaction can be associated with only a single customer, or no customer 
at all.
3. A transaction is either created automatically, in response to verification 
of an incoming IPN (linked to a preexisting customer), or the Admin can create 
a blank transaction to be edited later for legacy bookkeeping.

The system is running now at www.thecommunitypage.com which is a site showing 
business listings that allows customers to purchase ads and paid listings with 
automatic fulfillment. When a payment is made, a record of the transaction is 
created, and based on the product they bought from the sales catalog, a package 
associated with 0 or more listings are also created. Transactions, packages and 
listings all know the customer who owns them. (White pages listings have no 
package).

Regarding your note about a dummy customer: I use Customer ID 0: no record in 
table, Customer ID 1: Site Owner. So I could make a blank record belong to the 
Site Administrator customer, or I could create a dummy customer with id 0, if 
mysql lets me. In which case in rule 2 above the phrase or no customer at all 
could be deleted.

Therefore a Transaction need not always be linked to a customer as if by a 
constraint. I supposed I need to either use NOT_NULL to express this fact. 
Would might_have do the same thing? Its documentation seems to be partly 
finished (the line that begins Assuming). Could I get the same effect in 
belongs_to and suppess autovivification by adding cascade_delete = 0 or is 
this only going to work with might_have?

Final question. It looks like maybe I should replace all belongs_to to 
might_have since I don't want autovivification at any time in my app. Now I am 
having a bit of trouble with the docs (probably also since I have been infected 
with CDBI before coming to this) because there is also has_one which appears to 
do just what belongs_to does, but backwards. Or is it just like has_a in 
Class::DBI, in other words the inverse of belongs_to? I.e. should one object 
say has_one and the other object say belongs_to? It seems though that I 
should just use might_have all the time. Also presumably has_many will not 
autovivify even if it has none at all... right? 

Thank you and sincere apologies for muddying things,

Matt @ feeling dense today


 

Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.
http://farechase.yahoo.com/promo-generic-14795097

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/