List Info

Thread: Strange syntax error




Strange syntax error
country flaguser name
United States
2007-07-01 06:53:08
Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4390476

By: peter-melvyn

Hi,

I'm beginner in Python, Pydev and Django and I encoutered a
syntax error in
my aplication I don't know hot to solve:

1. I defined class MyModel(nodels.Model): ...
2. Its super class has attribute objects 
3. In Python interpreter I can type:
>>> from myapp.models import MyModel
>>> o = MyModel.objects.get(xxx='....')
and it works as I'd expect

4. But if I write the same commands in Pydev 1.3.5 (Eclipse
3.2.2), I get the
error 'Undefined variable from import: objects' (objects is
underlined)

5. If I define member 'objects' in MyModel again (even if I
inherited one from
ancestor), the error disappears.

Please, could you advise where is a problem and how to solve
it?


Thanks, Peter


____________________________________________________________
__________
You are receiving this email because you elected to monitor
this forum.
To stop monitoring this forum, login to SourceForge.net and
visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=
293649

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Pydev-users mailing list
Pydev-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-users


RE: Strange syntax error
country flaguser name
United States
2007-07-02 11:42:42
Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4392285

By: fabioz

Actually, that's not a syntax error. Pydev is flagging that
as a semantic error,
saying that it can't find a token named 'objects' in your
class. This can happen
because pydev does a static analysis and that attribute is
probably defined
in runtime (so, the static analysis can not find it). You
can probably just
ignore that error (the dynamic nature of python makes some
things almost impossible
to detect).

You can let pydev know that it was an 'expected' error if
you do ctrl+1 in the
given line and select the option to ignore it.

Cheers,

Fabio

____________________________________________________________
__________
You are receiving this email because you elected to monitor
this forum.
To stop monitoring this forum, login to SourceForge.net and
visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=
293649

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Pydev-users mailing list
Pydev-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-users


RE: Strange syntax error
country flaguser name
United States
2007-07-02 14:09:28
Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4392944

By: peter-melvyn

As you've adviced, I marked this token as UnknownVariable and everything works
fine.

Thanks for your help and for pydev - its the great tool

Thankx, Peter

____________________________________________________________
__________
You are receiving this email because you elected to monitor
this forum.
To stop monitoring this forum, login to SourceForge.net and
visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=
293649

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Pydev-users mailing list
Pydev-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-users


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )