[BangPypers] calling instance of the other class.

2009-06-22 Thread learningpython

Dear Python experts,

Please can you help in a following scenario..
I have some classes each for a Protocol Data Unit which you could consider
as a structures of elements 
example
class ex1:
class usr_mac(MAC_PDU):
'''
Group Voice Channel User
'''
def __init__(self):
self.protectFlag = BV.Bit1.new()
self.reserved = BV.Bit1.new()
self.flco =  BV.Bit6.new()
self.grpAddr = BV.Bit24.new()
self.srcAddr = BV.Bit24.new()
self.order = ['protectFlag', 
  'reserved', 
  'flco', 
  'grpAddr', 
  'srcAddr']

Now i have a another message which i need to create similar but now it
contains the above class instance as one of the members.

Please can you tell me how to pass instance of above class as a member of
the new message created in similar lines with one of the elements is the
complete data above (instance of above class). 

I am encapsulating above message in a transport layer message.
2. Now similarly, i would like given a choice to choose the instance of
other class as the i would like to pass  in other instance of class
similarly. 

Your kind help will be greatly appreciated. Please let me know if there are
clarifications i can give, I am posting this in a hurry. I am sure there
could be questions.

Thanks in advance
anand
-- 
View this message in context: 
http://www.nabble.com/calling-instance-of-the-other-class.-tp24145716p24145716.html
Sent from the BangPypers - Bangalore Python Users Group mailing list archive at 
Nabble.com.

___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


[BangPypers] [JOBS] Opening for Tech Lead at weRead

2009-06-22 Thread Tahir Hashmi
Hi

weRead (http://www.weread.com) is the world's largest social book
discovery site in the world with its presence on top Social Networks
including Facebook, Orkut, MySpace and Yahoo!, among others.

We have some really exciting tasks cut for us as we challenge
ourselves to get the attention of each and every book lover in the
world and then some. To accomplish that, we need some solid
engineering talent to add to our small but really smart team of
engineers.

If you have strong CS fundamentals, 7+ years of engineering experience
and have delivered on building highly scalable applications for the
web, do send in your resume to care...@weread.com. Of course, Python
programming skills would be a valuable asset!

Please visit http://weread.com/current_openings.php for more details
regarding the open position.

Thanks

-- 
Tahir Hashmi

We, the rest of humanity, wish GNU luck and Godspeed
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] calling instance of the other class.

2009-06-22 Thread Senthil Kumaran
On Mon, Jun 22, 2009 at 04:35:35AM -0700, learningpython wrote:

> Please can you tell me how to pass instance of above class as a member of
> the new message created in similar lines with one of the elements is the
> complete data above (instance of above class). 
> 
> I am encapsulating above message in a transport layer message.
> 2. Now similarly, i would like given a choice to choose the instance of
> other class as the i would like to pass  in other instance of class
> similarly. 

I am totally confused by the description. :(

If you still not very comfortable with Class terminologies in Python,
I would suggest you read any basic book (2-3 hours on the topic  would be
enough)  and perhaps you may find, what you are trying to do is
easy?



-- 
Senthil
I do not find in orthodox Christianity one redeeming feature.
-- Thomas Jefferson
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


[BangPypers] Django connection problem

2009-06-22 Thread VIJAY KUMAR
Hi 
   Need a help for below error.
       from django.contrib.auth.models import User
  File "c:\python26\lib\site-packages\django-1.0.2_final-   
py2.6.egg\django\contrib\auth\models.py", line 3, in 
   from django.db import models
    File 
"c:\python26\lib\site-packages\django-1.0.2_final-py2.6.egg\django\db\models\__init__.py",
 line 3, in 
        from django.db import connection
 ImportError: cannot import name connection
 
  when i looked in django.db there is no module by name connection. Can some 
one help to know more on this problem and how can i overcome this.
 
With Thanks
VIjay 
 

 


  Cricket on your mind? Visit the ultimate cricket website. Enter 
http://cricket.yahoo.com___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Django connection problem

2009-06-22 Thread Gora Mohanty
On Mon, 22 Jun 2009 19:14:21 +0530 (IST)
VIJAY KUMAR  wrote:

> Hi 
>    Need a help for below error.
>        from django.contrib.auth.models import User
>   File "c:\python26\lib\site-packages\django-1.0.2_final-   
> py2.6.egg\django\contrib\auth\models.py", line 3, in 
>    from django.db import models
>     File 
> "c:\python26\lib\site-packages\django-1.0.2_final-py2.6.egg\django\db\models\__init__.py",
>  line 3, in 
>         from django.db import connection
>  ImportError: cannot import name connection

What are you doing when you get this error.

>  
>   when i looked in django.db there is no module by name connection. Can some 
> one help to know more on this problem and how can i overcome this.
[...]

There is definitely a "connection" variable in django/db/__init.py__
which is where django/db/models/__init.py__ is importing from.

I suspect that this is some other issue, maybe a problem with
connecting to the database. What database are you using? Can
you connect to the database, using some other tool, but with
the same username/password as in Django's settings.py?

Regards,
Gora
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] calling instance of the other class.

