Re: let users 'edit' database

2010-07-22 Thread cricket
On Wed, Jul 21, 2010 at 5:17 PM, Kirk  wrote:
>
> The fields could be something like:
> id (auto-increment)
> change_data (serialized array)
> url (original url change was submitted to, eg - "posts/save/24")

Instead of the URL, it might be better to have model & foreign_key
fields. It's less important to know that it was "posts/save" than that
the record belongs to "Post". Of course, the id remains very
important.

That way, this functionality could be used for more than one model
easily. So, perhaps this, too, should be a behavior.

Other pertinent data to save would be User.id and created time. So:

id
created
user_id
model
foreign_key
data

Maybe, also, an "accepted" column, if one wanted to make it so that
changes are not immediately pushed to the proper table (say, and admin
must give it the go-ahead).

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: let users 'edit' database

2010-07-22 Thread Kirk
it could be implemented as a behavior. beforeSave callback would be used for
changes that need approval. afterSave callback would be used for revision
history. for revisions, it would work really well if everything had a uuid
instead of auto-inc id, but it could also work with auto-inc id like the
cake comments/tags plugins, which have a field for id and a field for model.
the drupal method would be great for frequent access to revisions, but
without such a need, i imagine it would eventually become a performance
drain with so many unnecessary rows (could be negligible). an advantage of
the serialized version is that it could be implemented without changing any
of the existing tables, and you could set arbitrary revisions (like
"restore" points, forgive the microsoft reference).

On Thu, Jul 22, 2010 at 10:49 AM, mattmoy...@gmail.com  wrote:

