<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Dave,<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Yep, the constants are arbitrary, and they can be changed.<br>

<br>You can get the constant text directly displayed in the html template using the <i>object.get_FIELDNAME_display</i> function.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I would suggest any constant here be in all lowercase, and if we need it displayed capitalized, use the "title" filter in the Django template. eg. {{dependency.get_dep_type_display|title}}<br>

<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Does this sound ok to you ?<br><br><br>Alex<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 18, 2014 at 6:27 PM, Lerner, Dave <span dir="ltr"><<a href="mailto:dave.lerner@windriver.com" target="_blank">dave.lerner@windriver.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alex, Belen<br>
<br>
We have view specs regarding ordering and display values for package_dependencies.<br>
<br>
The non RDEPENDS releationship types are to be sorted in this order and displayed with these strings:<br>
<br>
1. Recommends<br>
2. Suggests<br>
3. Provides<br>
4. Replaces<br>
5. Conflicts<br>
<br>
These two constraints do not map directly to what I'm guessing is an arbitrary set of constants in Package_Dependency.DEPENDS_TYPE in models.py. Â I couldn't find references to this list outside of the package detail source file.<br>


<br>
Can we change...<br>
class Package_Dependency(models.Model):<br>
  Â  TYPE_RDEPENDS = 0<br>
  Â  TYPE_RPROVIDES = 1<br>
  Â  TYPE_RRECOMMENDS = 2<br>
  Â  TYPE_RSUGGESTS = 3<br>
  Â  TYPE_RREPLACES = 4<br>
  Â  TYPE_RCONFLICTS = 5<br>
  Â  TYPE_TRDEPENDS = 6<br>
  Â  TYPE_TRECOMMENDS = 7<br>
  Â  DEPENDS_TYPE = (<br>
  Â  Â  Â  (TYPE_RDEPENDS, "rdepends"),<br>
  Â  Â  Â  (TYPE_RPROVIDES, "rprovides"),<br>
  Â  Â  Â  (TYPE_RRECOMMENDS, "rrecommends"),<br>
  Â  Â  Â  (TYPE_RSUGGESTS, "rsuggests"),<br>
  Â  Â  Â  (TYPE_RREPLACES, "rreplaces"),<br>
  Â  Â  Â  (TYPE_RCONFLICTS, "rconflicts"),<br>
  Â  Â  Â  (TYPE_TRDEPENDS, "trdepends"),<br>
  Â  Â  Â  (TYPE_TRECOMMENDS, "trecommends"),<br>
  Â  )<br>
to...<br>
  Â  TYPE_RDEPENDS = 1<br>
  Â  TYPE_TRDEPENDS = 2<br>
  Â  TYPE_RRECOMMENDS = 3<br>
  Â  TYPE_TRECOMMENDS = 4<br>
  Â  TYPE_RSUGGESTS = 5<br>
  Â  TYPE_RPROVIDES = 6<br>
  Â  TYPE_RREPLACES = 7<br>
  Â  TYPE_RCONFLICTS = 8<br>
  Â  DEPENDS_TYPE = (<br>
  Â  Â  Â  (TYPE_RDEPENDS, "Depends"),<br>
  Â  Â  Â  (TYPE_TRDEPENDS, "Depends"),<br>
  Â  Â  Â  (TYPE_RRECOMMENDS, "Recommends"),<br>
  Â  Â  Â  (TYPE_TRECOMMENDS, "Recommends"),<br>
  Â  Â  Â  (TYPE_RPROVIDES, "Provids"),<br>
  Â  Â  Â  (TYPE_RSUGGESTS, "Suggests"),<br>
  Â  Â  Â  (TYPE_RREPLACES, "Replaces"),<br>
  Â  Â  Â  (TYPE_RCONFLICTS, "Conflicts"),<br>
  Â  )<br>
<br>
With this change, the database values map to correct display order and the list maps to display strings. Â I haven't looked at every other spec, though to see if any other ordering of relationship types is required.<br>


<br>
Ok to include this change?<br>
<span class="HOEnZb"><font color="#888888">Dave<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Alex Damian<div>Yocto Project<br></div><div>SSG / OTC </div></div>
</div>