Re: JQuery .load() works in production but fails in development

2011-06-30 Thread Joe Linoff
Hi Folks: I forgot to mention that FireBug tells me that development request has completed successfully (code 200) but there is no data which is what lead me to believe that it was a "same origin policy" problem possibly resulting from the use of the alternate port or from the fact that I just

Re: Implementing a User Search Feature

2011-06-30 Thread Doug Ballance
If you just want a simple user search (which seems to be what you are asking for), it really depends on your models - but a basic approach I usually use is to define a django form to use for the search, and instead of defining a save method, make a method that returns a queryset. As an off the top

Different urlpatterns for different subdomains

2011-06-30 Thread Vinicius Massuchetto
Is there any way of conditionally choosing an urlpatterns set in urls.py depending on the subdomain requested? I would like to configure different Django behaviors maintaining the same url structure according only to the subdomain. Please let me know if this is not a good approach to achieve

Re: can i control select column order in a queryset?

2011-06-30 Thread Joe Linoff
Hi Karen: Thank you for your response. The reason that I care about about column order is so that I can use the same template for different queries with arbitrary column orders using a single variable. I would like to be able to extract the field key name and use them directly in the column

Re: OperationalError: no connection to the server using Django and gunicorn

2011-06-30 Thread Андрей Махнач
Hi Adrian, Have you solved this weird issue? if yes, please tell me how. Best regards, Andrey Makhnach On May 27, 12:53 pm, Adrián Ribao wrote: > I'm doing it manually because I'm just testing: > > ./manage.py run_gunicorn -c gunicorn.conf.py > > where gunicorn.conf.py > > #

Re: Weird join conditions

2011-06-30 Thread Haroon
> Hmm, could you please provide an example? (-: Don't know whether it's > the late night combined with lack of caffeine or something else but I > can't figure out the difference at the mo> It seems you know pretty much > about Django ORM if you work on One example will be an outer join.

Re: Open source Django websites

2011-06-30 Thread Gerhard Hoogterp
On Monday 20 June 2011 13:42:52 benregn wrote: > Thank you very much. I was not aware of that site. > > On Jun 20, 12:48 pm, Kenneth Gonsalves wrote: > > On Mon, 2011-06-20 at 00:11 -0700, benregn wrote: > > > I was wondering if there are any complete websites using

Re: Weird join conditions

2011-06-30 Thread Michal Petrucha
On Thu, Jun 30, 2011 at 02:13:05PM -0700, peroksid wrote: > Thank you, Michal, > > Unfortunately, I need join condition, not a WHERE clause, which can be > easily extended with extra() method arguments. > It is not my bad mood, simply the same condition in WHERE and ON > produces different

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread sony
Thanks a lot...I understood...and its working provided me a complete different angle of looking at it :) On Jun 30, 2:17 pm, Daniel Roseman wrote: > Op donderdag 30 juni 2011 22:10:08 UTC+1 schreef sony het volgende: > > > > > Ok...this might work for the second option . >

Re: Implementing a User Search Feature

2011-06-30 Thread Stuart MacKay
bruno, The OP specifically asked about searching through a site. While there was not enough information in the question to determine the scope I think it was reasonable to conclude that since raj was unable to easily find the answer using google that he was probably not asking about

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread Daniel Roseman
Op donderdag 30 juni 2011 22:10:08 UTC+1 schreef sony het volgende: > > Ok...this might work for the second option . > How about getting a drop down box from a data base table column > For the third time: that is what automatically happens when you use a ForeignKey field in a form. No

Re: Weird join conditions

2011-06-30 Thread peroksid
Thank you, Michal, Unfortunately, I need join condition, not a WHERE clause, which can be easily extended with extra() method arguments. It is not my bad mood, simply the same condition in WHERE and ON produces different effect. I think rather about some method which gets together whole SQL

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread sony
Ok...this might work for the second option . How about getting a drop down box from a data base table column On Jun 30, 2:03 pm, Daniel Roseman wrote: > Op donderdag 30 juni 2011 21:42:57 UTC+1 schreef sony het volgende: > > > > > > > I am sorry I think I posted one line

