Git Product home page Git Product logo

django-gae2django's People

Contributors

andialbrecht avatar imirkin avatar loewis avatar techtonik avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

django-gae2django's Issues

README doesn't match with current reitveld


Hi,

I'm trying to setup reitveld using django-gae2django, but the README says to do 
this: 

 - add 'gae2django.middleware.FixRequestUserMiddleware' to MIDDLEWARE_CLASSES
   below AuthenticationMiddleware

it turns out there is no AuthenticationMiddleware in MIDDLEWARE_CLASSES anymore.

Additionally, the next step says:

 - at the top of manage.py add

     import gae2django
     gae2django.install()

but there is no manage.py now.

Is there an easy fix to this to make it work?

Thanks, I'm really looking forward to using this.

Original issue reported on code.google.com by [email protected] on 18 Sep 2014 at 7:34

Query.filter() doesn't work if passed in a key

Rietveld code in codereview/views.py:_calculate_delta does:

      query = models.Patch.all()
      query.filter("filename =", patch.filename)
      query.filter("patchset =", other.key())
      other_patches = query.fetch(100)

Presumably this works on GAE. The current code in Query.filter does:

      where = '%s %r' % (property_operator, value)

Which ends up in a SQL query that looks like

... FROM `codereview_patch` WHERE (filename = 'asdf' AND patchset = 
<google.appengine.ext.db.Key object at 0x3590650>)

Original issue reported on code.google.com by [email protected] on 19 Oct 2010 at 4:36

autocomplete not work for uses haven't set nickname explictly

What steps will reproduce the problem?
1. add a new user `blah' from /admin and set its email: [email protected]
2. sign in with user `blah'
3. open http://localhost:8000/account?q=blah&limit=10

What is the expected output? What do you see instead?
[email protected] (blah)
nothing

What version of the product are you using? On what operating system?
r95

Please provide any additional information below.

It seems gae2django/gaeapi/appengine/ext/db.py:get_or_insert should call 
new:put() instead of 
new:save()

GAE implements put exact the same as save, and rietelvd uses put().


Original issue reported on code.google.com by lihaitao on 27 Jul 2009 at 11:21

Call model.key() multiple times give not unique result

>>> import codereview
>>> acc = codereview.models.Account.all()[0]
>>> acc.key()
<google.appengine.ext.db.Key object at 0x1584a30>
>>> acc.key()
<google.appengine.ext.db.Key object at 0x1584a50>
>>> acc.key()
<google.appengine.ext.db.Key object at 0x1584a30>
>>> acc.key()
<google.appengine.ext.db.Key object at 0x1584a50>

What version of the product are you using? On what operating system?
r95

Please provide any additional information below.
This issue is found when the autocomplete request (e.g. 
http://localhost:8000/account?
q=blah&limit=10) returns duplicated results if the user nickname (blah) is the 
prefix of the email 
[email protected].

Original issue reported on code.google.com by lihaitao on 27 Jul 2009 at 11:44

Implement keys_only query

What steps will reproduce the problem?
1. Run Rietveld example
2. Open Search page
3. Try to run a search

keys_only queries are not implemented yet.

Original issue reported on code.google.com by albrecht.andi on 25 Feb 2011 at 10:58

upload.py script patch doesn't respect to the --no_cookies option

What steps will reproduce the problem?
1. Clean the file ~/.codereview_upload_cookies
2. Execute upload.py with --no_cookies option
3. Check the cookies file

What is the expected output? 
Upload successful. No cookie saved.

What do you see instead?
Exception:
AttributeError: CookieJar instance has no attribute 'save'

Please provide any additional information below.
http://code.google.com/p/django-
gae2django/source/browse/trunk/examples/rietveld/patches/upload.diff#57

Original issue reported on code.google.com by lihaitao on 11 Jan 2010 at 5:14

Rietveld example, "Branch with this Gae key already exists." error after multiple updates

What steps will reproduce the problem?
1.Follow the instruction to setup a new rietveld install
2.In the repository tab, click "initialize repositories"
3.In the repository, click "edit" on the py3k branch
4.Making no change, click the "update" button
5.Repeat steps 3 & 4, possibily switching branches (I counted 3 updates)
5.The error message """
    * Branch with this Gae key already exists.
""" is displayed.

