Wednesday, June 30, 2010

Re: Should I start to use Mako from beginning?

Hi,

On 2010-06-30 17:34:25 +0200, AllenDang said:

> I'm new to django, it's amazing! But after I did some research from
> google, I found out that some people say that the default template
> engine of django is not that good to use, they recommend Mako as a
> replacement.
>
> So I'm wondering if I should start learning and using Mako from
> beginning?
>
> Frankly, it's hard for me to judge. In one hand, I think it's better
> to use the default components to understand the design philosophy
> behind. In another hand, I also think to use a commonly recommended
> replacement may lead me to a straight forward way to archive the goal.
>
> And the same concern also happened for the data model component.
> Should I use SQLAchemy from beginning?

IMHO, Django's strength is the complete consistent stack.

So I would use everything it provides or use another smaller framework,
like bfg.repoze or flask.

Kai

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Signal emitted after successful login?

On Jun 29, 9:51 pm, Daniel Hilton <daniel.hil...@gmail.com> wrote:
> On 29 June 2010 20:07, Andy McKay <a...@clearwind.ca> wrote:> On 2010-06-29, at 10:48 AM, tiemonster wrote:
>
> >> Is a signal emitted after a successful login? I need to hook a
> >> particular piece of code into that point in the application.
>
> One easy way is to wrap the login view function and execute your code
> once a user has successfully been authorised. If you look at the
> account app included in
> Pinax, there is an example of how this could work.
>
> HTH,
> Dan

Dan - do you have URL for that "account app" module?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: change displayed name of users object

On Jun 29, 7:43 pm, Jacob Fenwick <jacob.fenw...@gmail.com> wrote:
> Thanks for the link Derek.
>
> I don't think it quite does what I want.
>
> I guess I should have been more specific.
>
> I want to change how the Users object is displayed in the Django admin.
>
> This is a one line change in the Django code, but I would rather not change
> Django if I can avoid it.
>
> Is there a way to do something like subclassing the Django Users object and
> use that for authentication instead of the original Users object?
>
> Jacob
>
> On Tue, Jun 29, 2010 at 10:01 AM, derek <gamesb...@gmail.com> wrote:
> > On Jun 28, 7:54 pm, Jacob Fenwick <jacob.fenw...@gmail.com> wrote:
> > > Is there a simple way to change the displayed name of the users object in
> > > the auth package?
>
> > > I don't care about what it's called under the hood. I just want to change
> > > what the user sees.
>
> > > I'd like to avoid changing the code directly in the Django library as
> > that
> > > will make upgrades difficult.
>
> > > I came across this article but it's quite old and I'm hoping there's a
> > > better way:
>
> > >http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m...
>
> > > Jacob
>
> > Have a look at:
>
> >http://bradmontgomery.blogspot.com/2010/04/pretty-options-for-djangos...
>

"This is a one line change in the Django code" - no, there is no
change to Django's code in this approach.

The "subclassing" approach is probably best done with a UserProfile;
there is lots written about that. For info related to your question,
you could start with my original question here:
http://groups.google.com/group/django-users/browse_thread/thread/d39e05a9b2d33e7b

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Should I start to use Mako from beginning?



On Thu, Jul 1, 2010 at 10:58 AM, Alexander Jeliuc <jeliucalexandr@gmail.com> wrote:
Default template engine is very nice... and more than enough. 


On Thu, Jul 1, 2010 at 8:22 AM, Kenneth Gonsalves <lawgon@au-kbc.org> wrote:
On Wednesday 30 June 2010 21:04:25 AllenDang wrote:
> I'm new to django, it's amazing! But after I did some research from
> google, I found out that some people say that the default template
> engine of django is not that good to use, they recommend Mako as a
> replacement.

it is not wise to listen to people - the default template engine is great in
django and most people use it - however there is no harm in using the engine
of your choice
>
> So I'm wondering if I should start learning and using Mako from
> beginning?
>
> Frankly, it's hard for me to judge. In one hand, I think it's better
> to use the default components to understand the design philosophy
> behind. In another hand, I also think to use a commonly recommended
> replacement may lead me to a straight forward way to archive the goal.
>
> And the same concern also happened for the data model component.
> Should I use SQLAchemy from beginning?
>

again the django ORM is used by most people - but again it is your choice.

--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


Default Templating stuff in Django can be extended very easily writing simple Python code

Even the ORM can be extended by writing SQL though it defeats the purpose sometimes. 99% of time, you don't need to write any SQL if you are on the latest trunk

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Should I start to use Mako from beginning?

Default template engine is very nice... and more than enough. 

On Thu, Jul 1, 2010 at 8:22 AM, Kenneth Gonsalves <lawgon@au-kbc.org> wrote:
On Wednesday 30 June 2010 21:04:25 AllenDang wrote:
> I'm new to django, it's amazing! But after I did some research from
> google, I found out that some people say that the default template
> engine of django is not that good to use, they recommend Mako as a
> replacement.

