My application task is to integrate several applications, and it
should manipulate objects, spread among several tables in several
databases. Final object is constructed by 'joining' tables by single
field (or derivatives).
A user should see such objects as solid entities and manipulate them
with basic CRUD operations (with search).
Backend should synchronize all changes in all databases.
And i wish i could use admin site for that.
If i guess correctly, all required magic should go into custom
QuerySet implementation to properly translate CRUD operations on
models into various distributed requests on databases, like zigzag-
joins, etc instead of usual sql.Queries.
I wonder if QuerySet is the only consolidation of such interface.
What else should i customize to make it work? (i see at least
db.models.Manager should be customized to use another queryset impl)
Also, how to figure out what subset of QuerySet interface is used in
admin site?
Maybe, someone already managed similar task and there are some recipes?
Hi !
I have a similar situation.
(disclaimer:-- I have tried turbogears & web2py before.
But could not find the following functionality there.
So I have signed-in here to see whether I can get it in django).
My form is composed of fields from various tables.
When a user interacts with form, he/she may add/edit/delete/keep
unchanged certain fields,
After saving the form, I need to understand---
1) which table(s) should receive SQL add statement,
2) which one(s) need update stmt,
3) which one(s) to receive delete stmt.
Some examples of (desktop) frameworks having this feature:--
i) CursorAdaptor in VFP
ii) DABO desktop framework
But I am looking for a web framework having this feature.
Without a proper method (rather class) to handle it, it would be very
messy.
There will be code repetitions, etc.
I am eager to know whether there is any facility to do the above thing
in django.
In that case, I will happily switch to django.
Any comments/advise/knowledge-sharing highly appreciated.
Thanks.
On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
> My application task is to integrate several applications, and it
> should manipulate objects, spread among several tables in several
> databases. Final object is constructed by 'joining' tables by single
> field (or derivatives).
> A user should see such objects as solid entities and manipulate them
> with basic CRUD operations (with search).
> Backend should synchronize all changes in all databases.
> And i wish i could use admin site for that.
> If i guess correctly, all required magic should go into custom
> QuerySet implementation to properly translate CRUD operations on
> models into various distributed requests on databases, like zigzag-
> joins, etc instead of usual sql.Queries.
> I wonder if QuerySet is the only consolidation of such interface.
> What else should i customize to make it work? (i see at least
> db.models.Manager should be customized to use another queryset impl)
> Also, how to figure out what subset of QuerySet interface is used in
> admin site?
> Maybe, someone already managed similar task and there are some recipes?
> Hi !
> I have a similar situation.
> (disclaimer:-- I have tried turbogears & web2py before.
> But could not find the following functionality there.
> So I have signed-in here to see whether I can get it in django).
> My form is composed of fields from various tables.
> When a user interacts with form, he/she may add/edit/delete/keep
> unchanged certain fields,
> After saving the form, I need to understand---
> 1) which table(s) should receive SQL add statement,
> 2) which one(s) need update stmt,
> 3) which one(s) to receive delete stmt.
> Some examples of (desktop) frameworks having this feature:--
> i) CursorAdaptor in VFP
> ii) DABO desktop framework
> But I am looking for a web framework having this feature.
> Without a proper method (rather class) to handle it, it would be very
> messy.
> There will be code repetitions, etc.
> I am eager to know whether there is any facility to do the above thing
> in django.
> In that case, I will happily switch to django.
> Any comments/advise/knowledge-sharing highly appreciated.
> Thanks.
> On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
> > Hello here.
> > My application task is to integrate several applications, and it
> > should manipulate objects, spread among several tables in several
> > databases. Final object is constructed by 'joining' tables by single
> > field (or derivatives).
> > A user should see such objects as solid entities and manipulate them
> > with basic CRUD operations (with search).
> > Backend should synchronize all changes in all databases.
> > And i wish i could use admin site for that.
> > If i guess correctly, all required magic should go into custom
> > QuerySet implementation to properly translate CRUD operations on
> > models into various distributed requests on databases, like zigzag-
> > joins, etc instead of usual sql.Queries.
> > I wonder if QuerySet is the only consolidation of such interface.
> > What else should i customize to make it work? (i see at least
> > db.models.Manager should be customized to use another queryset impl)
> > Also, how to figure out what subset of QuerySet interface is used in
> > admin site?
> > Maybe, someone already managed similar task and there are some recipes?- Hide quoted text -
Not to put too fine a point on this.
I was hopeful to get some reply on this list (I heard that django
community is superbly active).
But it seems that either this post of mine alongwith "qMax" (OP) was
extremely silly,
OR
Nobody understood the gravity of our post.
In data-centric business apps (not like Yet Another Blog or Movie
Upload), such complexities as we mention in the above post, are a
regular part of life.
Regards,
Vineet
On Jul 5, 9:28 pm, Hummingbird <vineet.deod...@gmail.com> wrote:
> Can anybody pl. share his/her experience on this issue?
> Thanks.
> On Jul 2, 10:39 am, Hummingbird <vineet.deod...@gmail.com> wrote:
> > Hi !
> > I have a similar situation.
> > (disclaimer:-- I have tried turbogears & web2py before.
> > But could not find the following functionality there.
> > So I have signed-in here to see whether I can get it in django).
> > My form is composed of fields from various tables.
> > When a user interacts with form, he/she may add/edit/delete/keep
> > unchanged certain fields,
> > After saving the form, I need to understand---
> > 1) which table(s) should receive SQL add statement,
> > 2) which one(s) need update stmt,
> > 3) which one(s) to receive delete stmt.
> > Some examples of (desktop) frameworks having this feature:--
> > i) CursorAdaptor in VFP
> > ii) DABO desktop framework
> > But I am looking for a web framework having this feature.
> > Without a proper method (rather class) to handle it, it would be very
> > messy.
> > There will be code repetitions, etc.
> > I am eager to know whether there is any facility to do the above thing
> > in django.
> > In that case, I will happily switch to django.
> > Any comments/advise/knowledge-sharing highly appreciated.
> > Thanks.
> > On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
> > > Hello here.
> > > My application task is to integrate several applications, and it
> > > should manipulate objects, spread among several tables in several
> > > databases. Final object is constructed by 'joining' tables by single
> > > field (or derivatives).
> > > A user should see such objects as solid entities and manipulate them
> > > with basic CRUD operations (with search).
> > > Backend should synchronize all changes in all databases.
> > > And i wish i could use admin site for that.
> > > If i guess correctly, all required magic should go into custom
> > > QuerySet implementation to properly translate CRUD operations on
> > > models into various distributed requests on databases, like zigzag-
> > > joins, etc instead of usual sql.Queries.
> > > I wonder if QuerySet is the only consolidation of such interface.
> > > What else should i customize to make it work? (i see at least
> > > db.models.Manager should be customized to use another queryset impl)
> > > Also, how to figure out what subset of QuerySet interface is used in
> > > admin site?
> > > Maybe, someone already managed similar task and there are some recipes?- Hide quoted text -
If there is no reply to a question, it's either because people are busy, no one knows the answer, or because the OP did not make any sense. Personally, I read the post and thought "this post makes no sense". OP may want to re-phrase their original post in the form of a real set of questions. If in doubt, please refer to the following document:
On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > Not to put too fine a point on this. > I was hopeful to get some reply on this list (I heard that django > community is superbly active). > But it seems that either this post of mine alongwith "qMax" (OP) was > extremely silly, > OR > Nobody understood the gravity of our post. > In data-centric business apps (not like Yet Another Blog or Movie > Upload), such complexities as we mention in the above post, are a > regular part of life.
> Regards, > Vineet
> On Jul 5, 9:28 pm, Hummingbird <vineet.deod...@gmail.com> wrote: >> Can anybody pl. share his/her experience on this issue? >> Thanks.
>> On Jul 2, 10:39 am, Hummingbird <vineet.deod...@gmail.com> wrote:
>> > Hi ! >> > I have a similar situation. >> > (disclaimer:-- I have tried turbogears & web2py before. >> > But could not find the following functionality there. >> > So I have signed-in here to see whether I can get it in django).
>> > My form is composed of fields from various tables. >> > When a user interacts with form, he/she may add/edit/delete/keep >> > unchanged certain fields, >> > After saving the form, I need to understand--- >> > 1) which table(s) should receive SQL add statement, >> > 2) which one(s) need update stmt, >> > 3) which one(s) to receive delete stmt.
>> > Some examples of (desktop) frameworks having this feature:-- >> > i) CursorAdaptor in VFP >> > ii) DABO desktop framework >> > But I am looking for a web framework having this feature.
>> > Without a proper method (rather class) to handle it, it would be very >> > messy. >> > There will be code repetitions, etc.
>> > I am eager to know whether there is any facility to do the above thing >> > in django. >> > In that case, I will happily switch to django. >> > Any comments/advise/knowledge-sharing highly appreciated.
>> > Thanks.
>> > On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
>> > > Hello here.
>> > > My application task is to integrate several applications, and it >> > > should manipulate objects, spread among several tables in several >> > > databases. Final object is constructed by 'joining' tables by single >> > > field (or derivatives). >> > > A user should see such objects as solid entities and manipulate them >> > > with basic CRUD operations (with search). >> > > Backend should synchronize all changes in all databases. >> > > And i wish i could use admin site for that.
>> > > If i guess correctly, all required magic should go into custom >> > > QuerySet implementation to properly translate CRUD operations on >> > > models into various distributed requests on databases, like zigzag- >> > > joins, etc instead of usual sql.Queries.
>> > > I wonder if QuerySet is the only consolidation of such interface. >> > > What else should i customize to make it work? (i see at least >> > > db.models.Manager should be customized to use another queryset impl) >> > > Also, how to figure out what subset of QuerySet interface is used in >> > > admin site?
>> > > Maybe, someone already managed similar task and there are some recipes?- Hide quoted text -
>> > - Show quoted text -- Hide quoted text -
>> - Show quoted text -
> -- > You received this message because you are subscribed to the Google Groups "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
@Cal,
My apologies if my post has hurted you.
I didn't mean that.
I understand that all these open source projects are run by people who
don't get paid for it.
My point was quite different. It was about knowledge sharing.
We can re-phrase the question if nobody understands what we mean to
ask.
Actually, we are not asking for any exact code or any spoon-feeding.
We are asking whether anybody has developed a solution similar to
CursorAdaptor in VFP
Ed Leafe & Paul McNett have done marvelous work in this area (DABO
desktop framework).
> If there is no reply to a question, it's either because people are
> busy, no one knows the answer, or because the OP did not make any
> sense. Personally, I read the post and thought "this post makes no
> sense". OP may want to re-phrase their original post in the form of a
> real set of questions. If in doubt, please refer to the following
> document:
> In regards to your comment of "Nobody understood the gravity of our
> post", I refer you to the following line in the above document:
> Don't expect an instant or one-shot answer. (django-users is *NOT*
> your personal tutor.)
> Cal
> On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird <vineet.deod...@gmail.com> wrote:
> > Not to put too fine a point on this.
> > I was hopeful to get some reply on this list (I heard that django
> > community is superbly active).
> > But it seems that either this post of mine alongwith "qMax" (OP) was
> > extremely silly,
> > OR
> > Nobody understood the gravity of our post.
> > In data-centric business apps (not like Yet Another Blog or Movie
> > Upload), such complexities as we mention in the above post, are a
> > regular part of life.
> > Regards,
> > Vineet
> > On Jul 5, 9:28 pm, Hummingbird <vineet.deod...@gmail.com> wrote:
> >> Can anybody pl. share his/her experience on this issue?
> >> Thanks.
> >> On Jul 2, 10:39 am, Hummingbird <vineet.deod...@gmail.com> wrote:
> >> > Hi !
> >> > I have a similar situation.
> >> > (disclaimer:-- I have tried turbogears & web2py before.
> >> > But could not find the following functionality there.
> >> > So I have signed-in here to see whether I can get it in django).
> >> > My form is composed of fields from various tables.
> >> > When a user interacts with form, he/she may add/edit/delete/keep
> >> > unchanged certain fields,
> >> > After saving the form, I need to understand---
> >> > 1) which table(s) should receive SQL add statement,
> >> > 2) which one(s) need update stmt,
> >> > 3) which one(s) to receive delete stmt.
> >> > Some examples of (desktop) frameworks having this feature:--
> >> > i) CursorAdaptor in VFP
> >> > ii) DABO desktop framework
> >> > But I am looking for a web framework having this feature.
> >> > Without a proper method (rather class) to handle it, it would be very
> >> > messy.
> >> > There will be code repetitions, etc.
> >> > I am eager to know whether there is any facility to do the above thing
> >> > in django.
> >> > In that case, I will happily switch to django.
> >> > Any comments/advise/knowledge-sharing highly appreciated.
> >> > Thanks.
> >> > On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
> >> > > Hello here.
> >> > > My application task is to integrate several applications, and it
> >> > > should manipulate objects, spread among several tables in several
> >> > > databases. Final object is constructed by 'joining' tables by single
> >> > > field (or derivatives).
> >> > > A user should see such objects as solid entities and manipulate them
> >> > > with basic CRUD operations (with search).
> >> > > Backend should synchronize all changes in all databases.
> >> > > And i wish i could use admin site for that.
> >> > > If i guess correctly, all required magic should go into custom
> >> > > QuerySet implementation to properly translate CRUD operations on
> >> > > models into various distributed requests on databases, like zigzag-
> >> > > joins, etc instead of usual sql.Queries.
> >> > > I wonder if QuerySet is the only consolidation of such interface.
> >> > > What else should i customize to make it work? (i see at least
> >> > > db.models.Manager should be customized to use another queryset impl)
> >> > > Also, how to figure out what subset of QuerySet interface is used in
> >> > > admin site?
> >> > > Maybe, someone already managed similar task and there are some recipes?- Hide quoted text -
> >> > - Show quoted text -- Hide quoted text -
> >> - Show quoted text -
> > --
> > You received this message because you are subscribed to the Google Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.
On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird <vineet.deod...@gmail.com>wrote:
> @Cal, > My apologies if my post has hurted you. > I didn't mean that. > I understand that all these open source projects are run by people who > don't get paid for it.
> My point was quite different. It was about knowledge sharing. > We can re-phrase the question if nobody understands what we mean to > ask. > Actually, we are not asking for any exact code or any spoon-feeding. > We are asking whether anybody has developed a solution similar to > CursorAdaptor in VFP
Being a completely non-Microsoft person, I'm afraid I can't answer your question.
However, that page contains a lot of tedious info, and I doubt someone would take the time to read through it.
Could you please explain exactly what features "CursorAdapter" has, that you are looking for in Django?
> Regarding your remark of "Don't expect an instant answer"-- > -- OP was dated 30th June. > Today is 8th July (an instant???)
> Again, pl. excuse me if I have said anything wrong. > @qMax: Have you got any way around your question?
> ---Vineet
> On Jul 8, 6:38 pm, "Cal Leeming [Simplicity Media Ltd]" > <cal.leem...@simplicitymedialtd.co.uk> wrote: > > Hummingbird,
> > If there is no reply to a question, it's either because people are > > busy, no one knows the answer, or because the OP did not make any > > sense. Personally, I read the post and thought "this post makes no > > sense". OP may want to re-phrase their original post in the form of a > > real set of questions. If in doubt, please refer to the following > > document:
> > In regards to your comment of "Nobody understood the gravity of our > > post", I refer you to the following line in the above document:
> > Don't expect an instant or one-shot answer. (django-users is *NOT* > > your personal tutor.)
> > Cal
> > On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird <vineet.deod...@gmail.com> > wrote: > > > Not to put too fine a point on this. > > > I was hopeful to get some reply on this list (I heard that django > > > community is superbly active). > > > But it seems that either this post of mine alongwith "qMax" (OP) was > > > extremely silly, > > > OR > > > Nobody understood the gravity of our post. > > > In data-centric business apps (not like Yet Another Blog or Movie > > > Upload), such complexities as we mention in the above post, are a > > > regular part of life.
> > > Regards, > > > Vineet
> > > On Jul 5, 9:28 pm, Hummingbird <vineet.deod...@gmail.com> wrote: > > >> Can anybody pl. share his/her experience on this issue? > > >> Thanks.
> > >> > Hi ! > > >> > I have a similar situation. > > >> > (disclaimer:-- I have tried turbogears & web2py before. > > >> > But could not find the following functionality there. > > >> > So I have signed-in here to see whether I can get it in django).
> > >> > My form is composed of fields from various tables. > > >> > When a user interacts with form, he/she may add/edit/delete/keep > > >> > unchanged certain fields, > > >> > After saving the form, I need to understand--- > > >> > 1) which table(s) should receive SQL add statement, > > >> > 2) which one(s) need update stmt, > > >> > 3) which one(s) to receive delete stmt.
> > >> > Some examples of (desktop) frameworks having this feature:-- > > >> > i) CursorAdaptor in VFP > > >> > ii) DABO desktop framework > > >> > But I am looking for a web framework having this feature.
> > >> > Without a proper method (rather class) to handle it, it would be > very > > >> > messy. > > >> > There will be code repetitions, etc.
> > >> > I am eager to know whether there is any facility to do the above > thing > > >> > in django. > > >> > In that case, I will happily switch to django. > > >> > Any comments/advise/knowledge-sharing highly appreciated.
> > >> > Thanks.
> > >> > On Jun 30, 9:23 am, qMax <qwigly...@gmail.com> wrote:
> > >> > > Hello here.
> > >> > > My application task is to integrate several applications, and it > > >> > > should manipulate objects, spread among several tables in several > > >> > > databases. Final object is constructed by 'joining' tables by > single > > >> > > field (or derivatives). > > >> > > A user should see such objects as solid entities and manipulate > them > > >> > > with basic CRUD operations (with search). > > >> > > Backend should synchronize all changes in all databases. > > >> > > And i wish i could use admin site for that.
> > >> > > If i guess correctly, all required magic should go into custom > > >> > > QuerySet implementation to properly translate CRUD operations on > > >> > > models into various distributed requests on databases, like > zigzag- > > >> > > joins, etc instead of usual sql.Queries.
> > >> > > I wonder if QuerySet is the only consolidation of such interface. > > >> > > What else should i customize to make it work? (i see at least > > >> > > db.models.Manager should be customized to use another queryset > impl) > > >> > > Also, how to figure out what subset of QuerySet interface is used > in > > >> > > admin site?
> > >> > > Maybe, someone already managed similar task and there are some > recipes?- Hide quoted text -
> > >> > - Show quoted text -- Hide quoted text -
> > >> - Show quoted text -
> > > -- > > > You received this message because you are subscribed to the Google > Groups "Django users" group. > > > To post to this group, send email to django-users@googlegroups.com. > > > To unsubscribe from this group, send email to > django-users+unsubscribe@googlegroups.com. > > > For more options, visit this group athttp:// > groups.google.com/group/django-users?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en.
On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > @Cal, > My apologies if my post has hurted you. > I didn't mean that. > I understand that all these open source projects are run by people who > don't get paid for it.
> My point was quite different. It was about knowledge sharing. > We can re-phrase the question if nobody understands what we mean to > ask. > Actually, we are not asking for any exact code or any spoon-feeding. > We are asking whether anybody has developed a solution similar to > CursorAdaptor in VFP > Ed Leafe & Paul McNett have done marvelous work in this area (DABO > desktop framework).
> Regarding your remark of "Don't expect an instant answer"-- > -- OP was dated 30th June. > Today is 8th July (an instant???)
> Again, pl. excuse me if I have said anything wrong. > @qMax: Have you got any way around your question?
> ---Vineet
Hi Vineet
The problem both you and the OP have is that you asked extremely vague questions. I've re-read the OPs post a number of times, and all I can see is some extremely vague discussion on how the ORM represents tables as model instances. I still don't see a question there, or at least one I can answer.
Your question is only vaguely related to the OPs (in that it deals with the ORM). On mailing lists, some people find replying to another thread with a different question of your own almost as rude as TYPING IN ALL CAPS. It is best to start a new thread rather than hijacking someone elses. Secondly, continually bumping a thread each day is also very annoying. Both of these things will dissuade people from replying to you, so bear that in mind.
Netiquette apart, your question is vague. You describe a system where by you can update various tables, updating the ones you want. This is a basic feature of ORMs - have you read the tutorial or any of the documentation on django's ORM?
I think the basic point is that you are far too vague about what you want. You can't just point at us at some MS relational layer documentation from 2005 and expect us to wade through it, work out what you are currently doing, work out if that is applicable to Django's ORM and formulate a plan for you. You are going to need to do some of the work yourself.
There are more ORMs out there than you can imagine. You need to work out what you want from a framework, and evaluate the frameworks out there to find the suitable one for your project. We can help by telling you about the Django one, but you need to help by telling us what you want to do with it (consider creating, reading, updating and deleting items as something that all the frameworks will do).
I think you will find people here will be willing and responsive to help you, once you figure out what it is that you want from Django, and start asking precise questions about what Django can support.
> On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird <vineet.deod...@gmail.com> wrote:
> > @Cal,
> > My apologies if my post has hurted you.
> > I didn't mean that.
> > I understand that all these open source projects are run by people who
> > don't get paid for it.
> > My point was quite different. It was about knowledge sharing.
> > We can re-phrase the question if nobody understands what we mean to
> > ask.
> > Actually, we are not asking for any exact code or any spoon-feeding.
> > We are asking whether anybody has developed a solution similar to
> > CursorAdaptor in VFP
> > Ed Leafe & Paul McNett have done marvelous work in this area (DABO
> > desktop framework).
> > Regarding your remark of "Don't expect an instant answer"--
> > -- OP was dated 30th June.
> > Today is 8th July (an instant???)
> > Again, pl. excuse me if I have said anything wrong.
> > @qMax: Have you got any way around your question?
> > ---Vineet
> Hi Vineet
> The problem both you and the OP have is that you asked extremely vague
> questions. I've re-read the OPs post a number of times, and all I can
> see is some extremely vague discussion on how the ORM represents
> tables as model instances. I still don't see a question there, or at
> least one I can answer.
> Your question is only vaguely related to the OPs (in that it deals
> with the ORM). On mailing lists, some people find replying to another
> thread with a different question of your own almost as rude as TYPING
> IN ALL CAPS. It is best to start a new thread rather than hijacking
> someone elses. Secondly, continually bumping a thread each day is also
> very annoying. Both of these things will dissuade people from replying
> to you, so bear that in mind.
> Netiquette apart, your question is vague. You describe a system where
> by you can update various tables, updating the ones you want. This is
> a basic feature of ORMs - have you read the tutorial or any of the
> documentation on django's ORM?
> I think the basic point is that you are far too vague about what you
> want. You can't just point at us at some MS relational layer
> documentation from 2005 and expect us to wade through it, work out
> what you are currently doing, work out if that is applicable to
> Django's ORM and formulate a plan for you. You are going to need to do
> some of the work yourself.
> There are more ORMs out there than you can imagine. You need to work
> out what you want from a framework, and evaluate the frameworks out
> there to find the suitable one for your project. We can help by
> telling you about the Django one, but you need to help by telling us
> what you want to do with it (consider creating, reading, updating and
> deleting items as something that all the frameworks will do).
> I think you will find people here will be willing and responsive to
> help you, once you figure out what it is that you want from Django,
> and start asking precise questions about what Django can support.
There is a single form for handling tables "customer" and "custdetl".
Consider that a user wants to edit customer details in this form.
He changes groupid,
deletes phone number,
changes address,
adds city (earlier, it was left blank by user).
In effect, "customer" table should receive an update statement,
"custdetl" table should receive delete, update & insert statements.
Beforehand, we do not have any means to know what all interactions the
user will make.
My question is:--
Is there any generic way to do this in django?
OR
Is there any third party class (which can be imported in django)
available for catering to such a need?
> Although I have gone through the docs of Django ORM, let me re-read
> it.
> Then I will come back to this thread with specific question.
> Thanks for your reply.
> On Jul 8, 8:57 pm, Tom Evans <tevans...@googlemail.com> wrote:
> > On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird <vineet.deod...@gmail.com> wrote:
> > > @Cal,
> > > My apologies if my post has hurted you.
> > > I didn't mean that.
> > > I understand that all these open source projects are run by people who
> > > don't get paid for it.
> > > My point was quite different. It was about knowledge sharing.
> > > We can re-phrase the question if nobody understands what we mean to
> > > ask.
> > > Actually, we are not asking for any exact code or any spoon-feeding.
> > > We are asking whether anybody has developed a solution similar to
> > > CursorAdaptor in VFP
> > > Ed Leafe & Paul McNett have done marvelous work in this area (DABO
> > > desktop framework).
> > > Regarding your remark of "Don't expect an instant answer"--
> > > -- OP was dated 30th June.
> > > Today is 8th July (an instant???)
> > > Again, pl. excuse me if I have said anything wrong.
> > > @qMax: Have you got any way around your question?
> > > ---Vineet
> > Hi Vineet
> > The problem both you and the OP have is that you asked extremely vague
> > questions. I've re-read the OPs post a number of times, and all I can
> > see is some extremely vague discussion on how the ORM represents
> > tables as model instances. I still don't see a question there, or at
> > least one I can answer.
> > Your question is only vaguely related to the OPs (in that it deals
> > with the ORM). On mailing lists, some people find replying to another
> > thread with a different question of your own almost as rude as TYPING
> > IN ALL CAPS. It is best to start a new thread rather than hijacking
> > someone elses. Secondly, continually bumping a thread each day is also
> > very annoying. Both of these things will dissuade people from replying
> > to you, so bear that in mind.
> > Netiquette apart, your question is vague. You describe a system where
> > by you can update various tables, updating the ones you want. This is
> > a basic feature of ORMs - have you read the tutorial or any of the
> > documentation on django's ORM?
> > I think the basic point is that you are far too vague about what you
> > want. You can't just point at us at some MS relational layer
> > documentation from 2005 and expect us to wade through it, work out
> > what you are currently doing, work out if that is applicable to
> > Django's ORM and formulate a plan for you. You are going to need to do
> > some of the work yourself.
> > There are more ORMs out there than you can imagine. You need to work
> > out what you want from a framework, and evaluate the frameworks out
> > there to find the suitable one for your project. We can help by
> > telling you about the Django one, but you need to help by telling us
> > what you want to do with it (consider creating, reading, updating and
> > deleting items as something that all the frameworks will do).
> > I think you will find people here will be willing and responsive to
> > help you, once you figure out what it is that you want from Django,
> > and start asking precise questions about what Django can support.
Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Hummingbird Gesendet: Donnerstag, 14. Juli 2011 15:01 An: Django users Betreff: Re: Managing objects spred among several tables/databases.
Hi again ! I went through the docs of django again, but still could not find what I was looking for.
Definition of my problem (simplified version to keep this post short):
There is a single form for handling tables "customer" and "custdetl". Consider that a user wants to edit customer details in this form.
He changes groupid, deletes phone number, changes address, adds city (earlier, it was left blank by user).
In effect, "customer" table should receive an update statement, "custdetl" table should receive delete, update & insert statements.
Beforehand, we do not have any means to know what all interactions the user will make.
My question is:-- Is there any generic way to do this in django? OR Is there any third party class (which can be imported in django) available for catering to such a need?
> Although I have gone through the docs of Django ORM, let me re-read > it. > Then I will come back to this thread with specific question.
> Thanks for your reply.
> On Jul 8, 8:57 pm, Tom Evans <tevans...@googlemail.com> wrote:
> > On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > > > @Cal, > > > My apologies if my post has hurted you. > > > I didn't mean that. > > > I understand that all these open source projects are run by people who > > > don't get paid for it.
> > > My point was quite different. It was about knowledge sharing. > > > We can re-phrase the question if nobody understands what we mean to > > > ask. > > > Actually, we are not asking for any exact code or any spoon-feeding. > > > We are asking whether anybody has developed a solution similar to > > > CursorAdaptor in VFP > > > Ed Leafe & Paul McNett have done marvelous work in this area (DABO > > > desktop framework).
> > > Regarding your remark of "Don't expect an instant answer"-- > > > -- OP was dated 30th June. > > > Today is 8th July (an instant???)
> > > Again, pl. excuse me if I have said anything wrong. > > > @qMax: Have you got any way around your question?
> > > ---Vineet
> > Hi Vineet
> > The problem both you and the OP have is that you asked extremely vague > > questions. I've re-read the OPs post a number of times, and all I can > > see is some extremely vague discussion on how the ORM represents > > tables as model instances. I still don't see a question there, or at > > least one I can answer.
> > Your question is only vaguely related to the OPs (in that it deals > > with the ORM). On mailing lists, some people find replying to another > > thread with a different question of your own almost as rude as TYPING > > IN ALL CAPS. It is best to start a new thread rather than hijacking > > someone elses. Secondly, continually bumping a thread each day is also > > very annoying. Both of these things will dissuade people from replying > > to you, so bear that in mind.
> > Netiquette apart, your question is vague. You describe a system where > > by you can update various tables, updating the ones you want. This is > > a basic feature of ORMs - have you read the tutorial or any of the > > documentation on django's ORM?
> > I think the basic point is that you are far too vague about what you > > want. You can't just point at us at some MS relational layer > > documentation from 2005 and expect us to wade through it, work out > > what you are currently doing, work out if that is applicable to > > Django's ORM and formulate a plan for you. You are going to need to do > > some of the work yourself.
> > There are more ORMs out there than you can imagine. You need to work > > out what you want from a framework, and evaluate the frameworks out > > there to find the suitable one for your project. We can help by > > telling you about the Django one, but you need to help by telling us > > what you want to do with it (consider creating, reading, updating and > > deleting items as something that all the frameworks will do).
> > I think you will find people here will be willing and responsive to > > help you, once you figure out what it is that you want from Django, > > and start asking precise questions about what Django can support.
> > Cheers
> > Tom- Hide quoted text -
> - Show quoted text -
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
> There is a single form for handling tables "customer" and "custdetl". > Consider that a user wants to edit customer details in this form.
> He changes groupid, > deletes phone number, > changes address, > adds city (earlier, it was left blank by user).
> In effect, "customer" table should receive an update statement, > "custdetl" table should receive delete, update & insert statements.
This is the part I have trouble keeping up. Why should it need one DELETE, one UPDATE and one INSERT? All of that can be done with one single UPDATE statement in terms of UPDATE custdetl SET tel = NULL, address = <new address>, CITY = <new city> WHERE custid = <some ID>; Why on earth would you delete a row and then insert a row again? By issuing a DELETE you don't clear the value of a single column, you remove entire rows from the table. Same with INSERT.
So either you just use one single UPDATE (which is perfectly fine with Django and if you use a ModelForm it is as easy as calling my_form.save()) or we're not talking about three tables with columns as you described but something much more complicated.
As you say, in this case,
"UPDATE custdetl SET tel = NULL, address = <new address>, CITY = <new
city>
WHERE custid = <some ID>"
is fine in this simplified version.
Suppose when a user removes address, tel, city from table 'custdetl'.
When fields are not nullable (not null=true),
Then update won't do the job.
We NEED to delete the row.
Similarly regarding inserts.
If there is no row in 'custdetl' previously, then user interacts the
form & adds the details, then we NEED insert statement.
In actual project, I have individual forms handling as many as >10
linked tables.
I need to issue insert/update/delete statements to different tables.
Any idea how to go about it?
Thanks.
(p.s. : If you want, I will post one elaborate example.)
On Jul 14, 6:35 pm, Michal Petrucha <michal.petru...@ksp.sk> wrote:
> > There is a single form for handling tables "customer" and "custdetl".
> > Consider that a user wants to edit customer details in this form.
> > He changes groupid,
> > deletes phone number,
> > changes address,
> > adds city (earlier, it was left blank by user).
> > In effect, "customer" table should receive an update statement,
> > "custdetl" table should receive delete, update & insert statements.
> This is the part I have trouble keeping up. Why should it need one
> DELETE, one UPDATE and one INSERT? All of that can be done with one
> single UPDATE statement in terms of
> UPDATE custdetl SET tel = NULL, address = <new address>, CITY = <new city>
> WHERE custid = <some ID>;
> Why on earth would you delete a row and then insert a row again? By
> issuing a DELETE you don't clear the value of a single column, you
> remove entire rows from the table. Same with INSERT.
> So either you just use one single UPDATE (which is perfectly fine with
> Django and if you use a ModelForm it is as easy as calling
> my_form.save()) or we're not talking about three tables with columns
> as you described but something much more complicated.
> Michal
> signature.asc
> < 1KViewDownload- Hide quoted text -
On Thu, Jul 14, 2011 at 07:20:12AM -0700, Hummingbird wrote: > Maybe, I didn't explain the condition properely.
> As you say, in this case, > "UPDATE custdetl SET tel = NULL, address = <new address>, CITY = <new > city> > WHERE custid = <some ID>" > is fine in this simplified version.
> Suppose when a user removes address, tel, city from table 'custdetl'. > When fields are not nullable (not null=true), > Then update won't do the job. > We NEED to delete the row.
Maybe it is just me, but still, if the fields are not nullable, then the user cannot clear his phone number while keeping the rest of his info there -- either you delete his entire row or you keep something in each column. Either way, you won't be able to accomplish what you wrote in the previous e-mail.
> Similarly regarding inserts. > If there is no row in 'custdetl' previously, then user interacts the > form & adds the details, then we NEED insert statement.
This all depends on the primary key of the table -- if there is no row with the specified primary key, Django INSERTs one, otherwise it does an UPDATE.
In your case I can imagine having custid as the primary key. That way, if you fill out a form for a customer whose details are not in the table, they get inserted; otherwise they are updated.
> In actual project, I have individual forms handling as many as >10 > linked tables. > I need to issue insert/update/delete statements to different tables. > Any idea how to go about it?
This should be perfectly achievable using formsets. The Django admin implements this via a mechanism called "InlineAdmin" which is in fact just a bit of sugar around regular formsets.
> (p.s. : If you want, I will post one elaborate example.)
Dunno, that might help; from the one you supplied thus far it is really not clear what you want to accomplish.
On Thu, Jul 14, 2011 at 5:11 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > What I want to accomplish from these tables is as given below.
> All the customer data can be maintained in a single table. > i.e. customer(custid, custname, groupid, address, tel, mobile, city)
> In the course of normalising the database, we arrived at defining 2 > tables. > "customer" table maintaining basic data like name, group, etc. > "custdetl" table containing other details of customer.
> A row in custdetl will be created only if there is any data like > address, tel, etc. for a customer. > (of course, I need not dive into normalisation concept here).
> As I said earlier, there are much complex examples of "single form : > many tables" in my actual project
> Thanks.
All of this easily doable in django.
Typically when handling forms for editing models, you would create a ModelForm, which represents one specific model/table. However, you can include as many ModelForms as you want within one <form>.
A good (and complex) example of this is django's admin system which allows you to include other models 'inline' when editing a related model. I think an earlier respondent alluded to this.
Did you have specific questions? Django is quite easy to use and quick to prototype in, perhaps you should try implementing a prototype in django to see if it does suit your needs, asking questions on here when you get stuck.
I am presently using web2py.
Before getting the feet wet in django, I am trying to assess whether
the functionality I mentioned in earlier reply is already built-in in
django, by consulting the list-users.
If this is doable, I would happily dive into django.
That's why I did not go into actual coding with django, but asking
questions like "can I do thing-1, thing-2, etc."
Thanks.
On Jul 14, 9:26 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Thu, Jul 14, 2011 at 5:11 PM, Hummingbird <vineet.deod...@gmail.com> wrote:
> > What I want to accomplish from these tables is as given below.
> > All the customer data can be maintained in a single table.
> > i.e. customer(custid, custname, groupid, address, tel, mobile, city)
> > In the course of normalising the database, we arrived at defining 2
> > tables.
> > "customer" table maintaining basic data like name, group, etc.
> > "custdetl" table containing other details of customer.
> > A row in custdetl will be created only if there is any data like
> > address, tel, etc. for a customer.
> > (of course, I need not dive into normalisation concept here).
> > As I said earlier, there are much complex examples of "single form :
> > many tables" in my actual project
> > Thanks.
> All of this easily doable in django.
> Typically when handling forms for editing models, you would create a
> ModelForm, which represents one specific model/table. However, you can
> include as many ModelForms as you want within one <form>.
> A good (and complex) example of this is django's admin system which
> allows you to include other models 'inline' when editing a related
> model. I think an earlier respondent alluded to this.
> Did you have specific questions? Django is quite easy to use and quick
> to prototype in, perhaps you should try implementing a prototype in
> django to see if it does suit your needs, asking questions on here
> when you get stuck.
On Thu, Jul 14, 2011 at 5:34 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > I am presently using web2py. > Before getting the feet wet in django, I am trying to assess whether > the functionality I mentioned in earlier reply is already built-in in > django, by consulting the list-users. > If this is doable, I would happily dive into django. > That's why I did not go into actual coding with django, but asking > questions like "can I do thing-1, thing-2, etc."
As I often tell my boss, this is software development, we can do anything*.
Developing a prototype, even spending just an hour defining the models and playing around in the admin (so no real coding) would tell you whether to proceed or not. But it's your choice, I guess we'll have another two weeks of 'interesting' questions.
> On Thu, Jul 14, 2011 at 5:34 PM, Hummingbird <vineet.deod...@gmail.com> wrote:
> > I am presently using web2py.
> > Before getting the feet wet in django, I am trying to assess whether
> > the functionality I mentioned in earlier reply is already built-in in
> > django, by consulting the list-users.
> > If this is doable, I would happily dive into django.
> > That's why I did not go into actual coding with django, but asking
> > questions like "can I do thing-1, thing-2, etc."
> As I often tell my boss, this is software development, we can do anything*.
> Developing a prototype, even spending just an hour defining the models
> and playing around in the admin (so no real coding) would tell you
> whether to proceed or not. But it's your choice, I guess we'll have
> another two weeks of 'interesting' questions.
On Thu, Jul 14, 2011 at 12:06 PM, Hummingbird <vineet.deod...@gmail.com> wrote: > All right Tom. > Let me look into admin. > Then perhaps I would require the help from list.
I (like everybody else here) don't want to sound rude; but i don't think you'll get anywhere with this approach.
Django is a big framework, just reading random doc sections won't tell you about the 'big picture'. without a good idea of what is there, how parts fit and how to approach your problem(s), you won't be able to ask the right questions.
far better is to do what was suggested to you long ago: do the tutorial.
before you finish it, you'll see why your questions are unanswerable, and if you like Django or not.