Closed BogPlaymate closed 5 months ago
Thank you soo much for this PR! I'll take a closer look soon! Regarding the enum config flag:
As far as I remember, this tells/told ormar to map the enum to the custom enum type in the db, so it doesn't store strings or numbers, but I don't know what happened to that in current ormar.
:) Well, thank you so much for the warm reply!
In order to get the project working with current Orman and Pydantic, this is the models.py that I use. However, maybe I might have made other small changes to other files. If you do try upgrading Orman/Pydantic, and you get errors, please tell me! I probably have the solutions on my computer.
Please have a nice day.
On Thu, Jul 4, 2024, 20:19 Marlon @.***> wrote:
Thank you soo much for this PR! I'll take a closer look soon! Regarding the enum config flag:
As far as I remember, this tells/told ormar to map the enum to the custom enum type in the db, so it doesn't store strings or numbers, but I don't know what happened to that in current ormar.
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2208723034, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNECSRJVZFIIPSNVSKADZKUVTBAVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYG4ZDGMBTGQ . You are receiving this because you authored the thread.Message ID: @.***>
Please also commit all the other changed files, so that'll be easier. It doesn't matter if they are janky, we'll address those together.
That sounds interesting.
I've reviewed the files which I changed. I do believe that the models.py files is the only file I changed as relates to ormar. Pydantic gave me so many errors, I can't quite remember if other changes will be necessary to meet the requirements of the current version.
I did make various other changes. One of them is required to work with the current version of redis. However, these are probably better addressed in a separate commit?
On Thu, Jul 4, 2024 at 10:32 PM Marlon @.***> wrote:
Please also commit all the other changed files, so that'll be easier. It doesn't matter if they are janky, we'll address those together.
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2208998837, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNEFXFD4TADIHOGGGTBTZKVFF5AVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYHE4TQOBTG4 . You are receiving this because you authored the thread.Message ID: @.***>
To clarify, I mean there may be other changes to work with the current version of pydantic. I am fairly confident the models.py file will be enough to make the project compatible with ormar.
On Fri, Jul 5, 2024 at 5:56 AM Joe Fox @.***> wrote:
That sounds interesting.
I've reviewed the files which I changed. I do believe that the models.py files is the only file I changed as relates to ormar. Pydantic gave me so many errors, I can't quite remember if other changes will be necessary to meet the requirements of the current version.
I did make various other changes. One of them is required to work with the current version of redis. However, these are probably better addressed in a separate commit?
On Thu, Jul 4, 2024 at 10:32 PM Marlon @.***> wrote:
Please also commit all the other changed files, so that'll be easier. It doesn't matter if they are janky, we'll address those together.
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2208998837, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNEFXFD4TADIHOGGGTBTZKVFF5AVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYHE4TQOBTG4 . You are receiving this because you authored the thread.Message ID: @.***>
Yea, but please also push the Pipfile and the Pipfile.lock. But when we upgrade pydantic and ormar, all imports will have to be updated to use the V1 and the gradually update from there for all the other pydantic usages throughout ClassQuiz.
I will find out how to push the pipfile and pipfile.lock now.
On Fri, Jul 5, 2024 at 6:14 AM Marlon @.***> wrote:
Yea, but please also push the Pipfile and the Pipfile.lock. But when we upgrade pydantic and ormar, all imports will have to be updated to use the V1 and the gradually update from there for all the other pydantic usages throughout ClassQuiz.
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2209568767, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNEBAFZ4YN4H3FH4BQGTZKW3LLAVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGU3DQNZWG4 . You are receiving this because you authored the thread.Message ID: @.***>
git add Pipfile
, git add Pipfile.lock
, git commit -m ":sparkles: Updated Pipfile
& git push
Thank you for the command line instructions. I tried using them, and after logging on I get:
"On branch master Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add
Untracked files:
(use "git add
Previously I was using the browser interface, sorry!
Okay, then for now just run git add .
and then the commit and push command. This should upload all your changes here. Even though that may not be what you want, there's always time for cleanup which I'll be assisting with tomorrow while you're at sleep ;)
Thank you. You are too kind. I will be home from work in about 11 hours from now.
I'm having some difficulty authenticating myself via the command line (apparently you cannot do it via password anymore!) Hopefully I will be able to resolve this soon before I leave for work.
Yes, that's true. You could also try using ssh, but GitHub has some good docs about that, so I'm sure you'll manage that!
:) At least I should be able to log on to github, right?
The easiest way seems to be to use the github CLI and run the following command: https://cli.github.com/manual/gh_auth_login
Alright, so I'm authenticated on github.
But, the push command gives:
"remote: Permission to mawoka-myblock/ClassQuiz.git denied to BogPlaymate. fatal: unable to access 'https://github.com/mawoka-myblock/ClassQuiz/': The requested URL returned error: 403"
Is this because it's pushing to the wrong place (i.e. the main repository)? Or alternatively it may be because additional authentication is required...
On Fri, Jul 5, 2024 at 6:39 AM Marlon @.***> wrote:
The easiest way seems to be to use the github CLI and run the following command: https://cli.github.com/manual/gh_auth_login
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2209583763, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNECU63Y2ZIRZA4ARU4LZKW6HTAVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGU4DGNZWGM . You are receiving this because you authored the thread.Message ID: @.***>
Anyway, thank you for your help late at night. About the time you wake up, I will get back from work and start trying to reveal my code.
On Fri, Jul 5, 2024 at 6:45 AM Joe Fox @.***> wrote:
Alright, so I'm authenticated on github.
But, the push command gives:
"remote: Permission to mawoka-myblock/ClassQuiz.git denied to BogPlaymate. fatal: unable to access 'https://github.com/mawoka-myblock/ClassQuiz/': The requested URL returned error: 403"
Is this because it's pushing to the wrong place (i.e. the main repository)? Or alternatively it may be because additional authentication is required...
On Fri, Jul 5, 2024 at 6:39 AM Marlon @.***> wrote:
The easiest way seems to be to use the github CLI and run the following command: https://cli.github.com/manual/gh_auth_login
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2209583763, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNECU63Y2ZIRZA4ARU4LZKW6HTAVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGU4DGNZWGM . You are receiving this because you authored the thread.Message ID: @.***>
Yes, exactly. You have to run "git remote add fork https://github.com/BlogPlaymate/ClassQuiz" and then push with "git push -u fork"
Brilliant, thank you. I looked it up, but actually the commands you suggest seem much more concise. Right now I'm at my workplace. I will be home in about two hours and thirty minutes.
On Fri, Jul 5, 2024 at 2:05 PM Marlon @.***> wrote:
Yes, exactly. You have to run "git remote add fork https://github.com/BlogPlaymate/ClassQuiz" and then push with "git push -u fork"
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2210180145, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNEESKOB26FUNX46P7C3ZKYSR7AVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGE4DAMJUGU . You are receiving this because you authored the thread.Message ID: @.***>
Sorry, I had to work late at the school. My apologies.
NOW We have both made a small mistake. And its not clear how to undo it. My username is "BogPlaymate", however, we spelled it wrong, and now...I can't seem to add the right fork....
See below. The first command is correct, with "Bog". However, the fork "Blog" is attached, and this url in fact does not exist.
@.:~/ClassQuiz$ git remote add fork https://github.com/BogPlaymate/ClassQuiz error: remote fork already exists. @.:~/ClassQuiz$ git remote -v fork https://github.com/BlogPlaymate/ClassQuiz (fetch) fork https://github.com/BlogPlaymate/ClassQuiz (push) origin https://github.com/mawoka-myblock/ClassQuiz (fetch) origin https://github.com/mawoka-myblock/ClassQuiz (push)
On Fri, Jul 5, 2024 at 2:13 PM Joe Fox @.***> wrote:
Brilliant, thank you. I looked it up, but actually the commands you suggest seem much more concise. Right now I'm at my workplace. I will be home in about two hours and thirty minutes.
On Fri, Jul 5, 2024 at 2:05 PM Marlon @.***> wrote:
Yes, exactly. You have to run "git remote add fork https://github.com/BlogPlaymate/ClassQuiz" and then push with "git push -u fork"
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2210180145, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNEESKOB26FUNX46P7C3ZKYSR7AVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGE4DAMJUGU . You are receiving this because you authored the thread.Message ID: @.***>
Oh, ofc, it should have been BogPlaymate
, my bad. You can remove the remote by running git remote rm fork
and add it back correclty by running git remote add fork https://github.com/logPlaymate/ClassQuiz.git
Hi. I've uploaded everything. The commands helped. So, if you want, you can see the complete picture. It is not linted and doesn't look nice yet though.
On Fri, Jul 5, 2024 at 6:46 PM Marlon @.***> wrote:
Oh, ofc, it should have been BogPlaymate, my bad. You can remove the remote by running git remote rm fork and add it back correclty by running git remote add fork https://github.com/logPlaymate/ClassQuiz.git
— Reply to this email directly, view it on GitHub https://github.com/mawoka-myblock/ClassQuiz/pull/383#issuecomment-2210560836, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUGNECDV4VFIAFHL3YL2KTZKZTRBAVCNFSM6AAAAABKLKVOPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGU3DAOBTGY . You are receiving this because you modified the open/close state.Message ID: @.***>
Just push it. I'll fix the linting errors, etc
That's what draft PRs are for
Changes are required to work with the current version of ormar (i.e. migrate to ormar 0.20 and above). From the ormar documentation:
"Instead of defining a Meta class now each of the ormar models require an ormar_config parameter that is an instance of the OrmarConfig class. Note that the attribute must be named ormar_config and be an instance of the config class." https://collerek.github.io/ormar/latest/migration/
All the "Meta" nested classes have been removed, and instead the fields implemented in OrmarConfig objects.
Additionally, a Config class, which was previous nested in the User class, has also been removed. The existence of this resulted in a Pydantic error: "pydantic.errors.PydanticUserError: "Config" and "model_config" cannot be used together".
This class only held one value: class Config: use_enum_values = True
As far as I know, the above Config class is not used anywhere. When I searched the project for any references to "use_enum_values", I did not find anything. However, it is possible that I am misunderstanding its use.
Thank you for reading this. These changes are required to build the project with current libraries. Hopefully they will help new developers, and old developers who do a clean install.
:tophat: What? Why?
As above
:pushpin: Related Issues
As above
Testing
The way to test it is to upgrade the ormar and pydantic libraries on your computer.
:clipboard: Checklist
⚠️ No tests suites for now ⚠️ :rotating_light: Please review the guidelines for contributing to this repository.
CONSIDER adding a unit test if your PR resolves an issue.DO make sure tests pass.DO add CHANGELOG upgrade notes if required.AVOID breaking the continuous integration build.:camera: Screenshots
Please let me know if screenshots would be helpful
:hearts: Thank you!