Friday, November 9, 2012

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 received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/yjQ5c2yLFCsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate