it WORKS now :-) I was playing with it and suddenly it is OK. I dont know
what it was, I believe " vs '
these are working definitions:
db.define_table("Mjesta",
Field <http://127.0.0.1:8000/examples/global/vars/Field>("PostanskiBroj",
"integer",notnull=True,unique=True),
Field <http://127.0.0.1:8000/examples/global/vars/Field>("Naziv",requires=
IS_NOT_EMPTY <http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>()),
primarykey=["PostanskiBroj"],
migrate=False,
format="%(Naziv)s %(PostanskiBroj)s")
db.define_table("Partneri",
Field <http://127.0.0.1:8000/examples/global/vars/Field>("Sifra","integer",
notnull=True,unique=True),
Field <http://127.0.0.1:8000/examples/global/vars/Field>("Naziv",requires=
IS_NOT_EMPTY <http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>()),
Field <http://127.0.0.1:8000/examples/global/vars/Field>("Mjesto","reference
Mjesta"),
primarykey=["Sifra"],
migrate=False)
Dana petak, 3. listopada 2014. 20:13:55 UTC+2, korisnik Niphlod napisao je:
> what if you don't use requires=IS_EMPTY() ?
>
> On Friday, October 3, 2014 8:52:12 AM UTC+2, Alen Cerovic wrote:
>>
>> is there any resolution to this, any ideas, or are there plans to make it
>> work in future?
>>
>> Dana ponedjeljak, 29. rujna 2014. 12:26:11 UTC+2, korisnik Alen Cerovic
>> napisao je:
>>>
>>> Hi pn, I am expecting dropdown list of Mjesta when I add/edit record in
>>> Partneri
>>> tried putting 'requires' Field
>>> <http://127.0.0.1:8000/examples/global/vars/Field>('Mjesto','reference
>>> Mjesta.PostanskiBroj',requires=IS_NOT_EMPTY
>>> <http://127.0.0.1:8000/examples/global/vars/IS_NOT_EMPTY>*()) *but no
>>> dropdown
>>>
>>> Dana nedjelja, 28. rujna 2014. 20:29:50 UTC+2, korisnik pn napisao je:
>>>
>>>> Can you provide some clarification on what behavior are you expecting
>>>> but not seeing when you create the reference? For example, are you able to
>>>> create entries in the 'Partneri' table that refer keys not in the 'Mjesta'
>>>> table? A quick workaround would be to put in a 'requires' lambda into the
>>>> field definition in the Partneri table. This way you can define your own
>>>> custom rules.
>>>>
>>>> On Saturday, September 27, 2014 2:51:31 AM UTC-4, Alen Cerovic wrote:
>>>>>
>>>>> tried
>>>>> 'reference Mjesta' - no error but also nothing happens
>>>>> 'reference PostanskiBroj' - Query Not Supported: 'DAL' object has no
>>>>> attribute 'PostanskiBroj'
>>>>>
>>>>> I did not dive in source code but is it difficult to make references
>>>>> between legacy tables reliable. From my perspective it is very important
>>>>> as many web projects does not start from scratch.
>>>>>
>>>>> Dana subota, 27. rujna 2014. 08:01:22 UTC+2, korisnik Massimo Di
>>>>> Pierro napisao je:
>>>>>
>>>>>> 'reference Mjesta.PostanskiBroj'* should be *'reference
>>>>>> PostanskiBroj'
>>>>>>
>>>>>>
>>>>>> *but I would not swear by references for legacy keyed tables.*
>>>>>> On Thursday, 25 September 2014 11:58:21 UTC-5, Alen Cerovic wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am totaly new to web2py, actually started yesterday :)
>>>>>>> I am trying to work with legacy mssql database and having problems
>>>>>>> in referencing two legacy keyed tables
>>>>>>>
>>>>>>> db.define_table('Mjesta',
>>>>>>> Field <http://127.0.0.1:8000/examples/global/vars/Field>(
>>>>>>> 'PostanskiBroj','integer',notnull=True,unique=True),
>>>>>>> Field <http://127.0.0.1:8000/examples/global/vars/Field>('Naziv'),
>>>>>>> primarykey=['PostanskiBroj'],
>>>>>>> migrate=False)
>>>>>>>
>>>>>>> db.define_table('Partneri',
>>>>>>> Field <http://127.0.0.1:8000/examples/global/vars/Field>('Sifra',
>>>>>>> 'integer'),
>>>>>>> Field <http://127.0.0.1:8000/examples/global/vars/Field>('Naziv'),
>>>>>>> Field
>>>>>>> <http://127.0.0.1:8000/examples/global/vars/Field>('Mjesto','reference
>>>>>>> Mjesta.PostanskiBroj'),
>>>>>>> primarykey=['Sifra'],
>>>>>>> migrate=False)
>>>>>>>
>>>>>>> no errors but field Partneri.Mjesto does not reference
>>>>>>> Mjesta.PostanskiBroj
>>>>>>>
>>>>>>> What am I doing wrong?
>>>>>>>
>>>>>>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.