Re: How to use the django-users mailing list properly and doing your homework..

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
@gamesbook / @Shawn Looks good! +1 on the proof reading, so many times I've been trigger happy on the send button, then found the fix 5 minutes later. On 30/06/2011 21:40, Shawn Milochik wrote: On 06/30/2011 04:33 PM, Cal Leeming [Simplicity Media Ltd]

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread Daniel Roseman
Op donderdag 30 juni 2011 21:42:57 UTC+1 schreef sony het volgende: > > I am sorry I think I posted one line wrong. > > class Report(models.Model): > reportType = models.ForeignKey(ReportCategory) > name = models.CharField(max_length=200) > description = models.CharField(max_length=300) > >

Re: Weird join conditions

2011-06-30 Thread Michal Petrucha
On Thu, Jun 30, 2011 at 08:19:36AM -0700, peroksid wrote: > Hi. > > Queryset attribute query has method join() which allows to explicitly > make JOINs. First argument passed to this method is a tuple of left > table, right table, left column and right column, and rest of > arguments define if we

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread sony
I am sorry I think I posted one line wrong. class Report(models.Model): reportType = models.ForeignKey(ReportCategory) name = models.CharField(max_length=200) description = models.CharField(max_length=300) def __unicode__(self): return self.name Now, inside the meta class I am trying to do

Re: How to use the django-users mailing list properly and doing your homework..

2011-06-30 Thread Shawn Milochik
On 06/30/2011 04:33 PM, Cal Leeming [Simplicity Media Ltd] wrote: Spawned a new thread for this, as the old one was getting rather off topic. KG had created a new wiki page to start putting some ideas into, of which people have been contributing to:

Re: Django AJAX polling: Best practice?

2011-06-30 Thread bruno desthuilliers
On Jun 30, 10:14 pm, Andreas Pfrengle wrote: > > - The other possibility would be a global dict (or instance of an own > class), let's call it GAMES_ACTIVE This will break as soon as you have more than one server process. -- You received this message because you are

How to use the django-users mailing list properly and doing your homework..

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
Spawned a new thread for this, as the old one was getting rather off topic. KG had created a new wiki page to start putting some ideas into, of which people have been contributing to: https://code.djangoproject.com/wiki/UsingTheMailingList One thing I added

Re: Django AJAX polling: Best practice?

2011-06-30 Thread Shawn Milochik
This isn't a job for AJAX -- it's a job for Comet, which is tailor-made for your exact needs. Check out Hookbox. Here's a tutorial which can definitely get you started. I was able to learn enough from it to get a small sample working.

Re: Implementing a User Search Feature

2011-06-30 Thread bruno desthuilliers
On Jun 30, 9:02 pm, Stuart MacKay wrote: > The canonical answer for search in django is probably > solr,http://lucene.apache.org/solr/This probably covers all your search needs. > > haystack,http://haystacksearch.org/should provide an easy to use API > Yes, I

Re: Deferred fields

2011-06-30 Thread Bill Freeman
Use a property in combination with an ordinary null=True field. Always access it (from python or template code) via the property. On Thu, Jun 30, 2011 at 4:13 PM, Ori wrote: > Hi, > > I'd like to defer calculating a value for a particular field until the > value is

Re: Implementing a User Search Feature

2011-06-30 Thread bruno desthuilliers
On Jun 30, 8:23 pm, raj wrote: > Tried googling but couldn't come up with much. > How do I implement a User Search feature? https://docs.djangoproject.com/en/1.3/ref/models/querysets/#filter Anything else ? -- You received this message because you are subscribed to the

Django AJAX polling: Best practice?

2011-06-30 Thread Andreas Pfrengle
Hello everyone, We have a game-application where several players should interact in realtime (i.e. change attributes of a "game"-object, which is a django model instance). To my knowledge, best / easiest method for this problem would be AJAX-polling several times per second, to check whether the

Deferred fields

