How to make a view that interacts using multiple models

2010-04-20 Thread Pablo Vergara B.
Hello guys from the community. This is my first post (well, it's a
question anyways) since I joined the group because I'm very new to
this amazing framework. Please sorry if my English is far from being
perfect, I'm trying to do my best even if it's not my native language.
(I'm from Chile, Latin America)

Well this is the thing:
I'm making small invoice system. I already made my small database
design (which can be seen in the image below), models and their
associations, default controllers and views (using the cake bake
script).
I tried to follow ALL the cakePHP conventions and rules to make myself
the things easier and it seems it worked.

a href=http://imgur.com/AqIAq.png; title=Hosted by
imgur.comhttp://imgur.com/AqIAq.png/a

http://imgur.com/AqIAq.png (direct link if the html link doesn't
works)

My problem is that I can't find how to make a view (for the index
action) where I could have and handle this information:
- Invoice number (numeroFactura into facturas table)
- Invoice date (fecha into facturas table)
- Rut (rut inro clientes table)
- Names (nombres into clientes table)
- Last names (apellidos into clientes table)
- Product name (descripcion into productos table)
- Product quantity (cantidad into lineas table, lineas table is for
the invoice lines)
- Product value (precio ino productos table)

Should I make this view customizing the lineas_facturas default view
for the index action? or ..
Can I even make the view I need customizing the facturas or lineas
default view for the index action? Maybe using some kind of tricky
code to relate the models I need to get the data from?

Thanks in advance people, I'm still a newbie but I don't give up! Even
if I have to read in English being an Spanish language native guy,
this framework worth it!
Greetings from Chile!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Dependent models

2010-04-11 Thread Pablo Vergara B.
How do you actually can use database CASCADE deleting method when no
real relations are made into the database diagram? (Because
relations are handled internally by cakePHP)

I'm still a novice about cakePHP so I can be wrong... or not. Let's
wait for a advanced user to answer both questions :).

Inf fact (if we could) the database engine deleting/updating option
(using CASCADE for instance) would be the fastest way to do this.

Greetings and sorry if my english is not too good plz, I'm from a
spanish speaking country...

On Apr 10, 12:45 pm, Mateusz Kaczanowski kangu...@gmail.com wrote:
 Hi guys,

 In CakePHP we delete related records by dependency in model. Which way us
 better

 1. Set up CASCADE in innodb mysql database
 2. Use dependent in cakePHP model

 Better - I mean faster , safer .

 Thanks for answers

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using remove me as the subject.