adamspd / django-appointment

A Django app for managing appointment scheduling with ease and flexibility.
Apache License 2.0
87 stars 29 forks source link

Update views to class based #205

Open ZuluPro opened 2 weeks ago

ZuluPro commented 2 weeks ago

I converted views to class based ones: FormView, RedirectView, TemplateView and View. This will help developer to re-use the views and modifiy only part of them.

Function based views are still available through their path.

adamspd commented 2 weeks ago

Hi @ZuluPro,

To be honest, I'm not a great fan of class-based view, but putting my feelings aside, have you been able to run the tests ? It seems like they aren't working here.

You can run them locally with python manage.py test appointment.tests --parallel=10 --shuffle --verbosity=1

Just to satisfy my curiosity, do you have use-cases of reusing the views ?

Thanks

ZuluPro commented 19 hours ago

Hi @adamspd Sorry for my late reply

The tests work perfectly:

Ran 433 tests in 36.554s
OK

I've updated the branch to the latest version.

About the why I suggest class based-views, here's a clear example: I'm not satisfied by how the user are created. So I would to rewrite a part of appointment_client_information, But just the user creation.

Thank you