> great idea kirk, that would be a great start to a revisions component
> in cake
>
> On Jul 21, 5:17 pm, Kirk  wrote:
> > Some guy submitted a "multiple undo" type thing to the bakery. I thought
> it
> > was kinda clunky, but it gave me an idea for an improvement, which could
> > also be applied to your situation. Create a table for pending changes,
> and
> > save all submitted changes to that table in serialized form. Then you can
> > just unserialize and save to the actual db.
> >
> > http://php.net/manual/en/function.serialize.php
> >
> > The fields could be
> > something like:
> >
> > id (auto-increment)
> > change_data (serialized array)
> > url (original url change was submitted to, eg - "posts/save/24")
> >
> > On Wed, Jul 21, 2010 at 4:43 PM, Jay  wrote:
> > > so a database revision/version control module is not available for
> > > cakephp? =(
> >
> > > On Jul 20, 10:54 am, "mattmoy...@gmail.com" 
> > > wrote:
> > > > Drupal does something like this called revisions.  You could
> implement
> > > > a much simpler version of this in your application by adding 2
> columns
> > > > to your database called revision and display.  Revision would just be
> > > > a revision number and you could use a timestamp as the field so it
> > > > would be unique and also keep track of creation time.  The display
> > > > column would just be a boolean showing which revision to show.  Then
> > > > you would implement some revision control actions in your controller
> > > > to manage the revisions.
> >
> > > > This would actually be awesome if generalized and written as a
> > > > behavior.  Unfortunately, I just don't have the time right now. :(
> >
> > > > On Jul 19, 6:01 pm, Jay  wrote:
> >
> > > > > ok guys, so here is the situation:
> >
> > > > > - we have built up a website using cakephp and it contains several
> > > > > models.
> > > > > - we want some users to be able to "make changes" to the database
> via
> > > > > webpage
> > > > > - but we want to audit the changes before they are actual made to
> the
> > > > > database
> >
> > > > > Our problem is, how do we know what the user changed if those
> changes
> > > > > are not "saved" the first time around. We are thinking of
> displaying a
> > > > > mock database and have the admin merge it with the real db. Is
> there
> > > > > any other way to tackle this?
> > > > > Thanks for all your inputs.
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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: let users 'edit' database

2010-07-22 Thread mattmoy...@gmail.com
great idea kirk, that would be a great start to a revisions component
in cake

On Jul 21, 5:17 pm, Kirk  wrote:
> Some guy submitted a "multiple undo" type thing to the bakery. I thought it
> was kinda clunky, but it gave me an idea for an improvement, which could
> also be applied to your situation. Create a table for pending changes, and
> save all submitted changes to that table in serialized form. Then you can
> just unserialize and save to the actual db.
>
> http://php.net/manual/en/function.serialize.php
>
> The fields could be
> something like:
>
> id (auto-increment)
> change_data (serialized array)
> url (original url change was submitted to, eg - "posts/save/24")
>
> On Wed, Jul 21, 2010 at 4:43 PM, Jay  wrote:
> > so a database revision/version control module is not available for
> > cakephp? =(
>
> > On Jul 20, 10:54 am, "mattmoy...@gmail.com" 
> > wrote:
> > > Drupal does something like this called revisions.  You could implement
> > > a much simpler version of this in your application by adding 2 columns
> > > to your database called revision and display.  Revision would just be
> > > a revision number and you could use a timestamp as the field so it
> > > would be unique and also keep track of creation time.  The display
> > > column would just be a boolean showing which revision to show.  Then
> > > you would implement some revision control actions in your controller
> > > to manage the revisions.
>
> > > This would actually be awesome if generalized and written as a
> > > behavior.  Unfortunately, I just don't have the time right now. :(
>
> > > On Jul 19, 6:01 pm, Jay  wrote:
>
> > > > ok guys, so here is the situation:
>
> > > > - we have built up a website using cakephp and it contains several
> > > > models.
> > > > - we want some users to be able to "make changes" to the database via
> > > > webpage
> > > > - but we want to audit the changes before they are actual made to the
> > > > database
>
> > > > Our problem is, how do we know what the user changed if those changes
> > > > are not "saved" the first time around. We are thinking of displaying a
> > > > mock database and have the admin merge it with the real db. Is there
> > > > any other way to tackle this?
> > > > Thanks for all your inputs.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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: let users 'edit' database

2010-07-21 Thread Kirk
Some guy submitted a "multiple undo" type thing to the bakery. I thought it
was kinda clunky, but it gave me an idea for an improvement, which could
also be applied to your situation. Create a table for pending changes, and
save all submitted changes to that table in serialized form. Then you can
just unserialize and save to the actual db.

http://php.net/manual/en/function.serialize.php

The fields could be
something like:

id (auto-increment)
change_data (serialized array)
url (original url change was submitted to, eg - "posts/save/24")

On Wed, Jul 21, 2010 at 4:43 PM, Jay  wrote:

> so a database revision/version control module is not available for
> cakephp? =(
>
> On Jul 20, 10:54 am, "mattmoy...@gmail.com" 
> wrote:
> > Drupal does something like this called revisions.  You could implement
> > a much simpler version of this in your application by adding 2 columns
> > to your database called revision and display.  Revision would just be
> > a revision number and you could use a timestamp as the field so it
> > would be unique and also keep track of creation time.  The display
> > column would just be a boolean showing which revision to show.  Then
> > you would implement some revision control actions in your controller
> > to manage the revisions.
> >
> > This would actually be awesome if generalized and written as a
> > behavior.  Unfortunately, I just don't have the time right now. :(
> >
> > On Jul 19, 6:01 pm, Jay  wrote:
> >
> > > ok guys, so here is the situation:
> >
> > > - we have built up a website using cakephp and it contains several
> > > models.
> > > - we want some users to be able to "make changes" to the database via
> > > webpage
> > > - but we want to audit the changes before they are actual made to the
> > > database
> >
> > > Our problem is, how do we know what the user changed if those changes
> > > are not "saved" the first time around. We are thinking of displaying a
> > > mock database and have the admin merge it with the real db. Is there
> > > any other way to tackle this?
> > > Thanks for all your inputs.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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: let users 'edit' database

2010-07-21 Thread Jay
so a database revision/version control module is not available for
cakephp? =(

On Jul 20, 10:54 am, "mattmoy...@gmail.com" 
wrote:
> Drupal does something like this called revisions.  You could implement
> a much simpler version of this in your application by adding 2 columns
> to your database called revision and display.  Revision would just be
> a revision number and you could use a timestamp as the field so it
> would be unique and also keep track of creation time.  The display
> column would just be a boolean showing which revision to show.  Then
> you would implement some revision control actions in your controller
> to manage the revisions.
>
> This would actually be awesome if generalized and written as a
> behavior.  Unfortunately, I just don't have the time right now. :(
>
> On Jul 19, 6:01 pm, Jay  wrote:
>
> > ok guys, so here is the situation:
>
> > - we have built up a website using cakephp and it contains several
> > models.
> > - we want some users to be able to "make changes" to the database via
> > webpage
> > - but we want to audit the changes before they are actual made to the
> > database
>
> > Our problem is, how do we know what the user changed if those changes
> > are not "saved" the first time around. We are thinking of displaying a
> > mock database and have the admin merge it with the real db. Is there
> > any other way to tackle this?
> > Thanks for all your inputs.

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: let users 'edit' database

2010-07-20 Thread mattmoy...@gmail.com
Drupal does something like this called revisions.  You could implement
a much simpler version of this in your application by adding 2 columns
to your database called revision and display.  Revision would just be
a revision number and you could use a timestamp as the field so it
would be unique and also keep track of creation time.  The display
column would just be a boolean showing which revision to show.  Then
you would implement some revision control actions in your controller
to manage the revisions.

This would actually be awesome if generalized and written as a
behavior.  Unfortunately, I just don't have the time right now. :(

On Jul 19, 6:01 pm, Jay  wrote:
> ok guys, so here is the situation:
>
> - we have built up a website using cakephp and it contains several
> models.
> - we want some users to be able to "make changes" to the database via
> webpage
> - but we want to audit the changes before they are actual made to the
> database
>
> Our problem is, how do we know what the user changed if those changes
> are not "saved" the first time around. We are thinking of displaying a
> mock database and have the admin merge it with the real db. Is there
> any other way to tackle this?
> Thanks for all your inputs.

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


let users 'edit' database

2010-07-19 Thread Jay
ok guys, so here is the situation:

- we have built up a website using cakephp and it contains several
models.
- we want some users to be able to "make changes" to the database via
webpage
- but we want to audit the changes before they are actual made to the
database

Our problem is, how do we know what the user changed if those changes
are not "saved" the first time around. We are thinking of displaying a
mock database and have the admin merge it with the real db. Is there
any other way to tackle this?
Thanks for all your inputs.

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