Re: Query Set involving Model Method

2011-01-16 Thread Ian Clelland
On Sun, Jan 16, 2011 at 6:51 AM, Mikhail Korobov wrote: > It doesn't work that way. ORM translates you queries to SQL and the DB > is responsible for filtering. It is not possible to translate > arbitrary python function to SQL or pass it to DB engine. So you have > to

Re: max recursion depth exceeded

2011-01-16 Thread vamsy krishna
I was able to find two such recursive instances and things work fine after removing them :) On Jan 17, 10:12 am, vamsy krishna wrote: > Hi Justin, > > There are over 60 urls.py in my app and I'm running through each one > by one. Wish the stack trace had something from

Re: jquery problem

2011-01-16 Thread Tony Lambropoulos
Prashanth, This has to do with django because they work outside of django. On Mon, Jan 17, 2011 at 6:12 AM, Prashanth wrote: > Hi Tony, > > On Mon, Jan 17, 2011 at 8:57 AM, Tony wrote: > >> Unfortunately, I can't get any other plugins to work that I

Re: jQuery UI Stylesheet

2011-01-16 Thread Gath
Fletcher, Hope you have copied all the files that JQueryUI requires, when am using JQueryUI, this how my directory structure looks like, -MyProject - media - css - images - js - themes ( specific to JQueryUI ) - ui ( specific to JQueryUI ) - template

Re: max recursion depth exceeded

2011-01-16 Thread vamsy krishna
Hi Justin, There are over 60 urls.py in my app and I'm running through each one by one. Wish the stack trace had something from within the app. Thanks for the help anyway. Will let you know if I manage to find the bad file. Regards, Vamsy On Jan 13, 5:07 pm, Justin Murphy

Re: Localisation

2011-01-16 Thread Lachlan Musicman
On Sun, Jan 16, 2011 at 04:23, David Walker wrote: > Despite reading round and round in circles in the documentation, I am > completely baffled about localisation and how it works.  I am not > trying to do any translation yet, but want to code money and date > formats right so

Re: jquery problem

2011-01-16 Thread Prashanth
Hi Tony, On Mon, Jan 17, 2011 at 8:57 AM, Tony wrote: > Unfortunately, I can't get any other plugins to work that I download. No > other jquery > plugins seem to work and Im pretty sure I have the directory paths > right and everything. Very lame, How would someone

jquery problem

2011-01-16 Thread Tony
I am using a jquery project for forms that someone else created to give myself a jump start on what Im trying to do. Unfortunately, I can't get any other plugins to work that I download. No other jquery plugins seem to work and Im pretty sure I have the directory paths right and everything. I

jQuery UI Stylesheet

2011-01-16 Thread Fletcher Haynes
Hello, I'm having some trouble getting jQuery UI to work. It doesn't seem to be finding the CSS static file...here is my base.html and the page that inherits from it. It does find my style.css file fine, which is my non-jQuery stylesheet. http://dpaste.com/324572/ I'd appreciate any help. --

Re: Template behaving oddly...

2011-01-16 Thread Fletcher Haynes
Ah, got it. Thanks so much! 2011/1/14 Rubén Dugo Martín > You get the template but you don't render it. > > 2011/1/14 Fletcher Haynes > >> Hi everyone, >> >> I'm trying to work on a project in Django, but I'm encountering some odd >> behavior. I

Re: Help Cure Boredom!

2011-01-16 Thread Russell Keith-Magee
On Mon, Jan 17, 2011 at 8:46 AM, Russell Keith-Magee wrote: > On Mon, Jan 17, 2011 at 8:08 AM, Jon Blackwell > wrote: >> This isn’t a black hole for resumes; if you are located in the Bay >> Area we guarantee a real human response within 48

Re: Help Cure Boredom!

