My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Note  
Updated Jul 22, 2011 by felice.ostuni

#note sviluppo

usare meglio i model

in crud complicati, o in datagrid con colonne da formattare, rapyd prevede le callback (nota: rinominerei per conformità in "callback" anche le pre/postprocess_functions del dataedit)

Attualmente, l'uso prevede il richiamo a "funzioni" o a metodi del controller. Sarebbe bene mostrare negli esempi che è piu' giusto chiamare metodi di un "model".

(per il datagrid come si fà? visto che per default non è associato ad un model?, sarebbe giusto eventualmente prevedere un model per operare con i filtri e con i dataset? per intenderci: spostare il "dataset" nel folder model? ...)

da $datagrid->db a $datagrid->model->db

una soluzione "semplice" potrebbe essere quella di spostare l'accesso e l'uso del db dai componenti ai model ("dataset" o "datamodel").

In maniera tale che, quando serve fare callback, si possano estendere i model per mettere lì (e non nel controller o in funzioni sparse) le operazioni sui dati.

in generale tutto cio' che è $componente->db dovrebbe diventare $componente->model->db o meglio $componente->model->metodo_che_opera_su_db esempio.. questo puo' forse essere fatto a livello di "component".. (classe ancestor di tutti i componenti ma và verificato)

todo

  • Integrare le ultime modifiche alle pre_post process function e approfittare per rinominare in callback
  • provare a spostare il dataset nel folder model
  • provare a estendere i model negli esempi e spostare lì la parte che opera sul db
test
.
└── default
    └── base
        ├── css 
        ├── images
        │   ├── banks
        │   ├── dashboard
        │   ├── default
        │   ├── flags
        │   ├── menu
        │   └── stars
        ├── js
        └── scripts
Comment by opurahman, Sep 7, 2010

Hi, I am a fan of Rapyd framework. Can you make all the wiki and documentation in English?

Comment by project member felice.ostuni, Sep 9, 2010

Hi opurahman, this is just an annotation page, (for me) so it's written in italian. I've recently restarted development so i'll write an updated user guide (in english) soon. however in the download page there is an "old" documentation in pdf

Comment by project member johnmah...@gmail.com, May 20, 2011

hey felice. we would like to see your thought process so the annotation could be helpful for learners like us ;)


Sign in to add a comment
Powered by Google Project Hosting