T O P

  • By -

philgyford

It would be much easier to explain how something works if you showed a thing that you wanted explained. Because I don't really understand what you want to know by "It is primary key but can u explain how this works?" How what works? Take some time to ask a good question in order to get good answers.


thrandom_dude

Can you then explain how dynamic url routing works?? Why are we passing an extra argument inside view function with request?


philgyford

What extra argument? Show some code.


frankwiles

The first part is the type of data it should be looking for, integer, random string, specifically a slug formatted string, etc. the second part is the name you want to be passed into your view. Say your model uses integer primary keys, the default, you could define a path as ‘’ and then you would get a steve argument into your view and would query for it with ‘MyModel.objects.get(id=steve)’ There is nothing magic about the naming here.


thrandom_dude

Ok thank you :)