<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
tt
{mso-style-priority:99;
font-family:"Courier New";
color:#222222;
background:#ECF0F3;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2077624058;
mso-list-type:hybrid;
mso-list-template-ids:-1791480452 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Update<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Javascript error eliminated -- happy<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I can just as easily code up buttons and tables with the for-loop tag from Django.<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Just wondering if I can use the Horizon table support ala in access-and-security<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><span style="mso-list:Ignore">3)<span style="font:7.0pt "Times New Roman"">
</span></span></span></tt><![endif]><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Get_link_url -- on a table action is it possible to define this method? My attempts to do so resulted in empty url</span></tt><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">,
this is useful for hierarchical objects.</span></tt><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></tt></p>
<p class="MsoListParagraph"><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For instance create_action on the extra_specs table should basically pop up a form to allow one to specify an key and a value for the flavor-id that
one is </span></tt><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">editing</span></tt><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">.</span></tt><tt><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></tt></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Malini<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Bhandaru, Malini K [mailto:malini.k.bhandaru@intel.com]
<br>
<b>Sent:</b> Tuesday, September 04, 2012 4:17 PM<br>
<b>To:</b> OpenStack Development Mailing List<br>
<b>Subject:</b> Re: [openstack-dev] horizon - extra-specs questionS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Matt, new to all things Open Stack. I thought blueprints were to define a feature and get approval.<o:p></o:p></p>
<p class="MsoNormal">Extra specs for flavors is all approved. Yours truly just struggling to build in the UI support!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Extra specs is associated with a flavor is we have a hierarchy.
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Matt Joyce
<a href="mailto:[mailto:matt.joyce@cloudscaling.com]">[mailto:matt.joyce@cloudscaling.com]</a>
<br>
<b>Sent:</b> Tuesday, September 04, 2012 4:04 PM<br>
<b>To:</b> OpenStack Development Mailing List<br>
<b>Subject:</b> Re: [openstack-dev] horizon - extra-specs questionS<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Maybe this is better done as a blueprint in launchpad?<o:p></o:p></p>
<div>
<p class="MsoNormal">On Tue, Sep 4, 2012 at 3:48 PM, Bhandaru, Malini K <<a href="mailto:malini.k.bhandaru@intel.com" target="_blank">malini.k.bhandaru@intel.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Greetings All!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Would like to via the flavor-edit menu make extra specs view-able and editable.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is it possible in a view to support rendering a table in addition to ordinary fields?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The ordinary fields being VCPUs, RAM etc and the table being extra_specs?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I also need the create_extra_specs and edit_extra_specs to carry over the flavor_id in their url<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Alternately if there is a similar example you could point me too…<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">And before I can debug the above I run in a javascrip error on clicking my edit-flavor button.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any and all help appreciated!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regards<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Malini
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div style="border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in;margin-left:.5in">
<p> <o:p></o:p></p>
</div>
<p>In views.py<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>from .extra_specs.tables import ExtraSpecsTable<o:p></o:p></p>
<p>..<o:p></o:p></p>
<p>..<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>def get_extra_spec_data(request, flavor_id):<o:p></o:p></p>
<p> extra_spec_list = []<o:p></o:p></p>
<p> try:<o:p></o:p></p>
<p> extra_spec_dict = api.extra_spec_list(request, flavor_id)<o:p></o:p></p>
<p> for k in extra_spec_dict.keys():<o:p></o:p></p>
<p> extra_spec_list.append(ExtraSpecAux(flavor_id, k, extra_spec_dict[k]))<o:p></o:p></p>
<p> except:<o:p></o:p></p>
<p> exceptions.handle(request,<o:p></o:p></p>
<p> _('Unable to retrieve extra spec list.'))<o:p></o:p></p>
<p> return extra_spec_list<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>class EditView(forms.ModalFormView):<o:p></o:p></p>
<p> form_class = EditFlavor<o:p></o:p></p>
<p> table_class = ExtraSpecsTable<o:p></o:p></p>
<p> template_name = 'syspanel/flavors/edit.html'<o:p></o:p></p>
<p> success_url = reverse_lazy('horizon:syspanel:flavors:index')<o:p></o:p></p>
<p> <o:p></o:p></p>
<p> def get_context_data(self, **kwargs):<o:p></o:p></p>
<p> context = super(EditView, self).get_context_data(**kwargs)<o:p></o:p></p>
<p> context['flavor_id'] = self.kwargs['id']<o:p></o:p></p>
<p> return context<o:p></o:p></p>
<p> <o:p></o:p></p>
<p> def get_initial(self):<o:p></o:p></p>
<p> try:<o:p></o:p></p>
<p> flavor = api.nova.flavor_get(self.request, self.kwargs['id'])<o:p></o:p></p>
<p> extra_spec_list = get_extra_spec_data(self.request, self.kwargs['id'])<o:p></o:p></p>
<p> except:<o:p></o:p></p>
<p> exceptions.handle(self.request,<o:p></o:p></p>
<p> _("Unable to retrieve flavor data."))<o:p></o:p></p>
<p> return {'flavor_id': <a href="http://flavor.id" target="_blank">flavor.id</a>,<o:p></o:p></p>
<p> 'name': <a href="http://flavor.name" target="_blank">flavor.name</a>,<o:p></o:p></p>
<p> 'vcpus': flavor.vcpus,<o:p></o:p></p>
<p> 'memory_mb': flavor.ram,<o:p></o:p></p>
<p> 'disk_gb': flavor.disk,<o:p></o:p></p>
<p> 'eph_gb': getattr(flavor, 'OS-FLV-EXT-DATA:ephemeral', None),<o:p></o:p></p>
<p> 'extra_specs': extra_spec_list}<o:p></o:p></p>
<p> <o:p></o:p></p>
<div style="border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in;margin-left:.5in">
<p> <o:p></o:p></p>
</div>
<p>_edit.html<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Adding<o:p></o:p></p>
<p><div id="extra_specs"><o:p></o:p></p>
<p> {{ extra_specs_table.render }}<o:p></o:p></p>
<p></div><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>