Re: my frist django project Error

2011-07-10 Thread Gour-Gadadhara Dasa
On Sun, 10 Jul 2011 19:42:17 +0100 Malcolm Box wrote: > Cal, > > You are contributing a lot to the django users group, but this > response isnt in the best spirit of the group. > > Yes, the op could work out from the traceback what the error was, but > we were all

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-10 Thread Roberto De Ioris
> >> > > I assume _start / _end / _size are references to the address space (within > the binary) where these embedded binaries (in symbol form) are kept?? yes, exactly > > Is there any sort of restrictions on maximum allowed symbol size? (looked > on > Google, but couldn't find anything)

Re: need help with calling following complex query

2011-07-10 Thread Venkatraman S
On Mon, Jul 11, 2011 at 10:02 AM, sanket wrote: > I think I would go ahead with executing the raw SQL in this case. > The solution by @Venatraman looks interesting too. I would give it a > try. > Raw-sql and the snippet provided by me would end up generating the same

Re: need help with calling following complex query

2011-07-10 Thread sanket
Thanks all for the help, I really appreciate it. I think I would go ahead with executing the raw SQL in this case. The solution by @Venatraman looks interesting too. I would give it a try. I might write a stored procedure if I start getting performance issues if data starts growing. Thanks

Re: my frist django project Error

2011-07-10 Thread Kenneth Gonsalves
On Sun, 2011-07-10 at 20:13 +0100, Cal Leeming [Simplicity Media Ltd] wrote: > > Telling someone they need to learn more python isn't helpful - tell > them > > that theres a setting missing and how the traceback makes that > clear. > > > > That's a fair point tbh. > > I'll make sure to use a

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Kenneth Gonsalves
On Sun, 2011-07-10 at 14:39 +0100, Cal Leeming [Simplicity Media Ltd] wrote: > We don't seem to have a policy of dealing with mailing list posts in > which > the user clearly has no Python experience. > > Therefore, I'd like to hear some thoughts on making an amendment to >

Re: ANN: django-iadmin

2011-07-10 Thread David Graves
Björn, I'm working on a project very similar to this one (but have a long way to go to reach it's maturity), but I do have a working feature that I believe matches what you're looking for. The project is at https://bitbucket.org/graveyboat/gravey and the feature is called RestrictedModel. It

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Andre Terra
Now that sounds much better! Cheers, André On Sun, Jul 10, 2011 at 12:44 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > How about this.. > > --- > Asking question about Python related subjects is fine as long as; > > * You follow the same guidelines as

Re: Emailing submitted forms

2011-07-10 Thread Michael Ludvig
On 11/07/11 14:18, Venkatraman S wrote: On Mon, Jul 11, 2011 at 7:07 AM, Michael Ludvig > wrote: Now I need to not only save the entered values to the db (that works well) but I also need to send a copy of the submitted form to an

Re: need help with calling following complex query