Remarks: Once this error message appears, it is no longer possible to add
or update a branch without having this error message.

What version of the product are you using? On what operating system?
gae2django: subversion revision r119

Please provide any additional information below.

The fields
"Gae key", "Gae parent ctype", "Gae parent id"... are visible in the edit
branch form. They are empty, and I'm not sure if they are relevant to the user.

Original issue reported on code.google.com by [email protected] on 6 Oct 2009 at 3:17

Accessing of ReferenceProperties

GAE allows accessing of ReferenceProperties via model classes.

For example, if you have those classes

class Model1(db.Model):
  value = db.StringProperty()

class Model2(db.Model):
  ref = db.ReferenceProperty(Model1)

the following should work:

logging.info('Test %r' % Model2.ref)

In revision 368 of Rietveld
(http://code.google.com/p/rietveld/source/detail?r=368) the line
(views.py#1866)

pkey = getattr(c, '_patch', None)

was changed to the documented way to access the primary key:

pkey = models.Comment.patch.get_value_for_datastore(c)

The latter doesn't work with gae2django for some reason.

Original issue reported on code.google.com by albrecht.andi on 25 Nov 2008 at 8:48

Mail API incorrectly encodes CC field

What steps will reproduce the problem?
1. From example program Rietveld
2. Publish a comment, fill a valid email to reviewers and CC to 
'[email protected]'
3. Check the CC header of the mail from reviewer's mailbox

What is the expected output? What do you see instead?
CC: test@example
CC: 'test@example'@hostname.domain.name

What version of the product are you using? On what operating system?
r114

Please provide any additional information below.
Django doesn't support CC out of the box. 
(http://code.djangoproject.com/ticket/7722)


Original issue reported on code.google.com by lihaitao on 8 Sep 2009 at 8:07

examples/rietveld/UPDATES should mention patchset.owner_id is deprecated

Rietveld revision 59805f019927 removed patchset.owner_id NOT NULL column from 
database.
http://code.google.com/p/rietveld/source/detail?r=59805f019927c0fab9ade939aa1f72
6fae75efdb&path=/codereview/models.py
So UPDATES file should mention the owner_id must be removed or it will fail with
codereview_patchset.owner_id may not be NULL
error while submitting the issue.
Instructions for sqlite in patch.

Original issue reported on code.google.com by [email protected] on 13 Dec 2011 at 11:34

Attachments:

get_value_for_datastore not returning key

Commit http://code.google.com/p/rietveld/source/detail?r=549 in Rietveld... 
again (small commit, but packed a lot of bugs in it!).

Basically it does (pseudocode):

foreach comment:
  cache[models.Comment.patch.get_value_for_datastore(comment)]++

foreach patch:
  x = cache[patch.key()]

Now it would _appear_ that get_value_for_datastore is actually returning a real 
Patch object, not the key.

Here's what gae does:

http://code.google.com/p/googleappengine/source/browse/trunk/python/google/appen
gine/ext/db/__init__.py

Looks like they separately store both the key and the resolved reference 
property, returning the former in get_value_for_datastore. I don't see an easy 
way of achieving this functionality without doing the same thing...

Original issue reported on code.google.com by [email protected] on 7 Nov 2010 at 7:29

List property filter not applied unless counted first

The current test passes, but slight changes make it fail. See patch below that 
changes the test and provides a fix. The QuerySet.iterator needs to be run 
through first, otherwise results from the underlying django Query object are 
returned; calling len(QuerySet) causes the results to be iterated over and 
cached inside django's Query object.

As a sidenote, the django API uses _clone all over the place, which won't 
maintain the _listproperty_filter; However I couldn't get anything to fail as a 
result of that, so I didn't add in a _clone override.

[This bug causes the "reviewable by me" list to not be filtered to issues where 
you are the reviewer in Rietveld]

Patch follows:

Index: gae2django/tests/test_gql.py
===================================================================
--- gae2django/tests/test_gql.py        (revision 133)
+++ gae2django/tests/test_gql.py        (working copy)
@@ -20,14 +20,17 @@
         obj.save()
         query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                              ' WHERE xlist = :1'), 'foo')
+        self.assertEqual([obj], list(query))
         self.assertEqual(query.count(), 1)
         tobj = query.get()
         self.assertEqual(tobj.xlist, ['foo', 'bar', 'baz'])
         query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                              ' WHERE xlist = :1'), 'nomatch')
