Python Forum
[PyQt] to display cotent of database between two dates
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] to display cotent of database between two dates
#5
@atlass218 I know I am weighing in on this a bit late but you do not want to reference you database backend from your Gui frontend (lookup MVC methodology). Further when building your database interface in pure python it is best to build it as a self-contained autonomous class that handles everything more generically and then all your frontend does is call preconfigured Methods passing in any parameters in as a dictionary that the database might need to use in the query. If you would like to see a templated version of this I have one that I share with my students that I can share with you as well

As far as dates go if they are stored as a DateTime object then they are without formatting and are stored as the number of seconds from a base date when you ask it to format that and give it a format it converts it. So unless you need to display the data you should never format it just leave it in its native state. And never work with the formatted version unless you are getting one from the User in which case its best to force the formatting you want or break the fields up in 3 separate entities and then behind the scenes do the conversion you self into a native DateTime object. I hope that helps you.
Reply


Messages In This Thread
RE: to display cotent of database between two dates - by Denni - Dec-26-2019, 03:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Display and update the label text which display the serial value jenkins43 5 9,102 Feb-04-2019, 04:36 AM
Last Post: Larz60+
  Display more than one button in GUI to display MPU6000 Sensor readings barry76 4 3,903 Jan-05-2019, 01:48 PM
Last Post: wuf

Forum Jump:

User Panel Messages

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