2009-06-22 Thread learningpython

Sorry Senthil and all,
I am sure, it's pretty easy but don't i am not able to catch it. In C, i
just pass the & of the another structure in the structure element, some
thing close. 

Here is what i do .. a class is defined as mentioned, now this class is
element of another class
class Send_Msg_req(msg):
 def __init__(self):
   self.usr_mac =< Earlier class defined > 
   self.msgtype = 
   self.msgsize = 
   self.order = ['usr_mac', 
  'msgtype ',
   'msgsize ']

Now i like your expertize in giving me tips so that i have to declare and
keep sending above this message over serial port, but each time with
different class.
I hope i made it bit more clear. Sorry for the confusion.


Senthil Kumaran-6 wrote:
> 
> On Mon, Jun 22, 2009 at 04:35:35AM -0700, learningpython wrote:
> 
>> Please can you tell me how to pass instance of above class as a member of
>> the new message created in similar lines with one of the elements is the
>> complete data above (instance of above class). 
>> 
>> I am encapsulating above message in a transport layer message.
>> 2. Now similarly, i would like given a choice to choose the instance of
>> other class as the i would like to pass  in other instance of class
>> similarly. 
> 
> I am totally confused by the description. :(
> 
> If you still not very comfortable with Class terminologies in Python,
> I would suggest you read any basic book (2-3 hours on the topic  would be
> enough)  and perhaps you may find, what you are trying to do is
> easy?
> 
> 
> 
> -- 
> Senthil
> I do not find in orthodox Christianity one redeeming feature.
>   -- Thomas Jefferson
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
> 
> 

-- 
View this message in context: 
http://www.nabble.com/calling-instance-of-the-other-class.-tp24145716p24154873.html
Sent from the BangPypers - Bangalore Python Users Group mailing list archive at 
Nabble.com.

___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Django connection problem

2009-06-22 Thread VIJAY KUMAR
Hi,
   Am pressently using sqlite .
   The problem is in the django\db\__init__.py where it is importing 
connection module
    from django.db import connection


 

Thanks
Vijay 


--- On Mon, 22/6/09, Gora Mohanty  wrote:


From: Gora Mohanty 
Subject: Re: [BangPypers] Django connection problem
To: bangpypers@python.org
Date: Monday, 22 June, 2009, 9:49 PM


On Mon, 22 Jun 2009 19:14:21 +0530 (IST)
VIJAY KUMAR  wrote:

> Hi 
>    Need a help for below error.
>        from django.contrib.auth.models import User
>   File "c:\python26\lib\site-packages\django-1.0.2_final-   
> py2.6.egg\django\contrib\auth\models.py", line 3, in 
>    from django.db import models
>     File 
> "c:\python26\lib\site-packages\django-1.0.2_final-py2.6.egg\django\db\models\__init__.py",
>  line 3, in 
>         from django.db import connection
>  ImportError: cannot import name connection

What are you doing when you get this error.

>  
>   when i looked in django.db there is no module by name connection. Can some 
> one help to know more on this problem and how can i overcome this.
[...]

There is definitely a "connection" variable in django/db/__init.py__
which is where django/db/models/__init.py__ is importing from.

I suspect that this is some other issue, maybe a problem with
connecting to the database. What database are you using? Can
you connect to the database, using some other tool, but with
the same username/password as in Django's settings.py?

Regards,
Gora
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers



  ICC World Twenty20 England '09 exclusively on YAHOO! CRICKET 
http://cricket.yahoo.com___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers