Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit Account Window #42

Closed
karastoyanov opened this issue May 30, 2023 · 5 comments
Closed

Edit Account Window #42

karastoyanov opened this issue May 30, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request pyqt-gui QT Graphical User Interface

Comments

@karastoyanov
Copy link
Member

karastoyanov commented May 30, 2023

Basic Edit Account functionality implemented in a separate window

@karastoyanov karastoyanov converted this from a draft issue May 30, 2023
@karastoyanov karastoyanov self-assigned this May 30, 2023
@karastoyanov karastoyanov added enhancement New feature or request pyqt-gui QT Graphical User Interface labels May 30, 2023
@karastoyanov karastoyanov changed the title edit_account window Edit Account Window May 30, 2023
@karastoyanov karastoyanov moved this from Todo to In Progress in First Stable Version - market-app May 30, 2023
@karastoyanov
Copy link
Member Author

Last update: 27fc837

  • user settings function implemented
  • the function replaces categories groupbox with user settings groupbox on call
  • deleteLater method implementation

@karastoyanov karastoyanov added this to the Main Menu Window milestone May 31, 2023
@karastoyanov
Copy link
Member Author

Last update: e7a13ba

  • show/hide different groupbox on QGridLayout(1,1)
  • use separate global function and call .show / .hide methods for the respective groupboxes
     """BRING BACK THE CATEGORIES - CALL THE GLOBAL FUNCTION"""
        def open_categories():
            hide_user_update_settings()
          """THIS FUNCTION IS USED TO HIDE THE UPDATE USER SETTIGNS GROUPBOX AND SHOW AGAIN CATEGORIES"""
          global hide_user_update_settings
          def hide_user_update_settings():
              update_user_settings_groupbox.hide()
              categories_groupbox.show()

@karastoyanov
Copy link
Member Author

Last update: c937fae

  • Text Labels and Line Edit Labels fixed
  • user_id and username cannot be modified, all other fields can be changed
  • new buttons added --> Reset to defaults will call once again the open_update_account() function and wll restore the current data from the database. Update will upload the current data from the fields into the database --> not implemented

Image

@karastoyanov
Copy link
Member Author

Last update: 30958cd

  • Update user data function created, but not fully implemented. The fucntion still takes the old data from QLineEdit objects and doesn't register the new data from the fields. Further improvment is needed
            # Not fully implemented, fucntion is still taking old data from qlineedit's
            def update_user():
                user_data = []
                # Make this query dynamically accepting the username in production
                update_user_query = (f"UPDATE customers SET first_name = %s, last_name = %s, phone = %s, email_address = %s WHERE username = 'pesho'")
                postgres_conn.POSTGRES_CURSOR.execute(update_user_query, (user_data[0], user_data[1], user_data[2], user_data[3]))
                postgres_conn.POSTGRES_CONNECTION.commit()

@karastoyanov
Copy link
Member Author

Last update: 1ce241d

  • Update User Data fully implemented
  • user_data array should be created inside the open_update_account() function and append only the QLineEdit's as object not text strings
user_data.append(current_line_edit)

In the query call the .text() for the specific QLineEdit object

postgres_conn.POSTGRES_CURSOR.execute(update_user_query, (user_data[0].text(), user_data[1].text(), user_data[2].text(), user_data[3].text()))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pyqt-gui QT Graphical User Interface
Projects
Development

No branches or pull requests

1 participant