Re: Trying to create a CBV that allows user to copy a record

2018-03-05 Thread Alexander Joseph
I'm trying to figure out how get_initial will work in this instance. I know I will have to pass the asset_tag.pk through the url to the FixedAssetCopyView but not sure what to set for my initial data. Assuming I just want to set the "manufacturer" = to the manufacturer of the fixed_asset.pk tha

Re: Trying to create a CBV that allows user to copy a record

2018-03-01 Thread Alexander Joseph
Thanks! On Wednesday, February 28, 2018 at 11:53:01 AM UTC-7, Dylan Reinhold wrote: > > Use the get_inital method. > > def get_initial(self): > initial = super(MyCreateView, self).get_initial() > initial['name'] = 'Testing' > return initial > > Dylan > > > > On Wed, Fe

Re: Trying to create a CBV that allows user to copy a record

2018-02-28 Thread Dylan Reinhold
Use the get_inital method. def get_initial(self): initial = super(MyCreateView, self).get_initial() initial['name'] = 'Testing' return initial Dylan On Wed, Feb 28, 2018 at 9:42 AM, Alexander Joseph < alexander.v.jos...@gmail.com> wrote: > I'd like to create a CBV

Trying to create a CBV that allows user to copy a record

2018-02-28 Thread Alexander Joseph
I'd like to create a CBV to allow users to copy a record, except for item specific information. - I'm making a fixed assets app and if there are 2 of the same laptop I'd like the user to be able to make one record in the database, then copy it minus the serial number and asset tag number which