Re: Django way to design this model
Point 4 above is a little ambiguous: >4. Move the queries you've created to a view that renders results to >a template. If you start doing this by accepting GET parameters and >displaying the search results through the template, you can get the >query functionality working and test it by changing the URL before >creating the actual search form. Can anyone help out? thanks in advance. Divesh On Jul 9, 1:58 pm, Divesh Gidwaniwrote: > Thanks so much for all the advice.. Yes, you are right, a lot of it > sounds like rubbish, and i'm just lost! Yes, I am going to finish up > the tutorial today, and read up on the documentation. > > Thanks so much for your help. I will surely keep you updated on how > things go! > > Much appreciated once again. > > -Divesh > > On Jul 9, 1:45 pm, Friðrik Már Jónsson wrote: > > > > > HiDivesh, > > > > I have this model that I want to design on Django. I have already > > > created the mysql side of it, and the mysql database is ready. Also, i > > > have loaded mysqldb and i think it works. > > > It sounds like you've created something with MySQL and imported it to > > a database that's used by Django. This is not the same as creating > > actual models in your `models.py` file, which is required if you want > > to make use of Django's querying methods. > > > > (Species 1 & 2). And then you write a view, that will do the searching > > > according parameters (Tolerance, pagination, species 1&2) > > > > So I have to create something like the website above on Django. Was > > > just wondering if there was any easy way of doing this.. I don't fully > > > understand Django yet, and am not sure if have to make a form or > > > what? I'm really confused. > > > > Basically what I want to do is create that type of a site, with only > > > one species, and then have it such that when you click the radio > > > button next to one species, it shows you what that species corresponds > > > to in the mysql database. > > > You need to take this one step at a time. You seem to be mixing model > > creation (defining the data structure) with writing views and > > templates (the radio button, pagination, criteria). > > > 1. Design the model[1] to the specification that is your current > > MySQL schema. > > 2. Fill the model with some test data[2]. > > 3. Use the shell to try to retrieve the objects[3] according to the > > criteria you would get from your user through the view. > > 4. Move the queries you've created to a view that renders results to > > a template. If you start doing this by accepting GET parameters and > > displaying the search results through the template, you can get the > > query functionality working and test it by changing the URL before > > creating the actual search form. > > 5. Create the search form, probably using `django.forms`[4] and use > > a `ChoiceField(widget=RadioSelect, choices=...)`[5] to present the > > options to users. > > > If this is all sounding like nonsese to you, it probably means you > > should spend some time reading up on Django's excellent documentation, > > and if you haven't already, finish the tutorial. > > > Regards, > > Friðrik Már > > > [1]http://docs.djangoproject.com/en/dev/topics/db/models/ > > > > [2]http://docs.djangoproject.com/en/dev/topics/db/queries/#creating-objects > > > > [3]http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-ob... > > [4]http://docs.djangoproject.com/en/dev/topics/forms/ > > > > [5]http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django way to design this model
Thanks so much for all the advice.. Yes, you are right, a lot of it sounds like rubbish, and i'm just lost! Yes, I am going to finish up the tutorial today, and read up on the documentation. Thanks so much for your help. I will surely keep you updated on how things go! Much appreciated once again. -Divesh On Jul 9, 1:45 pm, Friðrik Már Jónssonwrote: > Hi Divesh, > > > I have this model that I want to design on Django. I have already > > created the mysql side of it, and the mysql database is ready. Also, i > > have loaded mysqldb and i think it works. > > It sounds like you've created something with MySQL and imported it to > a database that's used by Django. This is not the same as creating > actual models in your `models.py` file, which is required if you want > to make use of Django's querying methods. > > > (Species 1 & 2). And then you write a view, that will do the searching > > according parameters (Tolerance, pagination, species 1&2) > > > So I have to create something like the website above on Django. Was > > just wondering if there was any easy way of doing this.. I don't fully > > understand Django yet, and am not sure if have to make a form or > > what? I'm really confused. > > > Basically what I want to do is create that type of a site, with only > > one species, and then have it such that when you click the radio > > button next to one species, it shows you what that species corresponds > > to in the mysql database. > > You need to take this one step at a time. You seem to be mixing model > creation (defining the data structure) with writing views and > templates (the radio button, pagination, criteria). > > 1. Design the model[1] to the specification that is your current > MySQL schema. > 2. Fill the model with some test data[2]. > 3. Use the shell to try to retrieve the objects[3] according to the > criteria you would get from your user through the view. > 4. Move the queries you've created to a view that renders results to > a template. If you start doing this by accepting GET parameters and > displaying the search results through the template, you can get the > query functionality working and test it by changing the URL before > creating the actual search form. > 5. Create the search form, probably using `django.forms`[4] and use > a `ChoiceField(widget=RadioSelect, choices=...)`[5] to present the > options to users. > > If this is all sounding like nonsese to you, it probably means you > should spend some time reading up on Django's excellent documentation, > and if you haven't already, finish the tutorial. > > Regards, > Friðrik Már > > [1]http://docs.djangoproject.com/en/dev/topics/db/models/ > [2]http://docs.djangoproject.com/en/dev/topics/db/queries/#creating-objects > [3]http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-ob... > [4]http://docs.djangoproject.com/en/dev/topics/forms/ > [5]http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django way to design this model
Hi Divesh, > I have this model that I want to design on Django. I have already > created the mysql side of it, and the mysql database is ready. Also, i > have loaded mysqldb and i think it works. It sounds like you've created something with MySQL and imported it to a database that's used by Django. This is not the same as creating actual models in your `models.py` file, which is required if you want to make use of Django's querying methods. > (Species 1 & 2). And then you write a view, that will do the searching > according parameters (Tolerance, pagination, species 1&2) > > So I have to create something like the website above on Django. Was > just wondering if there was any easy way of doing this.. I don't fully > understand Django yet, and am not sure if have to make a form or > what? I'm really confused. > > Basically what I want to do is create that type of a site, with only > one species, and then have it such that when you click the radio > button next to one species, it shows you what that species corresponds > to in the mysql database. You need to take this one step at a time. You seem to be mixing model creation (defining the data structure) with writing views and templates (the radio button, pagination, criteria). 1. Design the model[1] to the specification that is your current MySQL schema. 2. Fill the model with some test data[2]. 3. Use the shell to try to retrieve the objects[3] according to the criteria you would get from your user through the view. 4. Move the queries you've created to a view that renders results to a template. If you start doing this by accepting GET parameters and displaying the search results through the template, you can get the query functionality working and test it by changing the URL before creating the actual search form. 5. Create the search form, probably using `django.forms`[4] and use a `ChoiceField(widget=RadioSelect, choices=...)`[5] to present the options to users. If this is all sounding like nonsese to you, it probably means you should spend some time reading up on Django's excellent documentation, and if you haven't already, finish the tutorial. Regards, Friðrik Már [1] http://docs.djangoproject.com/en/dev/topics/db/models/ [2] http://docs.djangoproject.com/en/dev/topics/db/queries/#creating-objects [3] http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-objects [4] http://docs.djangoproject.com/en/dev/topics/forms/ [5] http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.RadioSelect --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django way to design this model
>Don't know if i understand you right, but you have to create two models (Species 1 & 2). And then you write a view, that will do the searching according parameters (Tolerance, pagination, species 1&2) So I have to create something like the website above on Django. Was just wondering if there was any easy way of doing this.. I don't fully understand Django yet, and am not sure if have to make a form or what? I'm really confused. Basically what I want to do is create that type of a site, with only one species, and then have it such that when you click the radio button next to one species, it shows you what that species corresponds to in the mysql database. Thanks for your help guys. On Jul 9, 1:32 am, urukay <radovan.be...@gmail.com> wrote: > Don't know if i understand you right, but you have to create two models > (Species 1 & 2). And then you write a view, that will do the searching > according parameters (Tolerance, pagination, species 1&2) > > But more details would help definetely. > > R. > > > > Divesh Gidwani wrote: > > > Hey, > > > Newbie toDjango, and have just finished part 2 of the tutorial on the > > website, and need to speed up with work in the office. > > > I have this model that I want to design onDjango. I have already > > created the mysql side of it, and the mysql database is ready. Also, i > > have loaded mysqldb and i think it works. > > > This is the model I have to follow: > > >http://gomezlab.bme.unc.edu:8080/~kdauria/search.php > > > How can I get those radio button like search fields? How to bring up > > the search? > > > Any suggestions, or resources would be helpful. > > > Thanks in advance! > > -- > View this message in > context:http://www.nabble.com/Django-way-to-design-this-model-tp24397321p2440... > Sent from thedjango-users mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django way to design this model
Don't know if i understand you right, but you have to create two models (Species 1 & 2). And then you write a view, that will do the searching according parameters (Tolerance, pagination, species 1&2) But more details would help definetely. R. Divesh Gidwani wrote: > > > Hey, > > Newbie to Django, and have just finished part 2 of the tutorial on the > website, and need to speed up with work in the office. > > I have this model that I want to design on Django. I have already > created the mysql side of it, and the mysql database is ready. Also, i > have loaded mysqldb and i think it works. > > This is the model I have to follow: > > http://gomezlab.bme.unc.edu:8080/~kdauria/search.php > > How can I get those radio button like search fields? How to bring up > the search? > > Any suggestions, or resources would be helpful. > > Thanks in advance! > > > > -- View this message in context: http://www.nabble.com/Django-way-to-design-this-model-tp24397321p24404256.html Sent from the django-users mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django way to design this model
Mhh... I don't fully understand your question. Regarding the radio buttons I think it is in the tutorial. What search fields are you talking about? Juan Pablo 2009/7/8 Divesh Gidwani: > > Hey, > > Newbie to Django, and have just finished part 2 of the tutorial on the > website, and need to speed up with work in the office. > > I have this model that I want to design on Django. I have already > created the mysql side of it, and the mysql database is ready. Also, i > have loaded mysqldb and i think it works. > > This is the model I have to follow: > > http://gomezlab.bme.unc.edu:8080/~kdauria/search.php > > How can I get those radio button like search fields? How to bring up > the search? > > Any suggestions, or resources would be helpful. > > Thanks in advance! > > > --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django way to design this model
Hey, Newbie to Django, and have just finished part 2 of the tutorial on the website, and need to speed up with work in the office. I have this model that I want to design on Django. I have already created the mysql side of it, and the mysql database is ready. Also, i have loaded mysqldb and i think it works. This is the model I have to follow: http://gomezlab.bme.unc.edu:8080/~kdauria/search.php How can I get those radio button like search fields? How to bring up the search? Any suggestions, or resources would be helpful. Thanks in advance! --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---