2011-06-30 Thread Ori
Hi, I'd like to defer calculating a value for a particular field until the value is required. Suppose I have these models: class Fruit(models.Model): # various fields class FruitBasket(models.Model): fruit = models.ManyToManyField(Fruit) I'd like to add a "most_nutritious" field to

Re: forms and form processing

2011-06-30 Thread jay K.
Hello, thanks for the reply I dont have email settings in my settings.py file? is that straightforward, like an import statement or something more complex? I am using django version (1, 1, 1, 'final', 0) - that's what i got after typing import django django.VERSION on the python shell Jay k

Re: Implementing a User Search Feature

2011-06-30 Thread Stuart MacKay
The canonical answer for search in django is probably solr, http://lucene.apache.org/solr/ This probably covers all your search needs. haystack, http://haystacksearch.org/ should provide an easy to use API Stuart Mackay Lisbon, Portugal > Tried googling but couldn't come up with much. > How do

Re: Drop down box in django getting populated from a database table column

2011-06-30 Thread Daniel Roseman
On Thursday, 30 June 2011 18:51:54 UTC+1, sony wrote: > > I searched the same thing on net and got many answers but some how > dint get working with any of them. Table: 1. Report : > reportType(foreign key from ReportCategory), name, description 2. > Report Category: name,description forms.py

Re: Implementing a User Search Feature

2011-06-30 Thread Shawn Milochik
On 06/30/2011 02:23 PM, raj wrote: Tried googling but couldn't come up with much. How do I implement a User Search feature? Where an individual can type in the first and/or last name of user and come up with results? I saw some things about how to search through a site, but I think this is a

Implementing a User Search Feature

2011-06-30 Thread raj
Tried googling but couldn't come up with much. How do I implement a User Search feature? Where an individual can type in the first and/or last name of user and come up with results? I saw some things about how to search through a site, but I think this is a little different. Thank you. -- You

Drop down box in django getting populated from a database table column

2011-06-30 Thread sony
I searched the same thing on net and got many answers but some how dint get working with any of them. Table: 1. Report : reportType(foreign key from ReportCategory), name, description 2. Report Category: name,description forms.py class ReportForm_insert(forms.ModelForm): class Meta:

django.contrib.admin - custom css class in result_headers

2011-06-30 Thread Tomáš Ehrlich
Hi there, as I want to add custom css class to table header in admin, I was looking for template, which I should edit. I found that method result_headers in django/contrib/admin/ templatetags/admin_list.py sets whole 'class="xxx"' string. Why is there 'class=' thing ? It's quiet complicated to

Re: More than one project using the same database

2011-06-30 Thread Cal Leeming
OP: in a nutshell, unless you fully understand the risks, you should avoid doing this on a site which is in production. However, this would be a great opportunity to learn about this subject in a dev environment. After all, thats how i learnt (except i made the mistake of doing it in production

Re: giving download links

2011-06-30 Thread Jason
Actually, to serve the media you'll want to use any normal web server such as Apache or Lighttpd. In other words, Django has nothing to do with serving up those files. The Django application only provides a means for users to upload to the media folder. The media folder has to be configured

Weird join conditions

2011-06-30 Thread peroksid
Hi. Queryset attribute query has method join() which allows to explicitly make JOINs. First argument passed to this method is a tuple of left table, right table, left column and right column, and rest of arguments define if we have LEFT OUTER or INNER join. Arguments from the tuple are used to

Re: More than one project using the same database

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jun 30, 2011 at 4:36 PM, Tom Evans wrote: > On Thu, Jun 30, 2011 at 4:24 PM, Cal Leeming [Simplicity Media Ltd] > wrote: > > > > I agree the principle is *almost* the same, but the risks are higher, > > because OP said that

Re: More than one project using the same database

2011-06-30 Thread Tom Evans
On Thu, Jun 30, 2011 at 4:24 PM, Cal Leeming [Simplicity Media Ltd] wrote: > > I agree the principle is *almost* the same, but the risks are higher, > because OP said that the two applications are not the same, and that the > external app performs db writes,

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
Hi OP, Just as a side note, it's probably worth learning about how Python works before jumping straight into Django. (I'm assuming this based on __unicode__ did not have proper indentation). My apologies if I am wrong though! Cal On Thu, Jun 30, 2011 at 3:19 PM, Jarilyn Hernandez