2011-07-10 Thread Venkatraman S
On Mon, Jul 11, 2011 at 7:10 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > +1 on raw SQL in this instance. Not exactly, using ORM is pretty easy too. You would do something like this: results.extra(select={ 'distance':

Re: Scaling to 30k requests (malcolm box blog)

2011-07-10 Thread Venkatraman S
Thanks for sharing; in my app(which is no way to be compared with any BIG site) i was trying to do some optimizations to make it 'fast' - just to learn more. I used google page-load , YSlow, and DDT to cleanup most of the expensive sql queries and other things related to HTML. I am not using any

Re: CSRF problem with /i18n/setlang/

2011-07-10 Thread Venkatraman S
Have you set the LANGUAGES in settings.py? Something like ... ugettext = lambda s: s LANGUAGES = ( ('de', ugettext('German')), ('fr', ugettext('French')), ('en', ugettext('English')), ) And in urls.py: (r'^i18n/', include('django.conf.urls.i18n')), -V -- You received this message

Re: Emailing submitted forms

2011-07-10 Thread Venkatraman S
On Mon, Jul 11, 2011 at 7:07 AM, Michael Ludvig wrote: > ** > Now I need to not only save the entered values to the db (that works well) > but I also need to send a copy of the submitted form to an email address. > > I wonder if there is an easy way for rendering the form

Re: need help with calling following complex query

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
+1 on raw SQL in this instance. On Mon, Jul 11, 2011 at 2:36 AM, Jian Chang wrote: > Using raw sql is a better idea > > > 2011/7/11 Jonas Geiregat > >> >> >> In order to find the places in near by area I want to make following >> mysql query. but I am

Emailing submitted forms

2011-07-10 Thread Michael Ludvig
Hi, I've got a pretty lengthy form in Django 1.2.5 - it renders well with {{ form.as_p }}. Now I need to not only save the entered values to the db (that works well) but I also need to send a copy of the submitted form to an email address. I wonder if there is an easy way for rendering

Re: need help with calling following complex query

2011-07-10 Thread Jian Chang
Using raw sql is a better idea 2011/7/11 Jonas Geiregat > > > In order to find the places in near by area I want to make following > mysql query. but I am not sure how should I translate it using django > models and managers. > > > You could execute the raw sql query string,

Re: ANN: django-iadmin

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Damn, I guess it had unexpected side effects. Sorry I couldn't help get you up and running :/ Cal On Mon, Jul 11, 2011 at 2:08 AM, leo wrote: > hi,guy, > your code works but not very well. i got this error: > > >- Please enable javascript. > > > and the layout of

CSRF problem with /i18n/setlang/

2011-07-10 Thread cjwalter
Hi all I continue getting CSRF token missing or incorrect. when trying to call /i18n/setlang/ Here the pertinent snippets from settings.py: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',

Re: ANN: django-iadmin

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
I've submitted an issue to the maintainer: https://github.com/saxix/django-iadmin/issues/4 On Mon, Jul 11, 2011 at 1:37 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Oh and, the fix I pasted here is *somewhat* hacky, and is really just meant > to get

Re: ANN: django-iadmin

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Oh and, the fix I pasted here is *somewhat* hacky, and is really just meant to get you off the ground. The maintainer will need to patch this at a later date though. Cal On Mon, Jul 11, 2011 at 1:36 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hmm, grp

Re: ANN: django-iadmin

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Hmm, grp is only valid on unix platforms according to here: http://docs.python.org/library/grp.html https://github.com/saxix/django-iadmin/blob/master/iadmin/plugins/fm/fs.py *line 4-6:* from grp import getgrgid from pwd import getpwuid *Replace with this:* * * import os if not os.name ==

Re: ANN: django-iadmin

2011-07-10 Thread leo
hi, sax After downloading the newest code and i try to implement the iadmin the setup works well this time but when I try to access the localhost/admin got the follow error , My platform Win2008R2, python 2.6.6 I checked the code found something, I write my code in Win, and in Win python can

Re: need help with calling following complex query

2011-07-10 Thread Jonas Geiregat
> > > In order to find the places in near by area I want to make following > mysql query. but I am not sure how should I translate it using django > models and managers. You could execute the raw sql query string, see: https://docs.djangoproject.com/en/dev/topics/db/sql/ for more information

need help with calling following complex query

2011-07-10 Thread sanket
Hey All, I am quite new to Django and recently started using django for developing a location based service. In order to find the places in near by area I want to make following mysql query. but I am not sure how should I translate it using django models and managers. orig.lat = x orig.lon = y

Need help intercepting SQL

2011-07-10 Thread Eric B
Our web site uses Django 1.2. We're adding a layer to our MySQL database called dbShards for fragmentation (sharding). I need to prepend instructive SQL comments (/* ... */) to UPDATE statements in certain situations. What's the best way to intercept the raw SQL sent to the database? I've come

Re: ANN: django-iadmin

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Jul 10, 2011 at 5:30 AM, leo wrote: > hi, sax > I downloaded the package and want to install is using normal way > then I got error like this: > > D:\saxix-django-iadmin-ec7ad2a>setup.py install > Traceback (most recent call last): > File

Re: merge images into a webpage

2011-07-10 Thread het.oosten
> > Just so happens I'm learning Dutch at the moment, and was able to read a lot > of the code ;p I guess that was my luck :-) -- 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.

Re: merge images into a webpage

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Jul 10, 2011 at 8:58 PM, het.oosten wrote: > Ye, I think this was the only option i didnt try :-) > > Thanks Cal and Shawn! > > In a previous i translated the Dutch into English, and mixed things > up, making everything more confusing. > Just so happens I'm

Scaling to 30k requests (malcolm box blog)

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Came across the following blog entries today, for those interested in this sort of thing: http://attentionshard.wordpress.com/2011/04/26/scaling-django-to-3-requests-per-second/ http://attentionshard.wordpress.com/2011/04/03/scaling-to-30k-two-level-caches/ Interesting approach. Although

Re: merge images into a webpage

2011-07-10 Thread het.oosten
Ye, I think this was the only option i didnt try :-) Thanks Cal and Shawn! In a previous i translated the Dutch into English, and mixed things up, making everything more confusing. Rob On Jul 10, 9:40 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: >