2011-01-16 Thread Russell Keith-Magee
On Mon, Jan 17, 2011 at 8:08 AM, Jon Blackwell wrote: > This isn’t a black hole for resumes; if you are located in the Bay > Area we guarantee a real human response within 48 hours….promise! Since we're getting into disclaimers and disclosure - django-developers

Help Cure Boredom!

2011-01-16 Thread Jon Blackwell
We’re looking for an engineer to join our tech team (5 developers plus designer) and help turn our alpha into an awesome beta. Compensation will include a meaningful equity stake with salary to follow. About us: Located in San Francisco, Let’s Do This is an app that’s like a real time meetup.com

Re: Thinking to change my db schema

2011-01-16 Thread Konrad Delong
> -I didn't know about the PickleField. I'm now reading about it, maybe > I could use it to store all the transaction's datetime objects. I'm using PickleField for precomputing some values, that I'd like to keep normalized as well. Found no problems with this approach so far. You can implement

Re: django-admin.py startproject not working

2011-01-16 Thread f.romain
You guys are the best!! Thanks On Dec 12 2010, 10:28 pm, Brad Reardon wrote: > Another tip is to add *.py to the PATHEXT variable or the like. That will > allow the script to be found on the path. I'm not sure if that's the right > variable name, but check it out. > > On

Thinking to change my db schema

