Re: get all columns as a list

2016-05-27 Thread Larry Martell
Just FYI, they did not want that change. They did not feel it added any value. But in reality, they probably just didn't want me spending time on it so I could do other things. On Wed, May 25, 2016 at 9:35 AM, Larry Martell wrote: > I am the OP. I was implementing what

Re: get all columns as a list

2016-05-25 Thread Larry Martell
I am the OP. I was implementing what my customer asked for. But you make a good point that they might want the latest data not the oldest. I will suggest that to them. Thanks. On Wed, May 25, 2016 at 9:29 AM, Derek wrote: > We are both speaking as non-users of the OP's

Re: get all columns as a list

2016-05-25 Thread Derek
We are both speaking as non-users of the OP's system. ;) I agree that there are some use cases for keeping the first measurement IF the actual date of measurement makes no difference at all. We have an app like that, where we process real-time data and use a filter that only lets a record

Re: get all columns as a list

2016-05-24 Thread James Schneider
On May 24, 2016 9:11 AM, "Derek" wrote: > > Interesting. In all the cases I can think of, I would almost always want to keep the most recent check (not the oldest)... that tells me how recently the status of X was checked. A more pedantic administrator might also want all

Re: get all columns as a list

2016-05-24 Thread Derek
Interesting. In all the cases I can think of, I would almost always want to keep the most recent check (not the oldest)... that tells me how recently the status of X was checked. A more pedantic administrator might also want all those times stored, so a history can be created. On Monday, 23

Re: get all columns as a list

2016-05-23 Thread James Schneider
On Mon, May 23, 2016 at 9:20 AM, Larry Martell wrote: > They're not identical - there's a timestamp - that is not one of the > columns compared. > > The data is status data from a piece of equipment and we only want to > store changes. If 2 consecutive rows come in that

Re: get all columns as a list

2016-05-23 Thread Ketan Bhatt
Can you not do something like `qs.filter(...info that is coming in...).exists()` If ^ is True, then update it, otherwise create a new object? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: get all columns as a list

2016-05-23 Thread Larry Martell
They're not identical - there's a timestamp - that is not one of the columns compared. The data is status data from a piece of equipment and we only want to store changes. If 2 consecutive rows come in that are the same (excluding the timestamp) I don't want to store the second one. On Mon, May

Re: get all columns as a list

2016-05-23 Thread Derek
OK - I don't really understand that; there should not be any 2 identical records in a database, but anyway, that was not the issue in this thread. On Monday, 23 May 2016 11:52:06 UTC+2, larry@gmail.com wrote: > > It's only 2 consecutive rows identical rows I need to exclude. > > On Mon, May

Re: get all columns as a list

2016-05-23 Thread Larry Martell
It's only 2 consecutive rows identical rows I need to exclude. On Mon, May 23, 2016 at 4:53 AM, Derek wrote: > "When new data comes in I want to ... only add a new row if it differs." > > Pardon my curiosity, but isn't that the role of the set of unique keys for > each

Re: get all columns as a list

2016-05-23 Thread Derek
*"When new data comes in I want to ... only add a new row if it differs."* Pardon my curiosity, but isn't that the role of the set of unique keys for each record - to determine if it is "different"? On Friday, 20 May 2016 19:57:38 UTC+2, larry@gmail.com wrote: > > On Fri, May 20, 2016 at

Re: get all columns as a list

2016-05-20 Thread Larry Martell
On Fri, May 20, 2016 at 2:26 AM, Gergely Polonkai wrote: > Hello, > > Django can’t do this out of the box, but see this post[1] for a possible > solution with dicts. Well, it seems it can. As pointed out by Erik in another post, an empty values_list() returns all the

Re: get all columns as a list

2016-05-20 Thread Larry Martell
On Fri, May 20, 2016 at 2:23 AM, Erik Cederstrand wrote: > >> Den 20. maj 2016 kl. 00.12 skrev Larry Martell : >> >> This is probably very simple, but I just can't figure out how to do it. >> >> I want to get all the columns in some rows as a

Re: get all columns as a list

2016-05-20 Thread Gergely Polonkai
Hello, Django can’t do this out of the box, but see this post[1] for a possible solution with dicts. You might also want to look at serialization[2]; it might help you a bit, but again, it’s primarily for dicts, not lists. On the other hand, I started wondering why you need this, do you care to

Re: get all columns as a list

2016-05-20 Thread Erik Cederstrand
> Den 20. maj 2016 kl. 00.12 skrev Larry Martell : > > This is probably very simple, but I just can't figure out how to do it. > > I want to get all the columns in some rows as a list. I know I could > use values_list and flat=True and list all the columns, but is that

get all columns as a list

2016-05-19 Thread Larry Martell
This is probably very simple, but I just can't figure out how to do it. I want to get all the columns in some rows as a list. I know I could use values_list and flat=True and list all the columns, but is that the only way? I want to do something like this: rows = FOO.objects.filter(bar='baz')