Re: merge images into a webpage

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Nice, not often I come across code written in nederlands ;p Is this what you are looking for by any chance?? {{plaatje.1.plaatjes_lijst}} On Sun, Jul 10, 2011 at 8:33 PM, het.oosten wrote: > One addition to the above, when i do: >def __unicode__(self): >

Toggle boolean fields from a Queryset using F objects

2011-07-10 Thread vascop
I've tried these queries with these results: queryset.update(done=not F('boolean')) {'time': '0.001', 'sql': u'UPDATE "todo_item" SET "done" = True'} queryset.update(done=(F('boolean')==False)) {'time': '0.001', 'sql': u'UPDATE "todo_item" SET "done" = False'} What I would like is something

Re: merge images into a webpage

2011-07-10 Thread het.oosten
One addition to the above, when i do: def __unicode__(self): return '' % (self.plaatje, self.alt) I can call the single images in the template with {{plaatje.1}} etc I found out in this thread that it is not a good idea to "abuse" unicode for this On Jul 10, 9:28 pm,

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
*Roberto: *my responses below! *Everyone else: *Roberto has very kindly done some modifications to uwsgi to get things moving. See below comments for more info :) On Sun, Jul 10, 2011 at 6:57 PM, Roberto De Ioris wrote: > > >> > > > > I'll pull the most recent code tomorrow,

Re: merge images into a webpage

2011-07-10 Thread het.oosten
> have the variable image_list in your context which is a list, you can do > this: > > {{ image_list.0 }} and {{ image_list.1 }} This is what i tried, but the only way to show the images is(plaatjes_lijst=image_list): {% for x in plaatje %} {{x.plaatjes_lijst|safe}} {% endfor %} -- You received

Re: merge images into a webpage

2011-07-10 Thread Shawn Milochik
You can easily do this in your template with an index. Assuming you'll have the variable image_list in your context which is a list, you can do this: {{ image_list.0 }} and {{ image_list.1 }} -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: my frist django project Error

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Jul 10, 2011 at 7:42 PM, Malcolm Box wrote: > Cal, > > You are contributing a lot to the django users group, but this response > isnt in the best spirit of the group. > > Yes, the op could work out from the traceback what the error was, but we > were all beginners

Re: my frist django project Error

2011-07-10 Thread Malcolm Box
Cal, You are contributing a lot to the django users group, but this response isnt in the best spirit of the group. Yes, the op could work out from the traceback what the error was, but we were all beginners once. If you compare this post to the how to post FAQ its not too bad - at least

Re: merge images into a webpage

