regularstuff / tildeblog

A learn-to-use Django team project
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

change "/de" endpoint to "/add" #33

Open readytheory opened 4 months ago

readytheory commented 3 months ago

Since merge of issue #20, create and update share logic. Even though they use same logic, we should have one endpoint /add and one /edit/123 (to edit item 123)

Akhaled19 commented 3 months ago

Hello @readytheory! If I understand correctly, you're requesting the following paths to be changed to this format, correct?

urlpatterns = [
  ...
  path("edit/<int:learnt_id>", views.learning_data_entry, name="til_edit_id"),
  path("add", views.learning_data_entry, name="til_add"),
]
readytheory commented 3 months ago

@Akhaled19 Yes, that sounds like that sums it up. Would you like to create a pull request for that?

Akhaled19 commented 3 months ago

@readytheory great! I'll go ahead and make a pr

regularstuff commented 3 months ago

I missed it when you asked before, but the "name" attribute should not change, unless the places in the code that use the names "til_edit_de" and "til_de" also change. I put a comment on PR, let me know if unclear.

If you run the site on your local, you'll see the "reverse match" failures when submitting/following links with the proposed change.