Author: Vineet Deodhar
Posted: 2012-02-09 09:28:21 Link
Consider a setup like this:
ParentTable: (parent_id, name, occu)
ChildTable: (child_id, parent_id, name, qual)
GrandChildTable: (gchild_id, child_id, name, age)
Table data is like this:
in ParentTable: (1, 'John', 'farmer')
in ChildTable: (1, 1, 'Bill', 'B.A.'), (2, 1, 'Black', 'M.A.')
in GrandChildTable: (1, 2, 'Noah', 23), (2, 2, 'George', 10)
My Problem---
In GrandChildTable,
user deletes 2nd row.
updates 1st row.
Beforehand, I, of course, do not know what the user will do with records
(update or delete).
I know how to call the methods like new(), save(), delete(), seek() &
setFieldVal() individually on table records.
Is there any way to make dabo call delete() on correct records and save()
on correct records (without any extra coding from my side)?
Maybe something like setDeleteFlag?
Otherwise I need to trace-out the records where data was there before
user-interaction, and the data is absent after user-interaction.
Then I can call delete().
Otherwise I call save()
(along-with requery(), seek(), setFieldVal())
Similarly, I have to trace-out newly added records.
This becomes very complex.
Definitely, dabo must be having a proper way to do this.
I request this list to help me out.
Thanks,
Vineet
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/CAP5=7opb8yKsUOSKitmVzk+cTA=hBLpyzpNJ2v7GGky+dpc0nA@mail.gmail.com
Author: Ed Leafe
Posted: 2012-02-09 10:08:27 Link
On Feb 9, 2012, at 8:28 AM, Vineet Deodhar wrote:
> Is there any way to make dabo call delete() on correct records and save()
> on correct records (without any extra coding from my side)?
> Maybe something like setDeleteFlag?
The key is to make sure that the record upon which you want to act (delete/update) currently selected; either through the UI (e.g., selecting the row in a grid), or programmatically (e.g., form.moveToRowNumber()). Then when delete() is called, that will be the record to delete.
For updates, the same general thing applies: selecting the desired row will cause that row's data to be displayed in any bound UI objects, and changing those values will affect just that row. However, saving those changes is buffered, so when you modify the values, they are not written immediately to the backend store; they are only changed in the local dataset. When you call form.save(), Dabo will find all your changes and save them, even if you have moved to a different row in the bizobj. This behavior is the default; you can change it by setting the form's SaveAllRows property to False. If you do that, only changes in the current row of the PrimaryBizobj (and related child rows) will be saved.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/144E42FB-C915-4267-B400-6FCD0F3F5B34@leafe.com
Author: John Fabiani
Posted: 2012-02-09 10:24:43 Link
On Thursday, February 09, 2012 07:58:21 PM Vineet Deodhar wrote:
> Consider a setup like this:
>
> ParentTable: (parent_id, name, occu)
> ChildTable: (child_id, parent_id, name, qual)
> GrandChildTable: (gchild_id, child_id, name, age)
>
> Table data is like this:
>
> in ParentTable: (1, 'John', 'farmer')
>
> in ChildTable: (1, 1, 'Bill', 'B.A.'), (2, 1, 'Black', 'M.A.')
>
> in GrandChildTable: (1, 2, 'Noah', 23), (2, 2, 'George', 10)
>
> My Problem---
>
> In GrandChildTable,
> user deletes 2nd row.
> updates 1st row.
> Beforehand, I, of course, do not know what the user will do with records
> (update or delete).
> I know how to call the methods like new(), save(), delete(), seek() &
> setFieldVal() individually on table records.
>
> Is there any way to make dabo call delete() on correct records and save()
> on correct records (without any extra coding from my side)?
> Maybe something like setDeleteFlag?
>
> Otherwise I need to trace-out the records where data was there before
> user-interaction, and the data is absent after user-interaction.
> Then I can call delete().
> Otherwise I call save()
> (along-with requery(), seek(), setFieldVal())
> Similarly, I have to trace-out newly added records.
>
> This becomes very complex.
> Definitely, dabo must be having a proper way to do this.
>
> I request this list to help me out.
>
> Thanks,
>
> Vineet
Normally I setup the form to save() or delete() immediately - reacting to user
input. For example if the user decides to delete a grandchild record it
happens immediately.
gradchild.delete() or self.delete(grandchild).
After the delete Dabo handles the requery() and updates the screen.
There are times or situations where additional actions must occur as the
result of the delete. I then add a delete() method in the bizobj to handle
those special situations.
The same holds true for save().
Johnf
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/110735569.GNktSc1gIy@linux-12
Author: Ed Leafe
Posted: 2012-02-09 10:40:46 Link
On Feb 9, 2012, at 9:24 AM, John Fabiani wrote:
> There are times or situations where additional actions must occur as the
> result of the delete. I then add a delete() method in the bizobj to handle
> those special situations.
There already is a delete() method in the bizobj; you should not be modifying that. Instead, take advantage of beforeDelete() and afterDelete() to augment it as needed.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/76055973-C4AA-40F6-A254-9356F04B88C1@leafe.com
Author: John Fabiani
Posted: 2012-02-09 11:01:59 Link
On Thursday, February 09, 2012 09:40:46 AM Ed Leafe wrote:
> There already is a delete() method in the bizobj; you should not be
> modifying that. Instead, take advantage of beforeDelete() and afterDelete()
> to augment it as needed.
Your right - I mis-spoke I do in fact use the afterDelete(). But I can see
where I'd might need to override the delete method. Of course the way I have
been setting up my databases lately I'm not to sure I'll ever need to
override.
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/2577346.CMqkoTIxOe@linux-12
Author: Dennis Lee Bieber
Posted: 2012-02-09 11:26:50 Link
On Thu, 9 Feb 2012 19:58:21 +0530, Vineet Deodhar
<vineet.deodhar@gmail.com> wrote:
>
>In GrandChildTable,
>user deletes 2nd row.
>updates 1st row.
>Beforehand, I, of course, do not know what the user will do with records
>(update or delete).
>I know how to call the methods like new(), save(), delete(), seek() &
>setFieldVal() individually on table records.
>
<snip>
>Otherwise I need to trace-out the records where data was there before
>user-interaction, and the data is absent after user-interaction.
My apologies, I don't have any experience directly with Dabo (like
Django, it's too much of a moving target for someone to dabble with in
their spare time -- and unlike Django, it hasn't even the benefit of
rapidly out-dated paper books!)...
I'm curious about what you consider "deletes 2nd row". Your
statement "data was there before ... data is absent after" makes me
think you are defining a delete as "user blanked out all fields of the
record" -- technically that just means the user, well, nulled the field
contents but is not considered a deletion.
Most interfaces that I've seen with a record deletion capability
rely on either a column on the form with a check-box, to indicate that
row should be deleted (this format allows multiple deletions at a time
from a tabular/grid display), or an explicit action
(context-menu/right-click menu) ON EACH row, with a delete "command"
that takes effect immediately (well, maybe after a pop-up confirmation
"Are you sure you want to delete XYZ").
Hopefully the interface logic is smart enough to internally tag
records that have had changes performed on screen, and will issue
database updates when the screen is changed (on tabular/grid systems,
this could be whenever the user changes to a different row, only if the
"current" row had been modified; or it could cache all those modified
rows and submit them as a batch when the entire page is
exited/saved)[Reading ahead, this may be what is described in the
master's voice]
>Then I can call delete().
>Otherwise I call save()
>(along-with requery(), seek(), setFieldVal())
>Similarly, I have to trace-out newly added records.
>
>This becomes very complex.
>Definitely, dabo must be having a proper way to do this.
>
>I request this list to help me out.
>
>Thanks,
>
>Vineet
>
>
>--- StripMime Report -- processed MIME parts ---
>multipart/alternative
> text/plain (text body -- kept)
> text/html
>---
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/hrp7j7db9pn3km3gpetpumpddok68j8u3u@4ax.com
Author: John Fabiani
Posted: 2012-02-09 12:11:35 Link
On Thursday, February 09, 2012 11:26:50 AM Dennis Lee Bieber wrote:
> My apologies, I don't have any experience directly with Dabo (like
> Django, it's too much of a moving target for someone to dabble with in
> their spare time -- and unlike Django, it hasn't even the benefit of
> rapidly out-dated paper books!)...
I totally disagree - Dabo is NOT a moving target. I have code that is now
near 3 years old and it still runs without changes using todays commit. I
will concede that a few changes may have broken someone's older code but that
does not happen often. Ed, Paul and others try their best to insure that does
not happen. That said, Dabo reserves the right to do so - if it makes sense
to do so.
I'm guessing that you have been watching the commits and are under the
impression that those commits break legacy code. 98% of the commits either
improve performance or add a new enhancement. If the 2% of the commits do
break legacy code that commit is fixed.
Yes it true Dabo lacks documentation. No Dabo does not have an "out-dated"
book either. But if you review the recent changes to the doc's I think you
will find they have improved. But that's not really what most developers
really want - is it. They want extended tutorials, how to's and a better
understanding the basic's of the framework. Just like Django I doubt we will
ever get there. But I'm sure the Dabo community will offer more in the
future.
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/2725112.Gt0cyhlKJW@linux-12
Author: Dennis Lee Bieber
Posted: 2012-02-09 13:24:59 Link
On Thu, 09 Feb 2012 09:11:35 -0800, John Fabiani
<johnf@jfcomputer.com> wrote:
>On Thursday, February 09, 2012 11:26:50 AM Dennis Lee Bieber wrote:
>> My apologies, I don't have any experience directly with Dabo (like
>> Django, it's too much of a moving target for someone to dabble with in
>> their spare time -- and unlike Django, it hasn't even the benefit of
>> rapidly out-dated paper books!)...
>
>I totally disagree - Dabo is NOT a moving target. I have code that is now
>near 3 years old and it still runs without changes using todays commit. I
>will concede that a few changes may have broken someone's older code but that
>does not happen often. Ed, Paul and others try their best to insure that does
>not happen. That said, Dabo reserves the right to do so - if it makes sense
>to do so.
Okay, it's stabilized since I last tried to start something with
it...
>Yes it true Dabo lacks documentation. No Dabo does not have an "out-dated"
>book either. But if you review the recent changes to the doc's I think you
>will find they have improved. But that's not really what most developers
This is the killer for me -- especially at present when I'm paying
$50 for 1GB/30-day (whichever comes first) data access via my laptop's
AT&T card. I don't have the funds/time for browsing on-line
documentation to learn a framework. I hope to have DSL hooked up by the
end of the month (at which point I'll run both the Dabo and Django SVN
updates on my (slow) desktop machine.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/5h38j79o124gptu00fuji18kjmqpec2eoq@4ax.com
Author: Paul McNett
Posted: 2012-02-09 13:30:49 Link
On 2/9/12 10:24 AM, Dennis Lee Bieber wrote:
> This is the killer for me -- especially at present when I'm paying
> $50 for 1GB/30-day (whichever comes first) data access via my laptop's
> AT&T card. I don't have the funds/time for browsing on-line
> documentation to learn a framework. I hope to have DSL hooked up by the
> end of the month (at which point I'll run both the Dabo and Django SVN
> updates on my (slow) desktop machine.
It is (unintentionally) hidden, but you can download the "old" dabo api documentation
as a tarball to read locally with your browser:
http://paul.dabodev.com/doc/api/dabodoc.tar.gz
I'm sure there is a way to download the "new" dabo api documentation and browse it
locally too. Werner?
Paul
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4F3410D9.6080802@ulmcnett.com
Author: Ed Leafe
Posted: 2012-02-09 13:35:50 Link
On Feb 9, 2012, at 12:24 PM, Dennis Lee Bieber wrote:
> This is the killer for me -- especially at present when I'm paying
> $50 for 1GB/30-day (whichever comes first) data access via my laptop's
> AT&T card. I don't have the funds/time for browsing on-line
> documentation to learn a framework.
You might want to download the tutorial:
http://dabodev.com/pycon_2010_tutorial.pdf
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/9752A079-ABE0-4626-B997-97D57DA7A907@leafe.com