* Changing code constants to reflect package type display strings and ordering
@ 2014-01-18 18:27 Lerner, Dave
2014-01-20 9:27 ` Damian, Alexandru
0 siblings, 1 reply; 4+ messages in thread
From: Lerner, Dave @ 2014-01-18 18:27 UTC (permalink / raw)
To: Damian, Alexandru (alexandru.damian@intel.com),
Barros Pena, Belen (belen.barros.pena@intel.com)
Cc: toaster
Hi Alex, Belen
We have view specs regarding ordering and display values for package_dependencies.
The non RDEPENDS releationship types are to be sorted in this order and displayed with these strings:
1. Recommends
2. Suggests
3. Provides
4. Replaces
5. Conflicts
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.
Can we change...
class Package_Dependency(models.Model):
TYPE_RDEPENDS = 0
TYPE_RPROVIDES = 1
TYPE_RRECOMMENDS = 2
TYPE_RSUGGESTS = 3
TYPE_RREPLACES = 4
TYPE_RCONFLICTS = 5
TYPE_TRDEPENDS = 6
TYPE_TRECOMMENDS = 7
DEPENDS_TYPE = (
(TYPE_RDEPENDS, "rdepends"),
(TYPE_RPROVIDES, "rprovides"),
(TYPE_RRECOMMENDS, "rrecommends"),
(TYPE_RSUGGESTS, "rsuggests"),
(TYPE_RREPLACES, "rreplaces"),
(TYPE_RCONFLICTS, "rconflicts"),
(TYPE_TRDEPENDS, "trdepends"),
(TYPE_TRECOMMENDS, "trecommends"),
)
to...
TYPE_RDEPENDS = 1
TYPE_TRDEPENDS = 2
TYPE_RRECOMMENDS = 3
TYPE_TRECOMMENDS = 4
TYPE_RSUGGESTS = 5
TYPE_RPROVIDES = 6
TYPE_RREPLACES = 7
TYPE_RCONFLICTS = 8
DEPENDS_TYPE = (
(TYPE_RDEPENDS, "Depends"),
(TYPE_TRDEPENDS, "Depends"),
(TYPE_RRECOMMENDS, "Recommends"),
(TYPE_TRECOMMENDS, "Recommends"),
(TYPE_RPROVIDES, "Provids"),
(TYPE_RSUGGESTS, "Suggests"),
(TYPE_RREPLACES, "Replaces"),
(TYPE_RCONFLICTS, "Conflicts"),
)
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.
Ok to include this change?
Dave
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changing code constants to reflect package type display strings and ordering
2014-01-18 18:27 Changing code constants to reflect package type display strings and ordering Lerner, Dave
@ 2014-01-20 9:27 ` Damian, Alexandru
2014-01-20 10:45 ` Barros Pena, Belen
2014-01-20 15:31 ` Lerner, Dave
0 siblings, 2 replies; 4+ messages in thread
From: Damian, Alexandru @ 2014-01-20 9:27 UTC (permalink / raw)
To: Lerner, Dave; +Cc: toaster
[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]
Hi Dave,
Yep, the constants are arbitrary, and they can be changed.
You can get the constant text directly displayed in the html template using
the *object.get_FIELDNAME_display* function.
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}}
Does this sound ok to you ?
Alex
On Sat, Jan 18, 2014 at 6:27 PM, Lerner, Dave <dave.lerner@windriver.com>wrote:
> Hi Alex, Belen
>
> We have view specs regarding ordering and display values for
> package_dependencies.
>
> The non RDEPENDS releationship types are to be sorted in this order and
> displayed with these strings:
>
> 1. Recommends
> 2. Suggests
> 3. Provides
> 4. Replaces
> 5. Conflicts
>
> 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.
>
> Can we change...
> class Package_Dependency(models.Model):
> TYPE_RDEPENDS = 0
> TYPE_RPROVIDES = 1
> TYPE_RRECOMMENDS = 2
> TYPE_RSUGGESTS = 3
> TYPE_RREPLACES = 4
> TYPE_RCONFLICTS = 5
> TYPE_TRDEPENDS = 6
> TYPE_TRECOMMENDS = 7
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "rdepends"),
> (TYPE_RPROVIDES, "rprovides"),
> (TYPE_RRECOMMENDS, "rrecommends"),
> (TYPE_RSUGGESTS, "rsuggests"),
> (TYPE_RREPLACES, "rreplaces"),
> (TYPE_RCONFLICTS, "rconflicts"),
> (TYPE_TRDEPENDS, "trdepends"),
> (TYPE_TRECOMMENDS, "trecommends"),
> )
> to...
> TYPE_RDEPENDS = 1
> TYPE_TRDEPENDS = 2
> TYPE_RRECOMMENDS = 3
> TYPE_TRECOMMENDS = 4
> TYPE_RSUGGESTS = 5
> TYPE_RPROVIDES = 6
> TYPE_RREPLACES = 7
> TYPE_RCONFLICTS = 8
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "Depends"),
> (TYPE_TRDEPENDS, "Depends"),
> (TYPE_RRECOMMENDS, "Recommends"),
> (TYPE_TRECOMMENDS, "Recommends"),
> (TYPE_RPROVIDES, "Provids"),
> (TYPE_RSUGGESTS, "Suggests"),
> (TYPE_RREPLACES, "Replaces"),
> (TYPE_RCONFLICTS, "Conflicts"),
> )
>
> 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.
>
> Ok to include this change?
> Dave
>
--
Alex Damian
Yocto Project
SSG / OTC
[-- Attachment #2: Type: text/html, Size: 3765 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changing code constants to reflect package type display strings and ordering
2014-01-20 9:27 ` Damian, Alexandru
@ 2014-01-20 10:45 ` Barros Pena, Belen
2014-01-20 15:31 ` Lerner, Dave
1 sibling, 0 replies; 4+ messages in thread
From: Barros Pena, Belen @ 2014-01-20 10:45 UTC (permalink / raw)
To: Damian, Alexandru, Lerner, David M (Wind River); +Cc: toaster
On 20/01/2014 09:27, "Damian, Alexandru" <alexandru.damian@intel.com>
wrote:
>Hi Dave,
>
>
>Yep, the constants are arbitrary, and they can be changed.
>
>You can get the constant text directly displayed in the html template
>using the
>object.get_FIELDNAME_display function.
>
>
>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}}
>
>
>Does this sound ok to you ?
>
>
>Alex
>
>
>
>
>On Sat, Jan 18, 2014 at 6:27 PM, Lerner, Dave
><dave.lerner@windriver.com> wrote:
>
>Hi Alex, Belen
>
>We have view specs regarding ordering and display values for
>package_dependencies.
>
>The non RDEPENDS releationship types are to be sorted in this order and
>displayed with these strings:
>
>1. Recommends
>2. Suggests
>3. Provides
>4. Replaces
>5. Conflicts
>
>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.
>
>Can we change...
>class Package_Dependency(models.Model):
> TYPE_RDEPENDS = 0
> TYPE_RPROVIDES = 1
> TYPE_RRECOMMENDS = 2
> TYPE_RSUGGESTS = 3
> TYPE_RREPLACES = 4
> TYPE_RCONFLICTS = 5
> TYPE_TRDEPENDS = 6
> TYPE_TRECOMMENDS = 7
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "rdepends"),
> (TYPE_RPROVIDES, "rprovides"),
> (TYPE_RRECOMMENDS, "rrecommends"),
> (TYPE_RSUGGESTS, "rsuggests"),
> (TYPE_RREPLACES, "rreplaces"),
> (TYPE_RCONFLICTS, "rconflicts"),
> (TYPE_TRDEPENDS, "trdepends"),
> (TYPE_TRECOMMENDS, "trecommends"),
> )
>to...
> TYPE_RDEPENDS = 1
> TYPE_TRDEPENDS = 2
> TYPE_RRECOMMENDS = 3
> TYPE_TRECOMMENDS = 4
> TYPE_RSUGGESTS = 5
> TYPE_RPROVIDES = 6
> TYPE_RREPLACES = 7
> TYPE_RCONFLICTS = 8
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "Depends"),
> (TYPE_TRDEPENDS, "Depends"),
> (TYPE_RRECOMMENDS, "Recommends"),
> (TYPE_TRECOMMENDS, "Recommends"),
> (TYPE_RPROVIDES, "Provids"),
> (TYPE_RSUGGESTS, "Suggests"),
> (TYPE_RREPLACES, "Replaces"),
> (TYPE_RCONFLICTS, "Conflicts"),
> )
>
>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.
Not as far as I can recall. Full dependency information is only shown in
the package details pages, although we also show RDEPENDS in the installed
packages table as shown here:
http://www.yoctoproject.org/toaster/image-information-packages.html
>
>Ok to include this change?
>Dave
>
>
>
>
>
>
>--
>Alex Damian
>Yocto Project
>
>SSG / OTC
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Changing code constants to reflect package type display strings and ordering
2014-01-20 9:27 ` Damian, Alexandru
2014-01-20 10:45 ` Barros Pena, Belen
@ 2014-01-20 15:31 ` Lerner, Dave
1 sibling, 0 replies; 4+ messages in thread
From: Lerner, Dave @ 2014-01-20 15:31 UTC (permalink / raw)
To: Damian, Alexandru; +Cc: toaster
> -----Original Message-----
> From: Damian, Alexandru [mailto:alexandru.damian@intel.com]
> Sent: Monday, January 20, 2014 3:28 AM
> To: Lerner, Dave
> Cc: Barros Pena, Belen (belen.barros.pena@intel.com); toaster@yoctoproject.org
> Subject: Re: Changing code constants to reflect package type display strings and
> ordering
>
> Hi Dave,
>
>
> Yep, the constants are arbitrary, and they can be changed.
>
> You can get the constant text directly displayed in the html template using the
> object.get_FIELDNAME_display function.
>
>
> 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}}
>
>
> Does this sound ok to you ?
Sounds perfect, thanks.
Dave
>
> Alex
>
>
>
> On Sat, Jan 18, 2014 at 6:27 PM, Lerner, Dave <dave.lerner@windriver.com> wrote:
>
>
> Hi Alex, Belen
>
> We have view specs regarding ordering and display values for package_dependencies.
>
> The non RDEPENDS releationship types are to be sorted in this order and displayed
> with these strings:
>
> 1. Recommends
> 2. Suggests
> 3. Provides
> 4. Replaces
> 5. Conflicts
>
> 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.
>
> Can we change...
> class Package_Dependency(models.Model):
> TYPE_RDEPENDS = 0
> TYPE_RPROVIDES = 1
> TYPE_RRECOMMENDS = 2
> TYPE_RSUGGESTS = 3
> TYPE_RREPLACES = 4
> TYPE_RCONFLICTS = 5
> TYPE_TRDEPENDS = 6
> TYPE_TRECOMMENDS = 7
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "rdepends"),
> (TYPE_RPROVIDES, "rprovides"),
> (TYPE_RRECOMMENDS, "rrecommends"),
> (TYPE_RSUGGESTS, "rsuggests"),
> (TYPE_RREPLACES, "rreplaces"),
> (TYPE_RCONFLICTS, "rconflicts"),
> (TYPE_TRDEPENDS, "trdepends"),
> (TYPE_TRECOMMENDS, "trecommends"),
> )
> to...
> TYPE_RDEPENDS = 1
> TYPE_TRDEPENDS = 2
> TYPE_RRECOMMENDS = 3
> TYPE_TRECOMMENDS = 4
> TYPE_RSUGGESTS = 5
> TYPE_RPROVIDES = 6
> TYPE_RREPLACES = 7
> TYPE_RCONFLICTS = 8
> DEPENDS_TYPE = (
> (TYPE_RDEPENDS, "Depends"),
> (TYPE_TRDEPENDS, "Depends"),
> (TYPE_RRECOMMENDS, "Recommends"),
> (TYPE_TRECOMMENDS, "Recommends"),
> (TYPE_RPROVIDES, "Provids"),
> (TYPE_RSUGGESTS, "Suggests"),
> (TYPE_RREPLACES, "Replaces"),
> (TYPE_RCONFLICTS, "Conflicts"),
> )
>
> 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.
>
> Ok to include this change?
> Dave
>
>
>
>
>
> --
>
> Alex Damian
> Yocto Project
>
> SSG / OTC
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-20 15:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-18 18:27 Changing code constants to reflect package type display strings and ordering Lerner, Dave
2014-01-20 9:27 ` Damian, Alexandru
2014-01-20 10:45 ` Barros Pena, Belen
2014-01-20 15:31 ` Lerner, Dave
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.