Re: Installing requirements in a virtualenv works when installed manually, fails when installed automatically

2011-06-30 Thread Tom Evans
On Thu, Jun 30, 2011 at 3:59 PM, Benedict Verheyen wrote: > Hi, > > > i've encountered a strange problem. When I install packages on the server in > a virtualenv > with pip manually, my page loads correctly. > If I install the requirements via "pip install -r

Re: More than one project using the same database

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
On Thu, Jun 30, 2011 at 4:13 PM, Tom Evans wrote: > On Thu, Jun 30, 2011 at 4:03 PM, Cal Leeming [Simplicity Media Ltd] > wrote: > > The advice given to you by Andres is absolutely wrong. > > By doing this, you are opening yourself

Re: More than one project using the same database

2011-06-30 Thread Tom Evans
On Thu, Jun 30, 2011 at 4:03 PM, Cal Leeming [Simplicity Media Ltd] wrote: > The advice given to you by Andres is absolutely wrong. > By doing this, you are opening yourself up to all sorts of race conditions. > If you absolutely must allow this, you may want

Re: More than one project using the same database

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
The advice given to you by Andres is absolutely wrong. By doing this, you are opening yourself up to all sorts of race conditions. If you absolutely must allow this, you may want to consider implementing an object locking server (we have used memcache to do this before), but you'd need to handle

Installing requirements in a virtualenv works when installed manually, fails when installed automatically

2011-06-30 Thread Benedict Verheyen
Hi, i've encountered a strange problem. When I install packages on the server in a virtualenv with pip manually, my page loads correctly. If I install the requirements via "pip install -r requirements", then i get the following error in apache: Internal Server Error Apaches error.log: [Thu

Re: "attempt to write a readonly database" with write permissions in database file and folder