2011-07-10 Thread het.oosten
Here is the link to pastebin: http://pastebin.com/1FuVH7Hu It is all about getting specific content for a season a user chooses (it is a site for a campground) If you need more info, i will be happy to provide. -- You received this message because you are subscribed to the Google Groups

Re: merge images into a webpage

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Jul 10, 2011 at 6:26 PM, het.oosten wrote: > Ok perhaps a basic question. I wrote a custom method for my model: >def image_list(self): >return '' % > (self.image, self.alt) > You should never really put HTML inside a method unless you

Re: merge images into a webpage

2011-07-10 Thread het.oosten
Ok perhaps a basic question. I wrote a custom method for my model: def image_list(self): return '' % (self.image, self.alt) And i indeed get a nice list of image in the template. I want however control where the single images show up. With something like {{image. 1}} other

Re: merge images into a webpage

2011-07-10 Thread Shawn Milochik
On 07/10/2011 12:28 PM, het.oosten wrote: Adding a method/property to my model is a thing i haven't considered. You have a good point there. I will do some more reading to find a solution in this direction. Thanks! Rob It's easy to forget that Django is just Python. You're the programmer, so

Re: merge images into a webpage

2011-07-10 Thread het.oosten
Adding a method/property to my model is a thing i haven't considered. You have a good point there. I will do some more reading to find a solution in this direction. Thanks! Rob On Jul 10, 5:54 pm, Shawn Milochik wrote: > I'd rather see the contents of your __unicode__

Re: 'WSGIRequest' object has no attribute 'update'

2011-07-10 Thread Shawn Milochik
May we see the rest of your view? If not, you'll have to figure it out by examining exactly what your 'request' variable contains. The error is clearly from calling update() on it, and it not being allowed. -- You received this message because you are subscribed to the Google Groups "Django

Re: merge images into a webpage

2011-07-10 Thread Shawn Milochik
I'd rather see the contents of your __unicode__ function as a get_absolute_url function, with the __unicode__ maybe returning just the filename or the parent object's title and the filename. I strongly dislike the embedding of template code in a text field of your model, because it makes

Re: Manytoone Form

2011-07-10 Thread Shawn Milochik
I don't know what your models and form look like so I can't say exactly. However, you probably need to just modify one of your clean functions so it retains multiple values, and update your save function to do the right thing when it gets more than one. -- You received this message because

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
How about this.. --- Asking question about Python related subjects is fine as long as; * You follow the same guidelines as the rest of this document * The question itself is somehow vaguely related to your Django project * You understand that learning Django will involve learning Python as well.

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Jul 10, 2011 at 3:01 PM, Brian Bouterse wrote: > +1 for this write up. > > Not that your write up suggests this, but I am cautious to turn folks away > from django-users because they ask a python only question. From a venn > diagram perspective the django community

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Venkatraman S
Actually, i thought about this a little more...as Brian has suggested, we shouldnt shun away 'prospective' pythonistas. Probably, we can keep the tone a little friendly... -- Do you have *any* experience at all using Python, or understand the basic concepts of how Python work? If

Re: Django Knowledge Strorehouse

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
Nice, are you thinking of using something like Sphinx SE for the search engine?? Sadly, with all the extra projects I'm working on atm, it would just sit in my todo list for at least 3-6 months :( Cal On Sun, Jul 10, 2011 at 3:59 PM, Jacob Kaplan-Moss wrote: > On Sat, Jul

Re: Django Knowledge Strorehouse

2011-07-10 Thread Jacob Kaplan-Moss
On Sat, Jul 9, 2011 at 8:01 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Hmm, some concerns: Luckily, it's open source: https://github.com/django/djangoproject.com -- patches welcome! [If you want to add search to the community aggregator that'd make me

Form wizard get_template_names()

2011-07-10 Thread Dario Vergara
Hi, I am using the development version of FormWizard. The documentation says that you can change the default template name by overriding get_template_names(). My implementation seems to always return the same template: class MyWizard(SessionWizardView): def done(self, form_list, **kwargs):

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Brian Bouterse
+1 for this write up. Not that your write up suggests this, but I am cautious to turn folks away from django-users because they ask a python only question. From a venn diagram perspective the django community is a subset of the python community. Using Django to teach folks more about Python is

