Git Product home page Git Product logo

Comments (4)

maraujo avatar maraujo commented on August 15, 2024

from pysocialwatcher.

ianbstewart avatar ianbstewart commented on August 15, 2024

Right. I understand the difference between "and" and "or" but I can't figure out how to write the JSON query to issue an "and" query.

from pysocialwatcher.

ianbstewart avatar ianbstewart commented on August 15, 2024

I added a hacky fix to utils.select_advance_targeting_type_array_ids:

        if input_value.has_key("and"):
            for id_and in input_value["and"]:
                ## TODO: make the behavior AND query request less hacky
                if(segment_type == constants.INPUT_BEHAVIOR_FIELD):
                    if(len(targeting['flexible_spec']) == 1):
                        targeting['flexible_spec'].append({api_field_name : []})
                    targeting['flexible_spec'][1][api_field_name].append({"id" : id_and})
                else:
                    targeting["flexible_spec"].append({segment_type: {"id" : id_and}})

from pysocialwatcher.

joaopalotti avatar joaopalotti commented on August 15, 2024

Hi there,

I run into problems with the AND in the behavior field as well.

When using the json provided by @ianbstewart and the current GitHub version (which included this fix), I get the following error:

File "/home/palotti/p2/local/lib/python2.7/site-packages/pysocialwatcher-0.1j-py2.7.egg/pysocialwatcher/utils.py", line 375, in select_advance_targeting_type_array_ids targeting['flexible_spec'][1][api_field_name].append({"id" : id_and}) IndexError: list index out of range

Do you guys get this error as well?

I suggest the following modification instead:
joaopalotti@bff9fe0

(Now it does work here, but it probably needs to be tested elsewhere).

Cheers,

Joao

from pysocialwatcher.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.