2011-01-16 Thread mf
I'm building a web app with django. It uses postgresql. The app code is getting really messy and I'd like to improve it(my begginer skills being a big factor too). This is an excerpt of my models.py file: REPEATS_CHOICES = ( (NEVER, 'Never'), (DAILY, 'Daily'), (WEEKLY, 'Weekly'),

Re: post messages to facebook wall

2011-01-16 Thread Ryan Nowakowski
Truong, Have you downloaded the facebook SDK[1] yet? - Ryan 1. https://github.com/facebook/python-sdk/ On Mon, Jan 10, 2011 at 09:10:14AM -0800, trương thế linh wrote: > Hi every body, > I'm a newbie to django. > please suggest me an app to intergrate with django to do allow me to > post

Re: Query Set involving Model Method

2011-01-16 Thread Matteius
try: gs=DinnerHost.objects.all().filter(complete()=True objects by default doesn't select anything, so either use objects.get(pk=var_pk) or the a-typical case all(). -Matteius On Jan 16, 7:04 am, rmschne wrote: > Following is an extract of a Model I'm using.  I'd like to be

Execute code after the model with m2m is completely saved

2011-01-16 Thread Martin Tiršel
Hello, I am using (only) django admin to insert data and have: class ImageSize(models.Model): ... class Image(models.Model): size = models.ManyToManyField(ImageSize) ... I need to save original image that have been uploaded (this is ok) and then make resized copies depending on

Re: Django/Comet?

2011-01-16 Thread Ethan Jucovy
Thanks Shawn, this is very helpful. It's good to hear Orbited is being actively developed again. I'm not already using RabbitMQ for anything, so I'm going to take the opposite approach: start out doing some test projects with Hookbox, and then try porting them to Orbited. I'm completely new to

Re: django session InvalidOperation

2011-01-16 Thread kinder
Unfortunately, no, I could not find a fix for it. I still suspect some kind of version conflict in the MySQL drivers, but it's strange, because I even tried creating a new test app, and django created the database and all the tables just fine. It's only the admin login that seems to break it.

Re: to iterate over two lists simultaneously in *.html

2011-01-16 Thread Torsten Bronger
Hallöchen! Masklinn writes: > On 2011-01-16, at 14:42 , Torsten Bronger wrote: > >> [...] >> >> On the other hand, as somebody having zip() in a dozen of >> render_to_response calls, I can say that >> >> {% for smth1, smth2 in list1, list2 %} >> >> would be a nice thing to have. ;-) > > Why

Re: to iterate over two lists simultaneously in *.html

2011-01-16 Thread Masklinn
On 2011-01-16, at 14:42 , Torsten Bronger wrote: > Hallöchen! > > David Walker writes: > >> [...] >> >> and the the {% for %} becomes: >> {% for smth1, smth2 in zipped %} > > On the other hand, as somebody having zip() in a dozen of > render_to_response calls, I can say that > > {% for smth1,

Re: Need help with Django tutorial

2011-01-16 Thread Joel Goldstick
On Sun, Jan 16, 2011 at 10:00 AM, nai wrote: > I posted my question in Stackoverflow because its easier to see the > code blocks. > > Basically, I am having problems trying to get my polls template from > the Django tutorial working properly. > > Please have a look.

Re: Query Set involving Model Method

2011-01-16 Thread rmschne
Mikhail, Thanks. I like that idea. Simple and understandable for those who follow me. On Jan 16, 2:51 pm, Mikhail Korobov wrote: > It doesn't work that way. ORM translates you queries to SQL and the DB > is responsible for filtering. It is not possible to translate >

Need help with Django tutorial

2011-01-16 Thread nai
I posted my question in Stackoverflow because its easier to see the code blocks. Basically, I am having problems trying to get my polls template from the Django tutorial working properly. Please have a look. Thanks. The link is here:

Re: Query Set involving Model Method

2011-01-16 Thread Mikhail Korobov
It doesn't work that way. ORM translates you queries to SQL and the DB is responsible for filtering. It is not possible to translate arbitrary python function to SQL or pass it to DB engine. So you have to formulate you query using .filter syntax or raw SQL. Another possibility is to denormalize

Django forms

2011-01-16 Thread Benchouia Ahmed Abdelhakim
Hello there, I am new to django developement model. If someone know 1- how to access to the ModelForm fields instance in the view? 2- I am trying to developpe a website that contains many forms, is there a way to make the same template (new and update) for a given model.Models class thanks,

Re: Query Set involving Model Method

2011-01-16 Thread rmschne
Thanks. I'm still messing with this; but don't think it quite what I'm looking for. I want/need the Model Definition function complete() for use at the record level. I did this as a function since the rules are not based simply on the value of the fields. Ideally, I'd like to have the class

Re: GROUP BY fields appearance, bug or feature?

2011-01-16 Thread Jari Pennanen
Here is my problem as using powerful raw, User.objects.raw('SELECT usr.*, em.added as latest_email_added, em.success as latest_email_success, em.subject as latest_email_subject FROM auth_user AS usr LEFT JOIN dmusic_useremail as em ON em.user_id = usr.id GROUP BY usr.id HAVING Max(em.added)')

Re: Signals and foreign key

2011-01-16 Thread mrmclovin
Solved. Look at http://stackoverflow.com/questions/4704924/django-signal-callback-function-missing-foreign-on-model -- 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

Re: to iterate over two lists simultaneously in *.html

2011-01-16 Thread Torsten Bronger
Hallöchen! David Walker writes: > [...] > > and the the {% for %} becomes: > {% for smth1, smth2 in zipped %} On the other hand, as somebody having zip() in a dozen of render_to_response calls, I can say that {% for smth1, smth2 in list1, list2 %} would be a nice thing to have. ;-) Tschö,

Re: Setup issue

2011-01-16 Thread Phil
Thanks for reply Mike and TheRedRabbit, unfortunately I have never got to try your suggestions. Before your response came in I tried upgrading Lucid Lynx to Maverick Meerkat and lets just say it didn't go well for me, I no longer have Linux installed on my laptop so am back in Windows :( to be

Re: Query Set involving Model Method

2011-01-16 Thread aid
Hi, On Jan 16, 1:04 pm, rmschne wrote: > qs=DinnerHost.objects.filter(complete=True) > and tried > gs=DinnerHost.objects.filter(complete()=True Try something along the lines of, class DinnerHostManager(models.Manager): def complete(self): return self.filter(

Query Set involving Model Method

2011-01-16 Thread rmschne
Following is an extract of a Model I'm using. I'd like to be able to query it to get a query set return that uses one of the Model Definitions, e.g. get all the Hosts where "complete=True" where 'complete' is a model definition. I know the nomenclature to use when exclude/include on a field in

Re: redirects and ipv6

2011-01-16 Thread Michael P. Soulier
On 13/12/10 Michael P. Soulier said: > Hi, > > We're enabling ipv6 on a server and finding that redirects in django are > broken. The host portion is being truncated. > > Is this a known problem? So I found the issue. Apache is passing a bad value for the X_HTTP_FORWARDED_HOST variable. I've

Re: to iterate over two lists simultaneously in *.html

2011-01-16 Thread David Walker
As masklinn says, zip: http://docs.python.org/library/functions.html#zip Combine the two lists in python into one list of pairs (tuples). change the render_to_response line to: render_to_response(filter_obj.html', {'zipped': zip(obj1, obj2), 'q':query}) zip discards any elements that are left

Re: GROUP BY fields appearance, bug or feature?

2011-01-16 Thread Jari Pennanen
User != UserEmail User does not have subject, thus it will raise AttributeError: 'User' object has no attribute 'subject' Secondly, I do not want to create 1+N queries (where N is number of users), with creating a query per user this would be simple but very inefficient. On Jan 16, 12:16 pm,

Re: GROUP BY fields appearance, bug or feature?

2011-01-16 Thread Praveen Krishna R
*First of all did you try accessing the email subject with a dotted notation?* try u = User.objects.all() and u[0].subject On Sun, Jan 16, 2011 at 12:53 PM, Jari Pennanen wrote: > Hi! > > Suppose following model: > > class UserEmail(models.Model): >"""User email"""

Re: compiled methods

2011-01-16 Thread Santiago Caracol
Thank you very much! The term "memoize" was exactly what I was looking for. Santiago -- 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

GROUP BY fields appearance, bug or feature?

2011-01-16 Thread Jari Pennanen
Hi! Suppose following model: class UserEmail(models.Model): """User email""" user = models.ForeignKey(User, db_index=True, null=True, blank=True, editable=False) """User recieving the email""" added = models.DateTimeField(_("added"),

Re: compiled methods

2011-01-16 Thread Daniel Roseman
On Sunday, January 16, 2011 9:24:49 AM UTC, Santiago Caracol wrote: > > Hello, > > is there such a thing as "compiled methods" in Django i.e. methods > whose return value is calculated only once and then stored? Or is > there a canonical Djangoish way to implement this? > > An example: > >

compiled methods

2011-01-16 Thread Santiago Caracol
Hello, is there such a thing as "compiled methods" in Django i.e. methods whose return value is calculated only once and then stored? Or is there a canonical Djangoish way to implement this? An example: Suppose we have phone objects that have a canonical form, such as "alcatel a-341 i" and a

Re: to iterate over two lists simultaneously in *.html

2011-01-16 Thread Masklinn
On 2011-01-16, at 09:25 , gintare wrote: > Hello, > > I am sorry for asking a simple question. > (I read other answer bout iteration in several items in this user > group - they are too complicated for me. I have no time to study > Django deeper. ) > I want to iterate over two lists

Re: list of lists in template

2011-01-16 Thread gintare
Thanks On Jan 7, 9:27 am, Chris Matthews wrote: > {%  for Ltarp in  smth.3 %} > SHOULD BE > {%  for Ltarp in  smth.2 %} > 'cos Lans only has 3 elements and Ltarp is Lans[2]. > > Chris > > -Original Message- > From: django-users@googlegroups.com

to iterate over two lists simultaneously in *.html

2011-01-16 Thread gintare
Hello, I am sorry for asking a simple question. (I read other answer bout iteration in several items in this user group - they are too complicated for me. I have no time to study Django deeper. ) I want to iterate over two lists simultaneously in form which is simple (.html), do not described in