it is not wise to listen to people - the default template engine is great in
django and most people use it - however there is no harm in using the engine
of your choice
>
> So I'm wondering if I should start learning and using Mako from
> beginning?
>
> Frankly, it's hard for me to judge. In one hand, I think it's better
> to use the default components to understand the design philosophy
> behind. In another hand, I also think to use a commonly recommended
> replacement may lead me to a straight forward way to archive the goal.
>
> And the same concern also happened for the data model component.
> Should I use SQLAchemy from beginning?
>

again the django ORM is used by most people - but again it is your choice.

--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Should I start to use Mako from beginning?

On Wednesday 30 June 2010 21:04:25 AllenDang wrote:
> I'm new to django, it's amazing! But after I did some research from
> google, I found out that some people say that the default template
> engine of django is not that good to use, they recommend Mako as a
> replacement.

it is not wise to listen to people - the default template engine is great in
django and most people use it - however there is no harm in using the engine
of your choice
>
> So I'm wondering if I should start learning and using Mako from
> beginning?
>
> Frankly, it's hard for me to judge. In one hand, I think it's better
> to use the default components to understand the design philosophy
> behind. In another hand, I also think to use a commonly recommended
> replacement may lead me to a straight forward way to archive the goal.
>
> And the same concern also happened for the data model component.
> Should I use SQLAchemy from beginning?
>

again the django ORM is used by most people - but again it is your choice.

--
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Django on multiple servers? (Deployment Problem)

another problem: im running this app on top of another page, so say www.example.com is the site, it wont allow me to access just any other page if the app is at the root of the site (www.example.com/myapp would work, but www.example.com/siteinfo wouldnt (unless i suppose i wrote a url template for every other page on the site)). however, if i host the app say, at www.example.com/app/myapp, it works fine, except for when submitting, say vote data. where it is at example.com/app/myapp/poll/1 and you submit a vote, it tries to direct me to example.com/app/myapp/poll/1/app/myapp/poll/1/vote, which obviously doesnt exist.
anyway, sorry again, i am kinda flooding this thing.

On Wed, Jun 30, 2010 at 11:02 PM, Paul Gully <nano3.14@gmail.com> wrote:
Ok, again. i feel like a question whore, but i think this should be the last thing. I fixed the database problem for the main app, but the admin site isnt working at all, im getting an internal server error (500) when i try to access it. halp?


On Wed, Jun 30, 2010 at 10:24 PM, Paul Gully <nano3.14@gmail.com> wrote:
Oh wow. ok, so i solved that problem (it was just the sys.path thing in the wsgi file. easy fix) ,but now django is unable to open the database files to render the URLs. im using SQLite, so again, i assume the problem is that this project isn't 'native' to the computer, however that doesn't help me find a fix.


On Wed, Jun 30, 2010 at 8:40 PM, nano <nano3.14@gmail.com> wrote:
Ok, so i've written my Django app on computer A with the dev server,
and have pushed it to server B, running apache (implemented with
mod_wsgi). The server also has Django installed, but cannot find the
settings for some reason. what i've gathered is that because i've
never run the 'makeproject' command that the Django instance on the
server simply doesn't know the project exists. the project on the
server has a slightly different path than it did on the original
computer, however i have changed settings.py to reflect that.
Now, my assumption is that the fix will be to go into the django files
and edit whatever file notes what projects exist, however i dont even
know where to start looking. any help?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

You should look at this site:


I recommend it over any other django appengine ORM I've tried. I think it can help you with some of your issues. The blog and discussion group is very active and informative. 

On Wed, Jun 30, 2010 at 5:03 PM, Felippe Bueno <felippe.bueno@gmail.com> wrote:
You can... but there are some limitations.
For example, django's admin site, don't work using appengine
You need to use db.Model, 
You need to use google.appengine.ext.db.djangoforms   to validate forms...
And some more ....

