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:
https://code.djangoproject.com/wiki/UsingTheMailingList
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
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@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
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
Are those tables somehow related to each other per FK ?!
In that case i think you might be able to use a model form for that purpose.
I'm not really good with django myself so i might be talking bs.
. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
XSLT Developer
LexisNexis
Marxergasse 25, 1030 Wien
mailto:patric...@lexisnexis.at
Tel.: 00431 534521573
Fax: +43 (1) 534 52 - 146
-----Ursprüngliche Nachricht-----
--
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
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.
Michal
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.
Cheers
Tom
Let me answer all of them up front:
thing-1: yes
thing-2: yes
thing-3: yes
thing-N: yes
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.
Tom
* (given enough time and resource)
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.
--
Javier
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.