It's only 2 consecutive rows identical rows I need to exclude.

On Mon, May 23, 2016 at 4:53 AM, Derek <gamesb...@gmail.com> 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 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 2:26 AM, Gergely Polonkai <ger...@polonkai.eu>
>> 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 columns, which is what I want.
>>
>> > On the other hand, I started wondering why you need this, do you care to
>> > share the use case?
>>
>> When new data comes in I want to compare it to the most recently added
>> row and only add a new row if it differs.
>>
>>
>> > [1] http://stackoverflow.com/a/29088221/1305139
>> > [2] https://docs.djangoproject.com/en/1.9/topics/serialization/
>> >
>> > On May 20, 2016 00:13, "Larry Martell" <larry....@gmail.com> wrote:
>> >>
>> >> 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')
>> >>
>> >> and get a list of lists instead a list of FOO objects.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e4a06bdf-c9df-46a7-9848-86238ddbf7cd%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7%3D8tv4kDf2SDRqRsvMvg8dTb3HtqPRo5O8nkdvNHnmJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to