Weekly update (??)
Aug. 24th, 2018 02:03 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Coding progress:
So I'm refactoring. AGAIN. If you want to take a look at how that's going, all that work is on the refactor3 branch on the github repo.
Why did you decide to do this?
Got tired of the way the project was currently structured, and I was going to need to change major shit anyway (injecting a custom user model into a Django project after you've done the very first migration basically requires weird project surgery), and none of the data I've been fucking with in the test db was worth wringing my hands over preserving.
What did you actually do??
- changed
fanarchive
app name tofanfic
. Already thinking about changing it tocore
because that's what it's effectively become, but whatever. - inserted a custom user model under a separate app. Basically just installed
django-authtools
, inherited from their well-done NamedUser, and called it a day. Separate app because I intend the archive-specific user logic (pseuds, profiles etc) to be separate from the user authentication logic (login, email & password). - inserted custom app for handling pseuds, then changed my mind and shoved the Pseud model under the core
fanfic
app. - decided to go on a jaunt into many-to-many land by defining the relationship between Pseuds and Fics with a couple special models
- spent a possibly embarrassing amount of time playing with the db API, trying to make sure said defined relationship works as expected when creating Pseuds, Users, AuthorGroups and Authorships
What's next?
- make sure deleting Authorships, Users, Pseuds and AuthorGroups also works as expected
- add
public_id
field to Pseud model and makepseud_name
andpublic_id
unique together (want this for anon pseud stuff) - add
create_pseud
function to the Pseud model. May also want to stickmodify_pseud
anddelete_pseud
in there. - put together basic data factory functions so I can generate sample fics for various test and demo purposes
- TESTS. Main priority is:
- make sure obvious operations work as expected
- test custom functions
- FORMS (need these for basically every CRUD operation for every model involved)
- views + templates (rough, basic, but all the CRUD stuff needs this covered. Will lean heavily on the class-based views & default forms in
django-authtools
where possible)
Most likely, I will stop to make a giant pull request when factories and tests are in good shape, so that the work of making views and forms for everything that needs it can be in its own branch. Depending on how busy/tired I am this weekend, I think I should be able to do the custom functions, if not tie off the refactoring branch entirely.