Re: http auth using django auth_user table

2011-07-10 Thread Ali Rıza KELEŞ
2011/7/10 Cal Leeming [Simplicity Media Ltd] : > The only connection this question has with Django, is the encryption method > that Django uses, and therefore is inappropriate for this forum. Yes, right. It had seemed me connected. Sorry for wasting your

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Venkatraman S
+1 from me. (but i see some in IRC who do not know python but start learning it along with Django - so probably we need not be too strict about this clause?) -V -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

(UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
We don't seem to have a policy of dealing with mailing list posts in which the user clearly has no Python experience. Therefore, I'd like to hear some thoughts on making an amendment to UsingTheMailingList, which states: """ Do you have

Re: http auth using django auth_user table

2011-07-10 Thread Cal Leeming [Simplicity Media Ltd]
The only connection this question has with Django, is the encryption method that Django uses, and therefore is inappropriate for this forum. Please refer to http://code.djangoproject.com/wiki/UsingTheMailingList On a site note, it took me less than 10 seconds on Google (with a very simple search

Re: Manytoone Form

2011-07-10 Thread Magrelo
Thanks Shawn, I've done this, the only problem now is if I select only one field the override save method works fine, but if I select more than one, the field comes empty on the save method. Any tips? Thanks again! Thiago On Jul 8, 12:12 pm, Shawn Milochik wrote: > Add the

http auth using django auth_user table

2011-07-10 Thread Ali Rıza KELEŞ
Hi, I want to use django auth_user table for authentication of another application which uses "apache basic auth" with module auth_mysql. The code below runs well with MD5 passwords without salt. But django works sha1 and with salt. What should I do? Thanks.. AuthName "Hi.. Please login"

'WSGIRequest' object has no attribute 'update'

2011-07-10 Thread Phang Mulianto
Hi all..i am learning django no, using django 1.3 + python 2.7 . i came from php world... i am using a book , and follow the code in there, but got error and cannot find whats the cause. here are the errors. anyone can give some clue? Thanks AttributeError at /cart/ 'WSGIRequest' object has no

Re: Extending User model with Inheritance - Attribute Error

2011-07-10 Thread Jonas Geiregat
Op 10-jul-2011, om 12:37 heeft Venkatraman S het volgende geschreven: > > This is not good design. If you want to store some extra fields for a User - > i would define just another model called ProfileDetails, FK it to User and > use it as such. That's also how I would do it, some example

Re: merge images into a webpage

2011-07-10 Thread het.oosten
Oops i posted too fastis there a better way to accomplish the above? On Jul 10, 12:41 pm, "het.oosten" wrote: > I got is working like this: > > In my model: >         titel = models.CharField(max_length=200) >         alt = models.CharField(max_length=200) >        

Re: merge images into a webpage

2011-07-10 Thread het.oosten
I got is working like this: In my model: titel = models.CharField(max_length=200) alt = models.CharField(max_length=200) plaatje = models.ImageField(upload_to='plaatjes/') menu = models.ForeignKey(Menu) seizoenen = models.ManyToManyField(Seizoenen)

Re: Extending User model with Inheritance - Attribute Error

2011-07-10 Thread Venkatraman S
On Sun, Jul 10, 2011 at 1:05 PM, Brent wrote: > Hi all, > > I am attempting to follow this tutorial: > > http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/ > > But I am receiving this error: > AttributeError at /login/ > 'NoneType'

Extending User model with Inheritance - Attribute Error

2011-07-10 Thread Brent
Hi all, I am attempting to follow this tutorial: http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/ But I am receiving this error: AttributeError at /login/ 'NoneType' object has no attribute 'DoesNotExist' Here is my stack trace: http://dpaste.com/565795/