Btw, I think its better we discuss this using private messages, or at app-engine-django group (http://groups.google.com/group/app-engine-django) :)

I mean, maybe we are bothering the members, talking more about appengine, than django.
 

On Wed, Jun 30, 2010 at 8:44 PM, Sector7B <joe.greenawalt@gmail.com> wrote:
interestingly though, i guess my problem is still that i'm not able to
do the django way of things, which I thought was idea behind doing it
like this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

On Jun 30, 7:30 pm, Sector7B <joe.greenaw...@gmail.com> wrote:
> i was just coming to write that, lol.  I opened up the code and read
> it!  What a novel approach.
>
> Thanks for pointer, i'm going to try again.
>
> On Jun 30, 7:17 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
>
>
>
> > BaseModel extends db.Model :)
>
> >http://stackoverflow.com/questions/1720157/diference-between-appengin...
>
> > On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > > Thank you for your reply.  I gave it a try, and it didn't seem to
> > > work.  The helper project (according to the introductory article) has
> > > me using their "BaseModel", which I think is supposed to revert me
> > > back to using Django code.  However there seems to be very little
> > > written beyond that article, although it is a good one.  I went back
> > > to the site, they have a google group specifically for this set up,
> > > I'm going to post over to that group now.  Thanks again.
>
> > > Joe
>
> > > On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> > > > I think (THINK) you problem is with the db.Model
>
> > > > Take a look athttp://
> > > code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> > > > <http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> > > .>You
> > > > will see that db.Model don't have the filter method, db.Query have it.
> > > > You need to do some think like:
> > > > a = XItUser.all()
> > > > a.filter('xit_nickname =', 'awesome')
>
> > > > I'm not sure if there is another way....
>
> > > > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com>
> > > wrote:
> > > > > Hi, I'm using django on google appengine using this:
> > > > >http://code.google.com/appengine/articles/appengine_helper_for_django.
> > > ..
>
> > > > > So I have my models, and I can load my pages and templates, and
> > > > > started to do some rudimentary object creates and gets inside the
> > > > > shell (python manage.py shell) and my views to get a feel for the
> > > > > API.  Immediately Im coming across errors, which seem weird since
> > > > > their so simple, and right out of the sample docs. (http://
> > > > > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > > > > I'm guessing i have setup or import problem?  Or I'm missing something
> > > > > major with the appengine way of things, but I am under the impression
> > > > > after the setup it should run the same.  Either way maybe someone can
> > > > > tell me better.
>
> > > > > Thanks,
> > > > > j
>
> > > > > >>> b = XItUser(xit_nickname="awesome")
> > > > > >>> b.save()
> > > > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > > > > >>> b
> > > > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > > > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
> > > > > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > > > > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Django users" group.
> > > > > 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<django-users%2Bunsubscribe@google groups.com>
> > > <django-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group.
> > > 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<django-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Should I start to use Mako from beginning?

Thanks for your helpful feedback, both Bill and Euan. You just make up
my mind. I'll start building my site with entire original django now.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Django on multiple servers? (Deployment Problem)

Ok, again. i feel like a question whore, but i think this should be the last thing. I fixed the database problem for the main app, but the admin site isnt working at all, im getting an internal server error (500) when i try to access it. halp?

On Wed, Jun 30, 2010 at 10:24 PM, Paul Gully <nano3.14@gmail.com> wrote:
Oh wow. ok, so i solved that problem (it was just the sys.path thing in the wsgi file. easy fix) ,but now django is unable to open the database files to render the URLs. im using SQLite, so again, i assume the problem is that this project isn't 'native' to the computer, however that doesn't help me find a fix.


On Wed, Jun 30, 2010 at 8:40 PM, nano <nano3.14@gmail.com> wrote:
Ok, so i've written my Django app on computer A with the dev server,
and have pushed it to server B, running apache (implemented with
mod_wsgi). The server also has Django installed, but cannot find the
settings for some reason. what i've gathered is that because i've
never run the 'makeproject' command that the Django instance on the
server simply doesn't know the project exists. the project on the
server has a slightly different path than it did on the original
computer, however i have changed settings.py to reflect that.
Now, my assumption is that the fix will be to go into the django files
and edit whatever file notes what projects exist, however i dont even
know where to start looking. any help?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Newby Question: template system doesn't render form html

When I put a form into my template it comes back blank. Does anyone
know why?


what is in my template

<form action="/in/" method="post">

<input type="text" name="username" id="Username" value="Username" /
>
<input type="text" name="password" id="Password" value="Password" /
>
<input type="submit" value="Vote" />
</form>

what I get in my browser

<Text Node: '<form action="/in/" metho'>


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Django on multiple servers? (Deployment Problem)

Oh wow. ok, so i solved that problem (it was just the sys.path thing in the wsgi file. easy fix) ,but now django is unable to open the database files to render the URLs. im using SQLite, so again, i assume the problem is that this project isn't 'native' to the computer, however that doesn't help me find a fix.

On Wed, Jun 30, 2010 at 8:40 PM, nano <nano3.14@gmail.com> wrote:
Ok, so i've written my Django app on computer A with the dev server,
and have pushed it to server B, running apache (implemented with
mod_wsgi). The server also has Django installed, but cannot find the
settings for some reason. what i've gathered is that because i've
never run the 'makeproject' command that the Django instance on the
server simply doesn't know the project exists. the project on the
server has a slightly different path than it did on the original
computer, however i have changed settings.py to reflect that.
Now, my assumption is that the fix will be to go into the django files
and edit whatever file notes what projects exist, however i dont even
know where to start looking. any help?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Django on multiple servers? (Deployment Problem)

Ok, so i've written my Django app on computer A with the dev server,
and have pushed it to server B, running apache (implemented with
mod_wsgi). The server also has Django installed, but cannot find the
settings for some reason. what i've gathered is that because i've
never run the 'makeproject' command that the Django instance on the
server simply doesn't know the project exists. the project on the
server has a slightly different path than it did on the original
computer, however i have changed settings.py to reflect that.
Now, my assumption is that the fix will be to go into the django files
and edit whatever file notes what projects exist, however i dont even
know where to start looking. any help?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

You can... but there are some limitations.
For example, django's admin site, don't work using appengine
You need to use db.Model, 
You need to use google.appengine.ext.db.djangoforms   to validate forms...
And some more ....

Btw, I think its better we discuss this using private messages, or at app-engine-django group (http://groups.google.com/group/app-engine-django) :)

I mean, maybe we are bothering the members, talking more about appengine, than django.
 

On Wed, Jun 30, 2010 at 8:44 PM, Sector7B <joe.greenawalt@gmail.com> wrote:
interestingly though, i guess my problem is still that i'm not able to
do the django way of things, which I thought was idea behind doing it
like this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

On Jun 30, 7:30 pm, Sector7B <joe.greenaw...@gmail.com> wrote:
> i was just coming to write that, lol.  I opened up the code and read
> it!  What a novel approach.
>
> Thanks for pointer, i'm going to try again.
>
> On Jun 30, 7:17 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
>
>
>
> > BaseModel extends db.Model :)
>
> >http://stackoverflow.com/questions/1720157/diference-between-appengin...
>
> > On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > > Thank you for your reply.  I gave it a try, and it didn't seem to
> > > work.  The helper project (according to the introductory article) has
> > > me using their "BaseModel", which I think is supposed to revert me
> > > back to using Django code.  However there seems to be very little
> > > written beyond that article, although it is a good one.  I went back
> > > to the site, they have a google group specifically for this set up,
> > > I'm going to post over to that group now.  Thanks again.
>
> > > Joe
>
> > > On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> > > > I think (THINK) you problem is with the db.Model
>
> > > > Take a look athttp://
> > > code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> > > > <http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> > > .>You
> > > > will see that db.Model don't have the filter method, db.Query have it.
> > > > You need to do some think like:
> > > > a = XItUser.all()
> > > > a.filter('xit_nickname =', 'awesome')
>
> > > > I'm not sure if there is another way....
>
> > > > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com>
> > > wrote:
> > > > > Hi, I'm using django on google appengine using this:
> > > > >http://code.google.com/appengine/articles/appengine_helper_for_django.
> > > ..
>
> > > > > So I have my models, and I can load my pages and templates, and
> > > > > started to do some rudimentary object creates and gets inside the
> > > > > shell (python manage.py shell) and my views to get a feel for the
> > > > > API.  Immediately Im coming across errors, which seem weird since
> > > > > their so simple, and right out of the sample docs. (http://
> > > > > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > > > > I'm guessing i have setup or import problem?  Or I'm missing something
> > > > > major with the appengine way of things, but I am under the impression
> > > > > after the setup it should run the same.  Either way maybe someone can
> > > > > tell me better.
>
> > > > > Thanks,
> > > > > j
>
> > > > > >>> b = XItUser(xit_nickname="awesome")
> > > > > >>> b.save()
> > > > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > > > > >>> b
> > > > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > > > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
> > > > > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > > > > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Django users" group.
> > > > > 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<django-users%2Bunsubscribe@google groups.com>
> > > <django-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group.
> > > 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<django-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

interestingly though, i guess my problem is still that i'm not able to
do the django way of things, which I thought was idea behind doing it
like this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

On Jun 30, 7:30 pm, Sector7B <joe.greenaw...@gmail.com> wrote:
> i was just coming to write that, lol.  I opened up the code and read
> it!  What a novel approach.
>
> Thanks for pointer, i'm going to try again.
>
> On Jun 30, 7:17 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
>
>
>
> > BaseModel extends db.Model :)
>
> >http://stackoverflow.com/questions/1720157/diference-between-appengin...
>
> > On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > > Thank you for your reply.  I gave it a try, and it didn't seem to
> > > work.  The helper project (according to the introductory article) has
> > > me using their "BaseModel", which I think is supposed to revert me
> > > back to using Django code.  However there seems to be very little
> > > written beyond that article, although it is a good one.  I went back
> > > to the site, they have a google group specifically for this set up,
> > > I'm going to post over to that group now.  Thanks again.
>
> > > Joe
>
> > > On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> > > > I think (THINK) you problem is with the db.Model
>
> > > > Take a look athttp://
> > > code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> > > > <http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> > > .>You
> > > > will see that db.Model don't have the filter method, db.Query have it.
> > > > You need to do some think like:
> > > > a = XItUser.all()
> > > > a.filter('xit_nickname =', 'awesome')
>
> > > > I'm not sure if there is another way....
>
> > > > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com>
> > > wrote:
> > > > > Hi, I'm using django on google appengine using this:
> > > > >http://code.google.com/appengine/articles/appengine_helper_for_django.
> > > ..
>
> > > > > So I have my models, and I can load my pages and templates, and
> > > > > started to do some rudimentary object creates and gets inside the
> > > > > shell (python manage.py shell) and my views to get a feel for the
> > > > > API.  Immediately Im coming across errors, which seem weird since
> > > > > their so simple, and right out of the sample docs. (http://
> > > > > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > > > > I'm guessing i have setup or import problem?  Or I'm missing something
> > > > > major with the appengine way of things, but I am under the impression
> > > > > after the setup it should run the same.  Either way maybe someone can
> > > > > tell me better.
>
> > > > > Thanks,
> > > > > j
>
> > > > > >>> b = XItUser(xit_nickname="awesome")
> > > > > >>> b.save()
> > > > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > > > > >>> b
> > > > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > > > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
> > > > > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > > > > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > > > > Traceback (most recent call last):
> > > > >  File "<console>", line 1, in <module>
> > > > >  File ".../models.py", line 37, in __getattr__
> > > > >    return getattr(self.owner, name)
> > > > > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Django users" group.
> > > > > 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<django-users%2Bunsubscribe@google groups.com>
> > > <django-users%2Bunsubscribe@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group.
> > > 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<django-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

i was just coming to write that, lol. I opened up the code and read
it! What a novel approach.

Thanks for pointer, i'm going to try again.

On Jun 30, 7:17 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> BaseModel extends db.Model :)
>
> http://stackoverflow.com/questions/1720157/diference-between-appengin...
>
>
>
> On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > Thank you for your reply.  I gave it a try, and it didn't seem to
> > work.  The helper project (according to the introductory article) has
> > me using their "BaseModel", which I think is supposed to revert me
> > back to using Django code.  However there seems to be very little
> > written beyond that article, although it is a good one.  I went back
> > to the site, they have a google group specifically for this set up,
> > I'm going to post over to that group now.  Thanks again.
>
> > Joe
>
> > On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> > > I think (THINK) you problem is with the db.Model
>
> > > Take a look athttp://
> > code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> > > <http://code.google.com/appengine/docs/python/datastore/queryclass.htm..
> > .>You
> > > will see that db.Model don't have the filter method, db.Query have it.
> > > You need to do some think like:
> > > a = XItUser.all()
> > > a.filter('xit_nickname =', 'awesome')
>
> > > I'm not sure if there is another way....
>
> > > On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com>
> > wrote:
> > > > Hi, I'm using django on google appengine using this:
> > > >http://code.google.com/appengine/articles/appengine_helper_for_django.
> > ..
>
> > > > So I have my models, and I can load my pages and templates, and
> > > > started to do some rudimentary object creates and gets inside the
> > > > shell (python manage.py shell) and my views to get a feel for the
> > > > API.  Immediately Im coming across errors, which seem weird since
> > > > their so simple, and right out of the sample docs. (http://
> > > > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > > > I'm guessing i have setup or import problem?  Or I'm missing something
> > > > major with the appengine way of things, but I am under the impression
> > > > after the setup it should run the same.  Either way maybe someone can
> > > > tell me better.
>
> > > > Thanks,
> > > > j
>
> > > > >>> b = XItUser(xit_nickname="awesome")
> > > > >>> b.save()
> > > > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > > > >>> b
> > > > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > > > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > > > Traceback (most recent call last):
> > > >  File "<console>", line 1, in <module>
> > > >  File ".../models.py", line 37, in __getattr__
> > > >    return getattr(self.owner, name)
> > > > AttributeError: type object 'XItUser' has no attribute 'filter'
> > > > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > > > Traceback (most recent call last):
> > > >  File "<console>", line 1, in <module>
> > > > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > > > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > > > Traceback (most recent call last):
> > > >  File "<console>", line 1, in <module>
> > > >  File ".../models.py", line 37, in __getattr__
> > > >    return getattr(self.owner, name)
> > > > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > 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<django-users%2Bunsubscribe@google groups.com>
> > <django-users%2Bunsubscribe@google groups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > 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<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

BaseModel extends db.Model :)



On Wed, Jun 30, 2010 at 8:09 PM, Sector7B <joe.greenawalt@gmail.com> wrote:
Thank you for your reply.  I gave it a try, and it didn't seem to
work.  The helper project (according to the introductory article) has
me using their "BaseModel", which I think is supposed to revert me
back to using Django code.  However there seems to be very little
written beyond that article, although it is a good one.  I went back
to the site, they have a google group specifically for this set up,
I'm going to post over to that group now.  Thanks again.

Joe

On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> I think (THINK) you problem is with the db.Model
>
> Take a look athttp://code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> <http://code.google.com/appengine/docs/python/datastore/queryclass.htm...>You
> will see that db.Model don't have the filter method, db.Query have it.
> You need to do some think like:
> a = XItUser.all()
> a.filter('xit_nickname =', 'awesome')
>
> I'm not sure if there is another way....
>
>
>
> On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > Hi, I'm using django on google appengine using this:
> >http://code.google.com/appengine/articles/appengine_helper_for_django...
>
> > So I have my models, and I can load my pages and templates, and
> > started to do some rudimentary object creates and gets inside the
> > shell (python manage.py shell) and my views to get a feel for the
> > API.  Immediately Im coming across errors, which seem weird since
> > their so simple, and right out of the sample docs. (http://
> > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > I'm guessing i have setup or import problem?  Or I'm missing something
> > major with the appengine way of things, but I am under the impression
> > after the setup it should run the same.  Either way maybe someone can
> > tell me better.
>
> > Thanks,
> > j
>
> > >>> b = XItUser(xit_nickname="awesome")
> > >>> b.save()
> > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > >>> b
> > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> >  File ".../models.py", line 37, in __getattr__
> >    return getattr(self.owner, name)
> > AttributeError: type object 'XItUser' has no attribute 'filter'
> > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> >  File ".../models.py", line 37, in __getattr__
> >    return getattr(self.owner, name)
> > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > 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<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

Thank you for your reply. I gave it a try, and it didn't seem to
work. The helper project (according to the introductory article) has
me using their "BaseModel", which I think is supposed to revert me
back to using Django code. However there seems to be very little
written beyond that article, although it is a good one. I went back
to the site, they have a google group specifically for this set up,
I'm going to post over to that group now. Thanks again.

Joe

On Jun 30, 3:12 pm, Felippe Bueno <felippe.bu...@gmail.com> wrote:
> I think (THINK) you problem is with the db.Model
>
> Take a look athttp://code.google.com/appengine/docs/python/datastore/queryclass.htm...
>
> <http://code.google.com/appengine/docs/python/datastore/queryclass.htm...>You
> will see that db.Model don't have the filter method, db.Query have it.
> You need to do some think like:
> a = XItUser.all()
> a.filter('xit_nickname =', 'awesome')
>
> I'm not sure if there is another way....
>
>
>
> On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenaw...@gmail.com> wrote:
> > Hi, I'm using django on google appengine using this:
> >http://code.google.com/appengine/articles/appengine_helper_for_django...
>
> > So I have my models, and I can load my pages and templates, and
> > started to do some rudimentary object creates and gets inside the
> > shell (python manage.py shell) and my views to get a feel for the
> > API.  Immediately Im coming across errors, which seem weird since
> > their so simple, and right out of the sample docs. (http://
> > docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
> > I'm guessing i have setup or import problem?  Or I'm missing something
> > major with the appengine way of things, but I am under the impression
> > after the setup it should run the same.  Either way maybe someone can
> > tell me better.
>
> > Thanks,
> > j
>
> > >>> b = XItUser(xit_nickname="awesome")
> > >>> b.save()
> > datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
> > >>> b
> > XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
> > >>> x = XItUser.objects.filter(xit_nickname="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> >  File ".../models.py", line 37, in __getattr__
> >    return getattr(self.owner, name)
> > AttributeError: type object 'XItUser' has no attribute 'filter'
> > >>> x = XItUser.objects.get(xit_nickname="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> > TypeError: get() takes exactly 2 non-keyword arguments (1 given)
> > >>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
> > Traceback (most recent call last):
> >  File "<console>", line 1, in <module>
> >  File ".../models.py", line 37, in __getattr__
> >    return getattr(self.owner, name)
> > AttributeError: type object 'XItUser' has no attribute 'filter'
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > 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<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Proper approach to updating model object with 100 attributes.

Thanks for everybody's comments.
I ended up using the setattr method and, since I always know the data I have is a subset of the data in the model, that works wonderfully.

--Ray


----- Original Message -----
From: "euan.goddard@googlemail.com" <euan.goddard@gmail.com>
To: "Django users" <django-users@googlegroups.com>
Sent: Wednesday, June 30, 2010 10:01:11 AM GMT -05:00 US/Canada Eastern
Subject: Re: Proper approach to updating model object with 100 attributes.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: DATABASE_ROUTERS in settings.py results in Internal Server Error

Hi,

If your project is named myproject and your app is named myapp where
the router is contained. Then you need to set it to the following and
you need to include the Classname as well. So if your AppRouter is
like this which is in the directory myproject.myapp:

AppRouter.py:
Class Router(object)
....

then your settings file should be as follows:

DATABASE_ROUTERS = ['myproject.myapp.AppRouter.Router']

Also it should display more than internal server error if you have
DEBUG set to True.

I hope this helps.

Cheers,
Nathan.

On Jun 30, 10:44 am, Michael <hexvec...@gmail.com> wrote:
> I tried to configure a database router according tohttp://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example.
>
> All my attempts lead to the Django project outputing "Internal Server
> Error" generic message with no further info.
>
> If my project is named 'myproject' and my app named 'myapp' how should
> I configure the DATABASE_ROUTERS setting?
>
> I have a AppRouter.py in the folder: myproject/AppRouter.py
> The absolute path to AppRouter.py is: /home/username/webapps/django/
> myproject/AppRouter.py
>
> My settings.py has the line:
> DATABASE_ROUTERS = ['myproject.AppRouter',]
>
> But it doesn't work. How do I configure a 'python path' is it absolute
> or relative?
>
> Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

does QuerySet delete delete the objects by their primary key?

Hi,

I did a query on an object using their "non" primary keys such that:

a = Topic.objects.filter(topic='Politics')
topic is not a primary key. suppose topicID is primary key.

When I run:

a.delete()

the SQL that is executed is:

DELETE FROM 'Topic' WHERE topicID in (1)

my problem is a little harder than that in the sense my table has
multiple keys so suppose its topicID and course is the primary key
together but since topicID is '1' for both the objects returned by the
filter it tries to be smart and randomly picks what it "thinks" is the
primary key and deletes based on that.

First off I hate the fact that Django doesn't support multiple primary
keys... Any suggestions to delete objects using their fields that are
passed in or do I have to override the delete function to be able to
do this?

Cheers,
Nathan.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: LAMPP + Django on Fedora 13 Linux

Thank you Matthias!

I agree. I will only stop LAMPP, because my php project needs to be
supported and is already configured for LAMPP.

Now I'm going to install apache and mysql from scratch.

Kostia

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: using django for google appengine, noob to both.

I think (THINK) you problem is with the db.Model


You will see that db.Model don't have the filter method, db.Query have it.
You need to do some think like:
a = XItUser.all()
a.filter('xit_nickname =', 'awesome')

I'm not sure if there is another way....



On Wed, Jun 30, 2010 at 4:04 PM, Sector7B <joe.greenawalt@gmail.com> wrote:
Hi, I'm using django on google appengine using this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

So I have my models, and I can load my pages and templates, and
started to do some rudimentary object creates and gets inside the
shell (python manage.py shell) and my views to get a feel for the
API.  Immediately Im coming across errors, which seem weird since
their so simple, and right out of the sample docs. (http://
docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
I'm guessing i have setup or import problem?  Or I'm missing something
major with the appengine way of things, but I am under the impression
after the setup it should run the same.  Either way maybe someone can
tell me better.

Thanks,
j



>>> b = XItUser(xit_nickname="awesome")
>>> b.save()
datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
>>> b
XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
>>> x = XItUser.objects.filter(xit_nickname="awesome")
Traceback (most recent call last):
 File "<console>", line 1, in <module>
 File ".../models.py", line 37, in __getattr__
   return getattr(self.owner, name)
AttributeError: type object 'XItUser' has no attribute 'filter'
>>> x = XItUser.objects.get(xit_nickname="awesome")
Traceback (most recent call last):
 File "<console>", line 1, in <module>
TypeError: get() takes exactly 2 non-keyword arguments (1 given)
>>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
Traceback (most recent call last):
 File "<console>", line 1, in <module>
 File ".../models.py", line 37, in __getattr__
   return getattr(self.owner, name)
AttributeError: type object 'XItUser' has no attribute 'filter'

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

using django for google appengine, noob to both.

Hi, I'm using django on google appengine using this:
http://code.google.com/appengine/articles/appengine_helper_for_django.html

So I have my models, and I can load my pages and templates, and
started to do some rudimentary object creates and gets inside the
shell (python manage.py shell) and my views to get a feel for the
API. Immediately Im coming across errors, which seem weird since
their so simple, and right out of the sample docs. (http://
docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries)
I'm guessing i have setup or import problem? Or I'm missing something
major with the appengine way of things, but I am under the impression
after the setup it should run the same. Either way maybe someone can
tell me better.

Thanks,
j

>>> b = XItUser(xit_nickname="awesome")
>>> b.save()
datastore_types.Key.from_path(u'XItUser', 2L, _app=u'xitforme')
>>> b
XItUser(**{x_user': None, 'xit_nickname': 'awesome'})
>>> x = XItUser.objects.filter(xit_nickname="awesome")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File ".../models.py", line 37, in __getattr__
return getattr(self.owner, name)
AttributeError: type object 'XItUser' has no attribute 'filter'
>>> x = XItUser.objects.get(xit_nickname="awesome")
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: get() takes exactly 2 non-keyword arguments (1 given)
>>> x = XItUser.objects.filter(xit_nickname__iexact="awesome")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File ".../models.py", line 37, in __getattr__
return getattr(self.owner, name)
AttributeError: type object 'XItUser' has no attribute 'filter'

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: LAMPP + Django on Fedora 13 Linux

On 30/06/10 17:48, jlighthouse wrote:
> Hi guys,
>
> I have been using Fedora 13 and LAMPP (appachefriends.org) to handle
> up my Joomla php development. I have Eclipse installed with PyDev
> module, django, python installed altogether on my Linux system. I
> would like to use phpmyadmin with Django, actually mysql with Django.
> Thus, considering that mysql is available within the LAMPP server, I
> would like to use it with Django.
>
> As I see, new Django project in Eclipse (database settings.py) does
> not allow to configure mysql of LAMPP with Django.
>
> Please, help me to set this up. Official Django documentation does not
> cover such a work.
>
> Kostia
>
Hey Kostia,

Fedora is a great idea, it brings everything you need to edit and serve
your django or joomla. (same applies to many other linux distributions)

If I were you, I would throw away your lampp-package for mainly three
reasons:
- its security is unmanaged, all packages installed via packaging system are
- since your lampp probably came as zip, tar. etc, its files are not in
your package database, so you have to know your files, filenames etc. to
remove it. You're mixing files from
- fedora contains all necessary packages:
yum install httpd mysql-server php Django MySQL-python

I assume, you did not install MySQL-python, so you can't connect from
python to mysql.

PhpMyAdmin is an application to manage your mysql database. It is
totally unconnected to your django applications.

Apache can easily be used to serve both, php and django.

Matthias

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

filter_horizontal not work

I am a new Django User.
I am doing an aplication web.
My problem is the next:
When I put (admin.py)
class FarmAdmin(admin.ModelAdmin):
filter_horizontal = ('server',)
===models.py====
class Farm(models.Model):
farm_id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=50)
server = models.ManyToManyField(Server)


It's work good, but if i save it, I have differents problems with DB
fields. However, if I put server = models.ManyToManyField(Server,
through="FarmServer")

It's dont work!! But I haven't problem. I cant see the widget. I only
see farm_id and name fields.

class FarmServer(models.Model):
farm = models.ForeignKey(Farm, primary_key=True)
server = models.ForeignKey(Server,primary_key=True)
class Meta:
db_table = u'farms_servers'

what can I do???
Thanks and sorry for my english.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: Load Different Views at same 'browser view'

Thanks for the answers.

However i can't see the way of doing what I want with the template
tags or pinax. I have read all the tags, and the pinax documentation
and i couldn't find anything.

On 30 jun, 05:25, Venkatraman S <venka...@gmail.com> wrote:
> On Wed, Jun 30, 2010 at 6:32 AM, Desproposito <javie...@gmail.com> wrote:
> > I've been thinking about how to do an application I have in mind, a
> > kind of social network, and it's obvious you have to load different
> > 'modules' like Friends, Messages, Posts, etc. The problem is that I
> > have no idea about how to do it with Django because I have not found
> > any function for it, it seems to me like I have to develop views with
> > all the information I need instead of saying, well, I need the 'friend
> > module' there on the right, the Messages one up there, etc..
>
> Try the Pinax project. (http://pinaxproject.com/). Probably you can learn
> more by customizing the project or going through the code.
>
> -Vhttp://twitter.com/venkasub

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Fields-granularity permission

Hi all,

I would like to obtain views (html) which are different according user
permissions. Fields are displayed or not according this permissions
both in edition mode and modification mode.

After a few days to think about how to implement this in django, I'm
still skeptical.

In django (even with django-authority), I don't find solutions to
define permissions on fields and adapt views according these
permissions.

Someone has already addressed the problem? Restricted/Custom/dynamic
forms? Restricted HttpResponse context? Custom templates?

Any ideas?

Thank's

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

DATABASE_ROUTERS in settings.py results in Internal Server Error

I tried to configure a database router according to
http://docs.djangoproject.com/en/dev/topics/db/multi-db/#an-example.

All my attempts lead to the Django project outputing "Internal Server
Error" generic message with no further info.

If my project is named 'myproject' and my app named 'myapp' how should
I configure the DATABASE_ROUTERS setting?

I have a AppRouter.py in the folder: myproject/AppRouter.py
The absolute path to AppRouter.py is: /home/username/webapps/django/
myproject/AppRouter.py

My settings.py has the line:
DATABASE_ROUTERS = ['myproject.AppRouter',]

But it doesn't work. How do I configure a 'python path' is it absolute
or relative?

Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: LAMPP + Django on Fedora 13 Linux

There are a little misunderstanding in your posts. You don't need apache at all for developing using django, even mysql is optional.
I'd suggest you to read the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial01/) and then come back to some of the questions you ask below.

Best regards.

On Wed, Jun 30, 2010 at 1:30 PM, jlighthouse <kostya.lighthouse@gmail.com> wrote:
That is true, phpmyadmin is not for Django. It is cool if I can find
the similar web interface for mysql database.

I do not use any php projects. I use only the python one empty
project, that just had been created in Eclipse.
It is essential  for me to connect Django to already installed LAMPP,
because than I do not need to install separate Appache server and
mysql database?
If I install a new Apache server, I will need to remove LAMPP or not?

Definitely, it is not a good idea to remove LAMPP. I will use it only
for development of my first python project.

If it is still posiible to use LAMPP, please say if you have such an
experience. It will help a lot.
If not, I would like to know when can I read how to install and
configure mysql and django with appache.

Thanks, Kostia.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.




--
Matías Iturburu
http://www.linkedin.com/in/miturburu

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

Re: cleaning html with bleach

On Jun 30, 12:00 am, Sam Lai <samuel....@gmail.com> wrote:
> Nice find - I did pretty much the same thing, but using lxml.Cleaner.
> This seems more configurable; I'm probably going to change mine over
> to this instead.

I needed to allow public rich text input on bucketlist.org so had to
sanitize input carefully, and used this approach:

http://birdhouse.org/blog/2010/05/12/secure-user-input-with-django/

(part of which involves tinymce, but the back-end portion is
agnostic).

./s

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.