+        self.assertEqual([], list(query))
         self.assertEqual(query.count(), 0)
         tobj.xlist = ['bar', 'baz']
         tobj.save()
         query = db.GqlQuery(('SELECT * FROM RegressionTestModel'
                              ' WHERE xlist = :1'), 'foo')
+        self.assertEqual([], list(query))
         self.assertEqual(query.count(), 0)
Index: gae2django/gaeapi/appengine/ext/db.py
===================================================================
--- gae2django/gaeapi/appengine/ext/db.py       (revision 133)
+++ gae2django/gaeapi/appengine/ext/db.py       (working copy)
@@ -491,7 +491,7 @@

     def next(self):
         self._idx += 1
-        if self._results.count() > self._idx:
+        if len(self._results) > self._idx:
             return self._results[self._idx]
         else:
             raise StopIteration
@@ -640,7 +640,7 @@
         if self._results is None:
             self._execute()
         idx = self._idx
-        c = len(list(self._results))
+        c = len(self._results)
         self._idx = idx
         return c

Original issue reported on code.google.com by [email protected] on 27 Aug 2010 at 1:38

Query.ancestor() is not supported, but Rietveld now uses it

Rietveld commit http://code.google.com/p/rietveld/source/detail?r=549 uses the 
.ancestor() call which raises a NotImplementedError.

This seems like it would be fairly tricky to implement via joins, but it seems 
there is a gae_ancestry column, so perhaps we can add something like "... and 
gae_ancestry like '%@PatchSet_1@%'" to the final query?

Original issue reported on code.google.com by [email protected] on 29 Aug 2010 at 8:57

Method User.user_id() doesn't exist.

The method User.user_id() doesn't exist and needs to be implemented.

Original issue reported on code.google.com by albrecht.andi on 13 Oct 2011 at 1:44

Enter one-line summary

when i run $ ./manage.py syncdb, output:

ImproperlyConfigured: settings.DATABASES is improperly configured. Please 
supply the ENGINE value. Check settings documentation for more details.

here is my settings.py: http://ix.io/7rT

i change to engine to DATABASE_ENGINE = 'django.db.backends.mysql' always not 
work

Original issue reported on code.google.com by [email protected] on 21 Aug 2013 at 8:39

Problem with Model.get_by_id(keys)

What steps will reproduce the problem?
1. Call Model.get_by_id(keys) where keys is a list containing a single item


What is the expected output? What do you see instead?

A list with a single item should be returned, but the entity is returned 
instead.

Environment:

Request Method: GET
Request URL: http://192.168.101.230:7070/codereview/starred
Django Version: 1.1 pre-alpha SVN-9718
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.markup',
 'django.contrib.admin',
 'gae2django',
 'rietveld_helper',
 'codereview',
 'orbit_helper',
 'help']
Installed Middleware:
('django.middleware.http.SetRemoteAddrFromForwardedFor',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'gae2django.middleware.FixRequestUserMiddleware',
 'rietveld_helper.middleware.AddUserToRequestMiddleware',
 'django.middleware.doc.XViewMiddleware')


Traceback:
File "/home/codereview/app/django/core/handlers/base.py" in get_response
  81.                 response = middleware_method(request, callback, 
callback_args, callback_kwargs)
File "/home/codereview/app/rietveld_helper/middleware.py" in process_view
  21.         response = view_func(request, *view_args, **view_kwargs)
File "/home/codereview/app/codereview/views.py" in login_wrapper
  450.     return func(request, *args, **kwds)
File "/home/codereview/app/codereview/views.py" in starred
  670.     issues = [issue for issue in models.Issue.get_by_id(stars)

Exception Type: TypeError at /codereview/starred
Exception Value: 'Issue' object is not iterable



Please use labels and text to provide additional information.

Original issue reported on code.google.com by albrecht.andi on 10 Dec 2009 at 2:03

get_by_key_name should return a list if keys is a list

The current implementation of get_by_key_name returns a single item instead
of a list if there's only one item in the requested keys.  A list with a
single item should be returned.

http://code.google.com/appengine/docs/python/datastore/modelclass.html#Model_get
_by_key_name

Original issue reported on code.google.com by paulegan on 18 Feb 2010 at 3:49

Attachments:

Error when updating an issue with an invalid nickname in rietveld example

What steps will reproduce the problem?
1) insert an issue
2) edit the issue and adds a non existing nickname in the list of
reviewers
3) save the change

