Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
muhammed riyas  
View profile  
 More options Nov 9 2012, 6:33 am
From: muhammed riyas <muhammedriyas.2...@gmail.com>
Date: Fri, 9 Nov 2012 03:33:52 -0800 (PST)
Local: Fri, Nov 9 2012 6:33 am
Subject: Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"

hi,
     while trying to delete the datas from the datastore it shows the
error...

BadArgumentError at /employee/removeall/ Expected an instance or iterable
of (<class 'google.appengine.ext.db.Model'>, <class
'google.appengine.api.datastore_types.Key'>, <type 'basestring'>); received
<bound method Employeeprofile.key of <ITISMYAPP.main.models.Employeeprofile
object at 0xb090aac>> (a instancemethod).  Request Method: GET  Request URL:
http://localhost:9778/employee/removeall/  Exception Type: BadArgumentError  Exception
Value: Expected an instance or iterable of (<class
'google.appengine.ext.db.Model'>, <class
'google.appengine.api.datastore_types.Key'>, <type 'basestring'>); received
<bound method Employeeprofile.key of <ITISMYAPP.main.models.Employeeprofile
object at 0xb090aac>> (a instancemethod).  Exception Location: /home/user/google_appengine/google/appengine/api/datastore.py
in NormalizeAndTypeCheck, line 148  

//in my view

from ITISMYAPP.main.models import Employeeprofile
from google.appengine.ext import db
def removeall(request):
    employees =Employeeprofile.all().fetch(2000)
    employeekeys = []
    for employee in employees:
        employeekeys.append(employee.key)
    db.delete(employeekeys)
    return render_to_response('main/index.html')

i dont know why?,,,,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Roseman  
View profile  
 More options Nov 9 2012, 9:19 am
From: Daniel Roseman <dan...@roseman.org.uk>
Date: Fri, 9 Nov 2012 06:19:53 -0800 (PST)
Local: Fri, Nov 9 2012 9:19 am
Subject: Re: Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"

You should ask AppEngine questions on the relevant AppEngine group, not
here, as this is not a Django question.

But your problem is that `.key` is a method, not an attribute, so you
should call it: `employee.key()`.
--
DR.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kev Dwyer  
View profile  
 More options Nov 10 2012, 1:59 am
From: Kev Dwyer <kevin.p.dw...@gmail.com>
Date: Sat, 10 Nov 2012 06:57:52 +0000
Local: Sat, Nov 10 2012 1:57 am
Subject: Re: Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"

Hello,

Your question isn't related to Django, so it is not suitable for this group.  
You should send questions about App Engine software to an App Engine-related
group.

Having said that, the error message that you are getting is telling you that
your employeekeys list does not contain keys, it contains references to the
key method of each Employee instance in your query resultset.

You need to change the line

employeekeys.append(employee.key)

to

employeekeys.append(employee.key())

Now your list will contain the keys.

Cheers,

Kev


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »