django createview how to get the object that is created

maybe you could use get_success_url() method (see reference) In this case, it’d be something like: def get_success_url(self): return reverse(‘offerta_create’,args=(self.object.id,)) Please see the accepted answer on Why doesn’t self.object in a CreateView have an id after saving to the database? – once I removed the “id” fields from my models, and let Django default to its … Read more

Drop view if exists

your exists syntax is wrong and you should seperate DDL with go like below if exists(select 1 from sys.views where name=”tst” and type=”v”) drop view tst; go create view tst as select * from test you also can check existence test, with object_id like below if object_id(‘tst’,’v’) is not null drop view tst; go create … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)