can't search eve rest API - additional lookup not working

can definition
can synonym
can verb
can noun meaning
can bus
can airport
can network
can band

I was following the example here: https://github.com/pyeve/eve-demo/blob/master/settings.py

When I go to localhost:5000/apps, I can see all the documents in my collection, but when I search for an email at localhost:5000/apps/example@gmail.com, it says '404 not found'.

I've confirmed the regex, and the email addresses are in the documents. Can anyone see what might be wrong?

run.py

from eve import Eve


if __name__ == '__main__':
    app = Eve()
    app.run()

settings.py:

RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']


MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DBNAME = 'test_database'



apps = {
    'item_title' : 'app',

    'additional_lookup' : {
    'url' : 'regex("\b[\w.-]+?@\w+?\.\w+?\b")',
    'field' : 'developer_email',
    },

        'schema': {
            'address' : {
                'type' : 'string'
                },
            'developer_email' : {
                'type' : 'string',
                'minlength' : 1,
                'maxlength' : 15,
                'required' : True,
                'unique' : True,
            }
            }

DOMAIN = {
    'apps' : apps,
}

In your settings.py you aren't doing the lookup correctly. It should be.

apps = {
    'item_title' : 'app',

    'additional_lookup' : {
    'url' : 'apps/regex("\b[\w.-]+?@\w+?\.\w+?\b")',
    'field' : 'developer_email',
    },

        'schema': {
            'address' : {
                'type' : 'string'
                },
            'developer_email' : {
                'type' : 'string',
                'minlength' : 1,
                'maxlength' : 15,
                'required' : True,
                'unique' : True,
            }
            }

Can, Can was the leading avant-garde rock group of the 70s. Can experimented with noise, synthesizers, non-traditional music, cut-and-paste techniques, and, most� Can definition, to be able to; have the ability, power, or skill to: She can solve the problem easily, I'm sure. See more.


You can't add more than one additional lookup to the same endpoint. What you can do however, is have multiple endpoints consuming the same datasource. By default standard item entry point is defined as /apps/'objectID'/. You will have to configure another endpoint to /apps/'new endpoint'. Python-Eve: More than one additional lookup

Can, VerbEdit. can (third-person singular simple present can, present participle -, simple past could, past participle (obsolete except in adjectival use) couth). Define can. can synonyms, can pronunciation, can translation, English dictionary definition of can. to be able to, have the power or skill to: I can take a bus to the


@Vorticity pointed out a fix in a related question. Try the following:

'additional_lookup': {
    'url': 'regex("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")',
    'field': 'developer_email'
}

You should be able to retrieve your item with or without url encoding eg:

localhost:5000/apps/example@gmail.com
localhost:5000/apps/example%40gmail.com

If you have any interest in making your items retrievable at the item level by email _only (not object id), you can use item_lookup_field together with item_url:

apps = {
    ...
    'item_url': 'regex("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")',
    'item_lookup_field': 'developer_email'
}

The Official CAN / Spoon Records Website, 1.4Used to indicate that something is typically the case. 'antique clocks can seem out of place in modern homes'. More example sentences. can definition: 1. to be able to: 2. used to say that you can and will do something: 3. to be allowed to: . Learn more.


can, can noun [C] (CONTAINER). a metal container, esp. a closed, cylindrical container in which food and drink are packaged:. 110 synonyms of can from the Merriam-Webster Thesaurus, plus 97 related words, definitions, and antonyms. Find another word for can. Can: to bring (as an action or operation) to an immediate end.


Can, can 2. (kăn). n. 1. A usually cylindrical metal container. 2. Can(stylised as CAN) was a German experimental rockband formed in Colognein 1968 by the core quartet of Holger Czukay(bass, tape editing), Irmin Schmidt(keyboards), Michael Karoli(guitar), and Jaki Liebezeit(drums).


CAN, I can only speak to firsthand knowledge," he added. Google CEO Sundar Pichai initially followed his lead. Read� Find the latest Canaan Inc. (CAN) stock quote, history, news and other vital information to help you with your stock trading and investing.