What version of the product are you using? On what operating system?
svn r117, Windows XP SP3, Python2.6


Please provide any additional information below.
Traceback:
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\django\core\handle
rs\base.py"
in get_response
  87.                 response = middleware_method(request, callback,
callback_args, callback_kwargs)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\rietveld_helper\mi
ddleware.py"
in process_view
  21.         response = view_func(request, *view_args, **view_kwargs)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\views.p
y"
in login_wrapper
  490.     return func(request, *args, **kwds)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\views.p
y"
in issue_wrapper
  525.     return func(request, *args, **kwds)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\views.p
y"
in issue_editor_wrapper
  572.     return func(request, *args, **kwds)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\views.p
y"
in edit
  1454.     reviewers = _get_emails(form, 'reviewers')
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\views.p
y"
in _get_emails
  1166.             account = models.Account.get_account_for_nickname(email)
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\codereview\models.
py"
in get_account_for_nickname
  602.     return cls.all().filter('lower_nickname =', nickname.lower()).get()
File
"C:\dev\third-parties\codereview\gae2django\examples\rietveld\gae2django\gaeapi\
appengine\ext\db.py"
in get
  61.         return list(self)[0]

Exception Type: IndexError at /1/edit
Exception Value: list index out of range

---

Remarks: Should probably test if list(self) is empty and return None in
that case in Query.get()... 

Original issue reported on code.google.com by [email protected] on 1 Oct 2009 at 1:13

Support Unicode query parameters

If a query parameter is a Unicode string, and the GQL is generated with %s 
substitution, the resulting GQL expression will also be a Unicode string. This 
fails, in turn, since Python rejects keyword arguments that are Unicode strings.

The attached patch fixes this problem.

Original issue reported on code.google.com by [email protected] on 6 Oct 2010 at 7:34

Attachments:

Unable to remove issues in Rietveld example

What steps will reproduce the problem?
1.Create issue
2.Delete issue

What is the expected output? What do you see instead?
Django removes the issue, but outputs attached traceback. From the code it 
seems that fail occurs, because issue with all its properties is deleted before 
_notify_issue tries to access its properties.

How come that this works on AppEngine?

Original issue reported on code.google.com by [email protected] on 13 Jan 2011 at 6:08

Attachments:

Blob properties coming out of database base64'd

e.g. in rietveld when retrieving patchset.data, its value comes out as base64 
(which upsets all manners of logic later on). This appears to be due to a 
missing __metaclass__ annotation which is necessary on any field that 
implements to_python. [see 
http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#the-subfieldbase
-metaclass for more details]

Patch below fixes the problem.

Index: gae2django/gaeapi/appengine/ext/db.py
===================================================================
--- gae2django/gaeapi/appengine/ext/db.py       (revision 132)
+++ gae2django/gaeapi/appengine/ext/db.py       (working copy)
@@ -252,6 +252,8 @@

 class BlobProperty(models.TextField):

+    __metaclass__ = models.SubfieldBase
+
     def __init__(self, *args, **kwds):
         kwds = _adjust_keywords(kwds)
         super(BlobProperty, self).__init__(*args, **kwds)

Original issue reported on code.google.com by [email protected] on 17 Jul 2010 at 12:59

Rietfeld example login gives: CSRF verification failed. Request aborted error on latest django

What steps will reproduce the problem?

1. Follow http://code.google.com/appengine/articles/pure_django.html
instructions to run rietveld example.
2. Go to http://127.0.0.1:8000/ and click on login
3. Input the superuser username and password

What is the expected output? What do you see instead?
Expected: logged in
Got: http://code.google.com/appengine/articles/pure_django.html

What version of the product are you using? On what operating system?
trunk checked out at rev 122, django trunk rev 12205, OS X

Please provide any additional information below.
You need to add {% csrf_token %} to
examples/rietveld/rietveld_helper/templates/registration/login.html

