Good day SO!
Next to Java I'm trying to learn some Python/Django since the company I work for is also going to use Django. However, I am trying to figure out how to work with Generic Class Based Views. I hope somebody can give me some information to guide me in the right direction to solve my problem.
I have a small blog application containing CRUD (Create, Read, Update, Delete) abilities with GCBV (Generic Class Based Views). In the Detail view I have a link to publish:
{% url 'blogs:publish' blog.pk %}
which i want to use like:
url(r'^(?P[0-9]+)/publish/$', xxx, name='publish')
I just can't get it to work. I have attempted (and simular attempts) to create a method in the Update(UpdateView) class called publish(self, **kwargs): and make the url pattern to call it:
url(r'^(?P[0-9]+)/publish/$', views.Update.publish(), name='publish')
which obviously doesn't work, otherwise you wouldn't be reading this right now ;) I've been reading quite some docs/google/etc, but mostly it's function based or the tutorial stops after CRUD. Can you push me in the right direction (tip/clear tutorial/example) or an explanation where I'm taking the wrong choices? Thanks in advance!