Hi Belén, > However, something strange is happening with > the Sourcetype field. Whatever value I select there, > it reverts to 'local'.
1) Ok, I have found the issue and resolution, and I have updated my commit to V2: dreyna/add_layersource_7437 The issue was that "LayerSource::Save" was using the "__class__" value to force the "sourcetype", but that is all wrong for the save method where the user is trying to explicitly set a new value of "sourcetype", so it was locking the objects to "local". I have reverse that functionality to allow the user's "sourcetype" to force the class type. With this change I can now easily create layers and also change their source types. 2) I do have a question. I tried to test this feature and I find I do not know how to use it, and the documentation did not help. I created a new layer source, using examples from 7505: Name=my-raspberry Type=Import Apiurl=https://github.com/agherzan/meta-raspberrypi * When I then create a new project, this layer is not available, neither as a new default layer nor as a selectable layer. * The Admin interface does not match the "Import Layer" interface, in that there are no "Revision" nor "Repository subdirectory" entries. * I even tried "bitbake/lib/toaster/manage.py lsupdates" and restarted Toaster, but that did not change anything. I am very confused. 3) I also tried the "Import Layer" user interface, and I find that the "Import and Add to project" button does not do anything, even with all the fields filled in. I am probably missing a patch. - David > -----Original Message----- > From: Barros Pena, Belen [mailto:[email protected]] > Sent: Tuesday, March 31, 2015 9:31 AM > To: Reyna, David; DAMIAN, ALEXANDRU > Cc: [email protected] > Subject: Re: [Toaster] [review-request] dreyna/add_layersource_7437 > > > > On 31/03/2015 10:06, "Reyna, David" <[email protected]> wrote: > > >Hi Belén and Alex, > > > >I have a working solution for 7437, in that clicking the add new layer > >sources no longer crashes. > > > > dreyna/add_layersource_7437 > > > >It appears to me that given the backtrace, the Django admin is attempting > >to touch the new layer source object before the Toaster code can > >initialize it. This patch simple initializes the empty members to a sane > >(but empty) object values, allowing the bootstrap to finish. When the > >"Add layer source" page does appear to the user, all of the fields are > >indeed empty as you would expect. > > > >You may not like this particular solution, but it works, and may indicate > >an obvious alternative fix if you see one. > > Can't comment on the patch itself, but the page no longer crashes and I > can create a layer source. However, something strange is happening with > the Sourcetype field. Whatever value I select there, it reverts to 'local'. > > Let me know if you need me to open a new issue for this. > > Cheers > > Belén > > > > >diff --git a/bitbake/lib/toaster/orm/models.py > >b/bitbake/lib/toaster/orm/models.py > >index 625eb1e..abe9c3a 100644 > >--- a/bitbake/lib/toaster/orm/models.py > >+++ b/bitbake/lib/toaster/orm/models.py > >@@ -651,6 +651,14 @@ class LayerSource(models.Model): > > return super(LayerSource, self).save(*args, **kwargs) > > > > def get_object(self): > >+ # preset an un-initilized object > >+ if None == self.name: > >+ self.name="" > >+ if None == self.apiurl: > >+ self.apiurl="" > >+ if None == self.sourcetype: > >+ self.sourcetype=LayerSource.TYPE_LOCAL > >+ > > if self.sourcetype == LayerSource.TYPE_LOCAL: > > self.__class__ = LocalLayerSource > > elif self.sourcetype == LayerSource.TYPE_LAYERINDEX: > > > >- David > > > >> -----Original Message----- > >> From: [email protected] [mailto:toaster- > >> [email protected]] On Behalf Of Reyna, David > >> Sent: Monday, March 30, 2015 6:37 PM > >> To: BARROS PENA, BELEN; WOOD, MICHAEL; DAMIAN, ALEXANDRU > >> Cc: [email protected] > >> Subject: [Toaster] [review-request] dreyna/projects_pagecount_7483 > >> > >> Hi Belén and Michael, > >> > >> I went ahead and grabbed (and solved) 7483 "Searching in the all > >>projects > >> table resets the 'show rows' menu to '10'" since it was still in the new > >> state. > >> > >> dreyna/projects_pagecount_7483 > >> > >> The "count" value for the all projects page was not fully saved in the > >> cookies because the view class did not end with a > >> '_save_parameters_cookies'. > >> > >> The intermediate cookie "_count" was there (from basetable_bottom.html) > >> which is why it kind of worked, but that is not used when a search is > >> issued. > >> > >> - David > >> > >> -- > >> _______________________________________________ > >> toaster mailing list > >> [email protected] > >> https://lists.yoctoproject.org/listinfo/toaster > -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