2011-06-30 Thread hectoraka
Hi > Seems selinux permissions are causing trouble. Try shutting it off and try > again. Thank you! After switching selinux to permissive mode I was able to access the admin pages. (Now I need to learn how to config selinux to let django do its thing without the need to disable selinux

Re: ImportError: No module named site

2011-06-30 Thread Andy Dustman
On Thu, Jun 30, 2011 at 4:54 AM, bruno desthuilliers wrote: > On Jun 29, 7:32 pm, Kyle Latham wrote: > (snip) >> I have no idea what is going wrong, but here is all my code thus far >> (I'm following the tutorial to create my own app that will

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Jarilyn Hernandez
Thanks for your responses. The problem was solved. Best Regards, Eiram On Thu, Jun 30, 2011 at 10:06 AM, Jirka Vejrazka wrote: > > class Poll(models.Model): > >question = models.CharField(max_length=200) > >pub_date = models.DateTimeField('date published') > >

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Jirka Vejrazka
> class Poll(models.Model): >    question = models.CharField(max_length=200) >    pub_date = models.DateTimeField('date published') > def __unicode__(self): >        return self.question > > class Choice(models.Model): >    poll = models.ForeignKey(Poll) >    choice =

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Daniel Roseman
Op donderdag 30 juni 2011 14:57:46 UTC+1 schreef Eiram het volgende: > > Greetings!! > > In the past few days I have been trying to learn about Django. I > started doing the Tutorial 1. During the tutorial I'm getting a > strange error. I was hoping if someone can help me to understand what >

Re: Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Kenneth Gonsalves
On Thu, 2011-06-30 at 06:57 -0700, Eiram wrote: > Poll(objetcs.all) Poll.objects.all() -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Problem with Tutorial 1 - Django Version = 1.3

2011-06-30 Thread Eiram
Greetings!! In the past few days I have been trying to learn about Django. I started doing the Tutorial 1. During the tutorial I'm getting a strange error. I was hoping if someone can help me to understand what I'm doing wrong and how can I fix it. This is the code I had: class

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-30 Thread Benedict Verheyen
> Hey all, > > Last call for registering your interest in this webcast (28 votes so far). > > If you haven't done so already, please visit the following URL: > > https://spreadsheets.google.com/spreadsheet/viewform?hl=en_GB=dENyOVFSSkhSYnhBLVZGTktiN1Z3Y2c6MQ#gid=0 >

Re: Global generic files? Best practice(s)?

2011-06-30 Thread Andre Terra
Hello again, Micky As far as the structure goes, I usually have my projects laid out like this, assuming a 'somedomain.com' parent folder that gets added to your PYTHONPATH env variable: . __init__.py app1/ app2/ appN/ __init__.py models.py views.py urls.py forms.py

Re: Activating HTML error emails while keeping logger defaults

2011-06-30 Thread Carsten Fuchs
Dear Russel, Am 14.04.2011 14:13, schrieb Russell Keith-Magee: Duplicate the default Django logging settings, and update them as required. The defaults are contained in django/conf/global_settings.py Unfortunately, there isn't an elegant way to "use the default but just modify this one bit".

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-30 Thread Cal Leeming [Simplicity Media Ltd]
Hey all, Last call for registering your interest in this webcast (28 votes so far). If you haven't done so already, please visit the following URL: https://spreadsheets.google.com/spreadsheet/viewform?hl=en_GB=dENyOVFSSkhSYnhBLVZGTktiN1Z3Y2c6MQ#gid=0 Poll ends tomorrow, at which point we will

Re: More than one project using the same database

2011-06-30 Thread ALJ
Hi Andres, that's what I was hoping was the case. I just wasn't sure. ALJ On Jun 30, 1:53 pm, andres.osin...@gmail.com wrote: > In theory, unless you've disabled transactions, the database should be able > to manage all contention issues. > Enviado desde mi BlackBerry de Movistar

Re: More than one project using the same database

2011-06-30 Thread andres . osinski
In theory, unless you've disabled transactions, the database should be able to manage all contention issues. Enviado desde mi BlackBerry de Movistar (http://www.movistar.com.ar) -Original Message- From: ALJ Sender: django-users@googlegroups.com Date: Thu, 30

More than one project using the same database

2011-06-30 Thread ALJ
I have an extranet type project that has been running for a year. It only has a maximum user base of about 50 people of which probably only a few are using it at any one time. The users can add, edit and delete items within the application However, we need to expose the data in that extranet

Re: ImportError: No module named site

2011-06-30 Thread bruno desthuilliers
On Jun 29, 7:32 pm, Kyle Latham wrote: (snip) > I have no idea what is going wrong, but here is all my code thus far > (I'm following the tutorial to create my own app that will display > various material measurements) > > --- >

Re: getting objects unique in several ways (annotate?)

2011-06-30 Thread bruno desthuilliers
On Jun 30, 1:31 am, elliot wrote: > Sorry about the vague title.  Its hard for me to summarize this in one > short sentence. > Lets say I have two models (using pseudo code): > > Book(model.Model): >   name = charfield() > > Transaction(model.Model): >   start_date =

db shardning

2011-06-30 Thread Mateusz Harasymczuk
Hi, I have recently came to the point when I need to use more then one DB in my usecase. I had to deal with storing and getting data from multiple DB, based on how old the data is. I have an archive database to store all logs and data from models to which access will be occasionally. My

Re: forms and form processing

2011-06-30 Thread urukay
Hi, have you got email settings set in your settings.py? What version of Django are you using? Radovan http://www.yau.sk On 29. Jún, 00:23 h., "jay K." wrote: > Hello, > > I need to add a form on my django website > > so far this is what i have: > > in my models.py:

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-30 Thread Wagner Vaz
Please, count me in. On Jun 22, 2011 10:15 AM, "Cal Leeming [Simplicity Media Ltd]" < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi all, > > Some of you may have noticed, in the last few months I've done quite a few > posts/snippets about handling large data sets in Django. At the end of this