Python Forum
Displaying search results
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Displaying search results
#24
(Jun-16-2020, 07:44 AM)ndc85430 Wrote:
(Jun-16-2020, 07:34 AM)card51shor Wrote: Is there any easier way you guys can think of? I have about 14 days to finish this and I can't start learning whole new languages like Jinga and doing long tutorials. This is already basically a tutorial that I'm doing to learn python!

If you're doing some kind of course, haven't you learnt the stuff you need? If you're really struggling, perhaps you should speak to your course leaders about it.

The modern way of dynamically creating web pages is to use templates and I've explained the reasons for that above. I'm not familiar with PHP or JS stacks, but I'd be very surprised if they didn't do things this way. I've built web apps for quite a while in different technologies (Python and on the JVM (Java, Scala, Kotlin, Clojure)) and the basic idea is the same.

No I'm just doing a project I found online for Python to teach myself. I already know javascript and php for web development. I'm just trying to challenge myself. I understand the concepts of reiterating through arrays and lists and all that so i understand the code when I see it - I'm just baffled by the sql + python syntax and the lack of information i can find.

All I need to know is the syntax and I can write the code I need to. I'm just getting very frustrated every night I try to use the little time I have to get this problem solved and it's just always another page of documentation that helps me a little bit but ultimately needs to be changed too much to fit my project and I can never find out how.

It's taken me 6 weeks to write the code I have which has a registration page and a login. Now I have the search working but I need it to print out the results and have a clickable link.

(Jun-16-2020, 07:56 AM)buran Wrote: Dude, giving negative rating/reputation for this post is utterly ridiculous. Especially when your answer starts with
(Jun-16-2020, 06:54 AM)card51shor Wrote: OK that makes sense - thank you.

everyone else is giving me bad ratings.

(Jun-16-2020, 07:56 AM)ndc85430 Wrote:
(Jun-16-2020, 07:51 AM)card51shor Wrote: For instance - here are the questions that I now have:

1) Where in this website is the form that we are getting the user values from?

2) what is .href? What is .caption?

3) How am I getting the data from a sql search inputted into this html page?

Again, you seem to be missing some of the point. The template is only about presenting the data to the user. It seems to be a results page of sorts. Where the data comes from is not the concern of the template - the database query or whatever else should be done in your handler and that's also where you'll get the data from the form, like you're doing (remember: separation of concerns).

The page does make reference (in bold, no less!) to variables and expressions and links further down do tell you what the syntax means and how to use it (e.g. "{% ... %} for Statements"). Did you try going through that?

I tried going through it and just got stuck and had more questions and didn't want to continue. I can try to read it again though tomorrow.

<ul id="navigation">
    {% for item in navigation %}
        <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
    {% endfor %}
    </ul>
so all i have to do is add this code to my html page and suddenly it will print out the results? How is it linked to my "b" variable in python?
Reply


Messages In This Thread
Displaying search results - by card51shor - Jun-16-2020, 05:37 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 06:04 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:06 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 06:14 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:19 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 06:20 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:23 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 06:24 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:26 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 06:29 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:36 AM
RE: Displaying search results - by buran - Jun-16-2020, 06:49 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 06:54 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 07:11 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 07:20 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 07:28 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 07:34 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 07:44 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 07:58 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 08:34 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 03:29 PM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 08:01 PM
RE: Displaying search results - by card51shor - Jun-16-2020, 08:36 PM
RE: Displaying search results - by card51shor - Jun-17-2020, 12:41 AM
RE: Displaying search results - by SheeppOSU - Jun-16-2020, 07:40 AM
RE: Displaying search results - by card51shor - Jun-16-2020, 07:51 AM
RE: Displaying search results - by ndc85430 - Jun-16-2020, 07:56 AM
RE: Displaying search results - by buran - Jun-16-2020, 07:50 AM
RE: Displaying search results - by buran - Jun-16-2020, 07:56 AM
RE: Displaying search results - by SheeppOSU - Jun-16-2020, 08:37 AM
RE: Displaying search results - by pyzyx3qwerty - Jun-16-2020, 04:26 PM
RE: Displaying search results - by pyzyx3qwerty - Jun-17-2020, 02:01 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 02:41 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 04:35 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 05:18 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 05:29 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 05:41 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 05:42 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 05:51 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 06:18 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 06:32 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 06:33 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 06:35 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 06:43 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 06:44 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 07:28 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 07:38 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 07:49 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 07:55 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 08:06 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 08:12 AM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 08:15 AM
RE: Displaying search results - by card51shor - Jun-17-2020, 08:18 AM
RE: Displaying search results - by SheeppOSU - Jun-17-2020, 03:22 PM
RE: Displaying search results - by card51shor - Jun-17-2020, 04:04 PM
RE: Displaying search results - by ndc85430 - Jun-17-2020, 05:29 PM
RE: Displaying search results - by card51shor - Jun-17-2020, 05:44 PM
RE: Displaying search results - by ndc85430 - Jun-18-2020, 04:23 AM
RE: Displaying search results - by card51shor - Jun-18-2020, 04:54 AM
RE: Displaying search results - by ndc85430 - Jun-18-2020, 05:01 AM
RE: Displaying search results - by card51shor - Jun-18-2020, 05:33 AM
RE: Displaying search results - by ndc85430 - Jun-18-2020, 05:43 AM
RE: Displaying search results - by card51shor - Jun-18-2020, 05:52 AM
RE: Displaying search results - by ndc85430 - Jun-18-2020, 05:56 AM
RE: Displaying search results - by card51shor - Jun-18-2020, 05:58 AM
RE: Displaying search results - by ndc85430 - Jun-18-2020, 05:59 AM
RE: Displaying search results - by card51shor - Jun-18-2020, 06:35 AM
RE: Displaying search results - by ndc85430 - Jun-19-2020, 05:40 AM
RE: Displaying search results - by card51shor - Jun-19-2020, 07:01 AM
RE: Displaying search results - by card51shor - Jun-19-2020, 09:59 PM
RE: Displaying search results - by ndc85430 - Jun-20-2020, 05:47 AM
RE: Displaying search results - by card51shor - Jun-20-2020, 07:43 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 12:38 AM
RE: Displaying search results - by ndc85430 - Jun-21-2020, 05:06 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 05:25 AM
RE: Displaying search results - by ndc85430 - Jun-21-2020, 05:44 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 05:45 AM
RE: Displaying search results - by ndc85430 - Jun-21-2020, 05:47 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 05:48 AM
RE: Displaying search results - by ndc85430 - Jun-21-2020, 05:56 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 06:00 AM
RE: Displaying search results - by ndc85430 - Jun-21-2020, 06:00 AM
RE: Displaying search results - by card51shor - Jun-21-2020, 06:08 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020