Django making box

13 views
Skip to first unread message

Sophia

unread,
Mar 13, 2012, 7:45:25 PM3/13/12
to django...@googlegroups.com
Hi guys,

I'm completely a beginner in writing Django codes, I read the book online for Django, so I have some basic knowledge about it.
The task that I should do is to click on a box and it generates new boxes above it by every clicking on it. I  actually wrote in HTML how to make boxes, but my problem is that I have no idea how to do the task I've mentioned earlier. I would really appreciate if you just give me a hint or a link to guide me about this, because I really confused.

Thanks in advance.
Sophia

Sandro Dutra

unread,
Mar 13, 2012, 7:58:53 PM3/13/12
to django...@googlegroups.com
"The task that I should do is to click on a box and it generates new boxes above it by every clicking on it."
I think JavaScript (jQuery) is the best option to achieve this.

2012/3/13 Sophia <b.mirsh...@gmail.com>

Sophia

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pZQOIyr8LKAJ.
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.

Joel Goldstick

unread,
Mar 13, 2012, 8:10:15 PM3/13/12
to django...@googlegroups.com

You might like to go to the django site: https://docs.djangoproject.com/en/1.3/

and go through the tutorial links. It takes a couple of hours, and is
well worth the effort to get a handle on how the pieces of Django fit
together.

But the task you mentioned in your post sounds like a javascript
project rather than something you would do on the server.

If you are also new to programming in python and want to learn more
about the language try the python-tutor mailing list

--
Joel Goldstick

Sophia

unread,
Mar 13, 2012, 8:37:57 PM3/13/12
to django...@googlegroups.com
Thanks all for helping, as I told I read that tutorial, but my supervisor said that I should do that with Django. He didn't mention about learning  JavaScript, but is it impossible just with Django?

Sophia

Javier Guerra Giraldez

unread,
Mar 13, 2012, 8:54:00 PM3/13/12
to django...@googlegroups.com
On Tue, Mar 13, 2012 at 3:37 PM, Sophia <b.mirsh...@gmail.com> wrote:
> Thanks all for helping, as I told I read that tutorial, but my supervisor
> said that I should do that with Django. He didn't mention about learning
> JavaScript, but is it impossible just with Django?

django runs on the server. if you want to do some client processing
you need code running on the client, typically Javascript.

of course that code is served from a Django app, and modifying a
django-handled page and form, so the project in a whole is still 'done
with Django'.

--
Javier

creecode

unread,
Mar 13, 2012, 9:13:25 PM3/13/12
to django...@googlegroups.com
Hello Sophia,


On Tuesday, March 13, 2012 1:37:57 PM UTC-7, Sophia wrote:
Thanks all for helping, as I told I read that tutorial, but my supervisor said that I should do that with Django. He didn't mention about learning  JavaScript, but is it impossible just with Django?

I don't think it would be impossible to do it all in Django.  If you do it solely with Django you would need your box to act like a submit button on a form so that you can have the Django server do something in response to a form submission.

But without a clearer definition of how you want your app to behave it will be hard for us to give you more insight into how you might proceed.

When you say supervisor said is shoul be done in Django is that a supervisor as in teacher?  Or supervisor as your superior at work?

Toodle-looooooooo..........
creecode


Sophia

unread,
Mar 13, 2012, 9:31:13 PM3/13/12
to django...@googlegroups.com
Thanks for answering, I meant supervisor for my internship. Actually it's a task that should be done for my internship.
This is exactly what he said: clicking on one box to generate new boxes and then we should enter data into them.
He just ask us to learn Python, and Django besides HTML and CSS to complete the work!

Sophia

unread,
Mar 13, 2012, 9:34:56 PM3/13/12
to django...@googlegroups.com
Thanks for the help, actually it should be run just on my computer not the client.

Anurag Chourasia

unread,
Mar 13, 2012, 9:42:13 PM3/13/12
to django...@googlegroups.com, b.mirsh...@gmail.com
What Javier meant in his previous message was a client application .....which of course could be a browser running on your own computer. 

For a better understanding of client/server model you could review the Wikipedia page


Regards,
Guddu

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IRJ8PvQXRdEJ.

Larry Martell

unread,
Mar 13, 2012, 9:44:22 PM3/13/12
to django...@googlegroups.com
On Tue, Mar 13, 2012 at 3:34 PM, Sophia <b.mirsh...@gmail.com> wrote:
> Thanks for the help, actually it should be run just on my computer not the
> client.

In this context the client is the browser.

>
> On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote:
>>
>> On Tue, Mar 13, 2012 at 3:37 PM, Sophia <b.mirsh...@gmail.com> wrote:
>> > Thanks all for helping, as I told I read that tutorial, but my
>> > supervisor
>> > said that I should do that with Django. He didn't mention about learning
>> > JavaScript, but is it impossible just with Django?
>>
>> django runs on the server.  if you want to do some client processing
>> you need code running on the client, typically Javascript.
>>
>> of course that code is served from a Django app, and modifying a
>> django-handled page and form, so the project in a whole is still 'done
>> with Django'.
>>
>> --
>> Javier
>

Message has been deleted

Sandro Dutra

unread,
Mar 14, 2012, 12:07:25 PM3/14/12
to django...@googlegroups.com
A little hardcoding, but I think this is a solution to your problem, if you want can deploy with Django...

<!doctype HTML>
<html>
<head>
    <title>Box Test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('input[type="button"]').click(function(){
                $("form").before('<input type="text" name="box" /><br />');
            });
        })
    </script>
</head>
<body>
    <form>
        <input type="text" name="box" />
        <input type="button" value="DO" />
    </form>
</body>
</html>

2012/3/13 Dennis Lee Bieber <wlf...@ix.netcom.com>
On Tue, 13 Mar 2012 14:31:13 -0700 (PDT), Sophia
<b.mirsh...@gmail.com> declaimed the following in
gmane.comp.python.django.user:


> Thanks for answering, I meant supervisor for my internship. Actually it's a
> task that should be done for my internship.
> This is exactly what he said: clicking on one box to generate new boxes and
> then we should enter data into them.
> He just ask us to learn Python, and Django besides HTML and CSS to complete
> the work!
>

       "and then we should enter data into them"

is the key phrase...

       You are basically describing a form containing something like a
"submit" /button/ (not box) where clicking on the button causes the
server to present another page which is a form with text entry fields
(and probably another "submit" button to send the filled in form back to
the server so the data can be saved somewhere)

{Note: the first "submit" button doesn't even need to be a button -- a
simple graphic image tied to an <a href=...> link would be sufficient
for something that doesn't need to send any particular data}

--
       Wulfraed                 Dennis Lee Bieber         AF6VN
       wlf...@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
Reply all
Reply to author
Forward
0 new messages