Original issue reported on code.google.com by [email protected] on 11 Jan 2010 at 8:04

Ancestry in wrong order

The ancestry (gae_ancestry) that is stored internally is in wrong order. 
Currently it's "@child@parent@grandpa@" but to improve query performance it 
should be "@grandpa@parent@child@".

Original issue reported on code.google.com by albrecht.andi on 5 Oct 2010 at 12:55

401 from upload.py

I started the rietveld server with

./manage.py runserver -v 2 --traceback localhost:8010 

Then added a new issue as follows:

upload.py -v -s localhost:8010 -d "Admin feature" -r [email protected]

It prompted for the subject which resulted in the following log message:

[27/May/2009 18:46:01] "POST /upload HTTP/1.1" 401 14

Followed by prompts for username, and password which resulted in log messages 
of:

[27/May/2009 18:47:40] "POST /accounts/login/ HTTP/1.1" 302 0
[27/May/2009 18:47:40] "POST /upload HTTP/1.1" 401 14

Followed by a re-prompt for the username and password. 

It appears that the username/password is correct but the failure is on the 
/upload of the diff 
package.

I'm very new to python but was able to follow the (simple) install directions 
without a problem. 
The database appears to be created with some reasonable table names. I'm 
running on Mac OS 
10.5.6, I just downloaded django-gae2django today and applied all patches 
during the install 
(make all). Python is v 2.5.1, sqlite is 3.5.10

I also have tried the above procedure after deleting the cookie file with a 
similar result. That is, 
the first /upload failure isn't logged until after the credentials are supplied 
as would be expected 
based upon a review of the code.

Original issue reported on code.google.com by [email protected] on 28 May 2009 at 1:42

Adding new users through admin interface doesn't require an email adress

What steps will reproduce the problem?
1. Create a new user through admin interface.
2. Try to login with the new user.
3.

What is the expected output? What do you see instead?

Account.get_account_for_user() in /codereview/models.py asserts that an
email adress for an user exists, but creating a user through Django's admin
interface allows the email field to be empty.

Reported by Rakan via private mail.


Please use labels and text to provide additional information.

Original issue reported on code.google.com by albrecht.andi on 22 Mar 2009 at 11:29

Logout from admin interface points to wrong URL

What steps will reproduce the problem?
1. Login to admin interface
2. Try to logout again.

What is the expected output? What do you see instead?

The logout URL points to "/admin/admin/logout" instead of "/admin/logout".

Issue reported by Rakan via private mail. 


Please use labels and text to provide additional information.


Original issue reported on code.google.com by albrecht.andi on 22 Mar 2009 at 11:24

Correctly form login urls

see 
https://code.google.com/r/bubenkoff-gae2django/source/diff?spec=svna352ca41bd850
84bac8f525241137e2e9ee8490f&name=urlquote-login-urls&r=da2fb061ed58241f594e70c28
4a7144da5a6ac43&format=side&path=/gae2django/gaeapi/appengine/api/users.py&old_p
ath=/gae2django/gaeapi/appengine/api/users.py&old=4e8aa8ff55e641fc90f0d59aa93524
df706476d6
on my clone 
https://code.google.com/r/bubenkoff-gae2django/source/browse/?name=urlquote-logi
n-urls

Original issue reported on code.google.com by bubenkoff on 24 Jan 2014 at 12:29

Add setup.py for packaging

I wanted to install gae2django as a package I can import in my apps, so I 
created the attached setup.py.

You'll likely want to change some of the values (wasn't sure what I should 
put for contact email).

Tested against python 2.6

Original issue reported on code.google.com by [email protected] on 21 Sep 2009 at 10:19

Attachments:

Rietveld example: fix download link for upload.py if app is running on production

What steps will reproduce the problem?
1.Install Django in production environment (sample configuration is available 
from http://codereview.appspot.com/3760048/ )
2.Note Django doesn't serve static resources if /static alias is commented in 
server conf (this is by design as explained in README patch above)
3.If /static alias is active, the link /static/upload.py gives 404

What is the expected output? What do you see instead?
Expected to be able to download upload.py from the server.

What version of the product are you using? On what operating system?
Debian Lenny/Django 1.1.3/Apache 2/modwsgi/Python 2.5.2

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 13 Jan 2011 at 1:19

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.