On Feb 6, 2:41 pm, Stephen Hansen wrote:
> > I think there may have been a misunderstanding. I was already using
> > attrgetter, my problem is that it doesn't appear to be sorting by the
> > argument i give it. How does sort work with strings? How about with
> > datetime.time or datetime.date?
> I think there may have been a misunderstanding. I was already using
> attrgetter, my problem is that it doesn't appear to be sorting by the
> argument i give it. How does sort work with strings? How about with
> datetime.time or datetime.date?
You were using the attrgetter, but it looks like
On Feb 6, 2:34 pm, Robocop wrote:
> On Feb 6, 2:20 pm, Robocop wrote:
>
>
>
> > On Feb 6, 2:17 pm, Robocop wrote:
>
> > > On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote:
>
> > > > Robocop:
>
> > > > >then within each department block of the list, have it organized by
> > > > >projects.<
>
>
Robocop wrote:
UH OH GUYS!
line 110, in sorter
timesheets.sort(key=attrgetter("department", "engagement",
"date","start"))
TypeError: attrgetter expected 1 arguments, got 4
Um... what version of Python are you running? Alway specify. (Too many
people do not). In 3.0
from operator imp
On Feb 6, 2:20 pm, Robocop wrote:
> On Feb 6, 2:17 pm, Robocop wrote:
>
>
>
> > On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote:
>
> > > Robocop:
>
> > > >then within each department block of the list, have it organized by
> > > >projects.<
>
> > > I don't know what does it means.
>
> > > > ti
On Feb 6, 2:17 pm, Robocop wrote:
> On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote:
>
>
>
> > Robocop:
>
> > >then within each department block of the list, have it organized by
> > >projects.<
>
> > I don't know what does it means.
>
> > > timesheets.sort(key=operator.attrgetter('string'))
>
On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote:
> Robocop:
>
> >then within each department block of the list, have it organized by
> >projects.<
>
> I don't know what does it means.
>
> > timesheets.sort(key=operator.attrgetter('string'))
>
> Try something like:
> timesheets.sort(key=attrgette
On Feb 6, 1:03 pm, bearophileh...@lycos.com wrote:
> Robocop:
>
> >then within each department block of the list, have it organized by
> >projects.<
>
> I don't know what does it means.
>
> > timesheets.sort(key=operator.attrgetter('string'))
>
> Try something like:
> timesheets.sort(key=attrgette
Robocop:
>then within each department block of the list, have it organized by projects.<
I don't know what does it means.
> timesheets.sort(key=operator.attrgetter('string'))
Try something like:
timesheets.sort(key=attrgetter("department", "engagement", "date",
"stare_hour"))
> My brain might
> I've found myself stumped when trying to organize this list of
> objects. The objects in question are timesheets which i'd like to
> sort by four attributes:
>
> class TimeSheet:
> department = string
> engagement = string
> date = datetime.date
> stare_hour = datetime.time
>
> My ultim
Quoth Robocop :
> Hello again,
> I've found myself stumped when trying to organize this list of
> objects. The objects in question are timesheets which i'd like to
> sort by four attributes:
>
> class TimeSheet:
> department = string
> engagement = string
> date = datetime.date
> stare_ho
Hello again,
I've found myself stumped when trying to organize this list of
objects. The objects in question are timesheets which i'd like to
sort by four attributes:
class TimeSheet:
department = string
engagement = string
date = datetime.date
stare_hour = datetime.time
My ultimate goal
12 matches
Mail list logo