Say I want to create a Class Based View which both updates and creates an object. From a previous question I worked out I
Simplest and basically the best solution of all link
class WorkerUpdate(UpdateView):
form_class = WorkerForm
def get_object(self, queryset=None):
# get the existing object or created a new one
obj, created = Worker.objects.get_or_create(mac=self.kwargs['mac'])
return obj
and that's it thanks @chriskief