Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9251217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:38:28+00:00 2026-06-18T10:38:28+00:00

I have an issue here is my django view def home(request): try: from_number =

  • 0

I have an issue here is my django view

 def home(request):
        try:
            from_number  = request.GET['from_number']
            to_number  = request.GET['to_number']
            messagetext  = request.GET['msg_text']
            date_time  = request.GET['date_time']
            date_received  = request.GET['date_received']
            status = 0
        except:
            LOG_ERROR('Invalid Parameter')

            #Return to some product page or 500 error with message
            #pass    #  return some value  after discussing with sir 
     #      #Based on from number identify the Vmn and his class anc class the respective receieve method of that class
        if from_number !=None  and to_number != None:
            try:getvmn = ServiceProvider.objects.get(status = False)
            except:
                LOG_FATAL("VMN doesn't exists ")
                getvmn = False
            if getvmn:
                print "-=-=-=-=-==-=-=-==================="
    #           get_related_class = ServiceProvider.objects.filter(id  = getvmn.merchant,status = False)
                get_related_class = ServiceProvider.objects.get(status = False)
                b = SMSMgr()
                for objec in b._allsp:
                    if objec.class_Name == 'MessageNet':
                       # messageglobalobject  =     
                        MessageNet.receive(MessageGlobal(from_number,to_number,messagetext,date_received,status))

Here is smsmessage.py

class MessageGlobal():
    def __init__(self,from_number,to_number,messagetext,date,status = None):
        self.messagetext = messagetext
        self.to_number = to_number
        self.from_number = from_number
        self.date = date
        self.status = status

Here is MessageNet class

class MessageNet():
    def __init__(self,username,password,sendingurl,class_Name):
        self.username = username
        self.password = password
        self.messagetext = None
        self.sendingurl = sendingurl
        self.class_Name = class_Name
        self.PhoneNumber = None
       # self.apiurl = apiurl

    def send(self,mg):

        payload = {'username': self.username, 'Pwd': self.password,'PhoneNumber':mg.tonumber,'PhoneMessage':mg.messagetext}
        r = requests.get(self.sendingurl, params=payload)
        LOG_INFO("Message sent to %s  via  %s", self.PhoneNumber,'Messagenet')
        #   Call to ms manager 

    def receive(self,getmessageobject):

        print "receive and notify the user "    

I am getting the error in line

MessageNet.receive(MessageGlobal(from_number,to_number,messagetext,date_received,status))
of my views .

I am trying to pass a object of MessageGlobal to the receieve method so that i can access them inside receive method of MessageNet class .

Please tell me Why ai am getting this error .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:38:30+00:00Added an answer on June 18, 2026 at 10:38 am

    You’re calling an instance method on a class rather than an instance. You need to instantiate a MessageNet object, then call receive on that instance, not on the class.

    Alternatively you could make it a classmethod, but then you won’t have access to any of the instance attributes (password, etc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue going on here. I am using PHP to get values
This issue's story started here: Cannot make memory view because object does not have
I have a strange issue here with my Django app. I implemented the user
I have the following code for managing file download through django. def serve_file(request, id):
I have a curious issue here In my ejbCreate() method from where i insert
I'm have a weird issue here. I have a UITableView using custom UITableViewCells. Everything
Hey guys I have a little issue here. I have a panel where I
I'm not sure if I have a threading issue here or not. On the
I have a really weird issue here. I'm using my local development server right
Having an issue here that I have tried everything I can think of but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.