Re: Settings.py variables in CSS file

2007-08-15 Thread James Bennett
On 8/15/07, Andy <[EMAIL PROTECTED]> wrote: > It works, except it seems horribly inefficient. The problem is *each > time* a page is requested, it would have to do a remote URL Request, > write the new css file, etc. Has anyone been confronted with this > problem. Is there an easier solution?

Re: Changing database structue

2007-08-16 Thread James Bennett
On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Oh. That's a real ouch. I really hoped I can avoid that. Well, consider this: Anything which *isn't* SQL and which is used to do this job must -- in order to cover all the necessary use cases -- be as complex as SQL, or evolve to the poi

Re: 'dict' object has no attribute 'rindex'

2007-08-16 Thread James Bennett
On 8/16/07, Ryan K <[EMAIL PROTECTED]> wrote: > I am using Django 0.96 and I am getting this error. Any ideas as to > why? No, because we're not mind-readers ;) In order to help you track down an error, we need to know: 1. What you were trying to do. 2. How you were trying to do it (e.g., paste

Re: updating models

2007-08-16 Thread James Bennett
On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So how do I do it? http://www.google.com/search?hl=en&q=sql+alter+table&btnG=Google+Search -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You recei

Re: (1040, 'Too many connections')

2007-08-16 Thread James Bennett
On 8/16/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Don't understand what 0.96pre means since not a regular Django user, > but there was a whole issue with MySQL database issues with Subversion > copy of Django back in June. Between releases, django.VERSION increments and adds the "-pre" su

Re: syncdb error

2007-08-18 Thread James Bennett
On 8/18/07, Pawel Pilitowski <[EMAIL PROTECTED]> wrote: > I just updated to the latest django version (5925) and ran syncdb and > get the following error. > > Any suggestions? If you're tracking SVN, it's an *extremely* good idea to also watch the development timeline[1] and read the django-devel

Re: How to install django on Apache/Linux

2007-08-18 Thread James Bennett
On 8/19/07, shabda <[EMAIL PROTECTED]> wrote: > I am *very* confused here, I have only installed mod_python, and > nothing specific to django. SO how would the line > PythonHandler django.core.handlers.modpython work? If you have Django installed on the server and on the Python path, it will wor

Re: Float Field not displaying the two zeros at the end of a price

2007-08-19 Thread James Bennett
On 8/19/07, Greg <[EMAIL PROTECTED]> wrote: > I have a FloatField called price that stores the price of different > elements. When the price is 19.99, 19.79, 19.01 etc... everything is > displayed correctly. However, when I have a price of 19.00. The > price when viewed in a browser is just 19.

Re: using django components outside of django

2007-08-21 Thread James Bennett
On 8/21/07, Lee Connell <[EMAIL PROTECTED]> wrote: > I was wondering if it was easy and if there are examples of using > django's ORM and even the authentication system in contrib outside of > django, say in a twisted network application? http://groups.google.com/group/django-users/search?group=d

Re: using django components outside of django

2007-08-22 Thread James Bennett
On 8/22/07, Lee Connell <[EMAIL PROTECTED]> wrote: > Thanks for response, how do i setup a "minimal" django app? just > create a settings file that describes the model and then import django > and apply those settings? http://www.djangoproject.com/documentation/settings/#using-settings-without-s

Re: Django 0.96 and newforms

2007-08-23 Thread James Bennett
On 8/23/07, DrMarco <[EMAIL PROTECTED]> wrote: > after searching in this group and on google, I am a bit lost about the > exact state of the newforms library in the 0.96 release. Is it usable > or is a merely a preview that I should not use for production ? In > particular can it do filefield and

Re: non-event driven method called?

2007-08-23 Thread James Bennett
On 8/23/07, John Menerick <[EMAIL PROTECTED]> wrote: > Yeah, I was thinking of running a script in daemon mode, but I would prefer > to keep the code inside the django instance to keep everything simpler. > simpler as in the same settings for deployment, less hassle deploying on > machines, etc...

Re: Singleton + Django problem

2007-08-24 Thread James Bennett
On 8/24/07, Rodrigue <[EMAIL PROTECTED]> wrote: > This works fine when I unittest it. But then, I create an instances of > SomeClass in Django and...it does not work...and in the strangest way: > the rest of the initialisation code is executed more than once, but > not everytime. When running und

Re: Any way to re-synch database when I change models.py without deleting the DB?

2007-08-24 Thread James Bennett
On 8/24/07, Stodge <[EMAIL PROTECTED]> wrote: > Is there an easy way to re-synch the database without wiping it so it > can somehow apply the SQL changes automatically? Yes, it's called "ALTER TABLE". No, there's nothing contradictory in providing an ORM without providing automated schema migrat

Re: about DJANGO_SETTINGS_MODULE

2007-08-26 Thread James Bennett
On 8/26/07, z_axis <[EMAIL PROTECTED]> wrote: > File "d:\app\python\Lib\site-packages\django\db\__init__.py", line 7, in > le> > if not settings.DATABASE_ENGINE: The lines above tell you what the problem is: Django stores data in a database, but you have not filled in the settings which t

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread James Bennett
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > Ah, one more thing-- try commenting out the signalling. There's a > known performance issue there. Even without it, the ORM will be slower, and should be expected to be slower -- doing a straight select doesn't involve much overhead because it

Re: dynamic links

2007-08-27 Thread James Bennett
On 8/27/07, Rufman <[EMAIL PROTECTED]> wrote: > Does anyone have an idea how i can get the day_id and rubric_id in a > link, if they are not attributes of the model that is being displayed? > (if i were hard coding with PHP i would just make them get or post > parameters) http://www.djangoproject

Re: Anonymous Users

2007-08-27 Thread James Bennett
On 8/27/07, Darrin Thompson <[EMAIL PROTECTED]> wrote: > I'm building a real estate search. I have existing and future > competition. It's to my advantage to track a few preferences and > favorites for anonymous users before they register. http://www.djangoproject.com/documentation/sessions/ --

Re: QuerySet & memory

2007-08-27 Thread James Bennett
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > QuerySet.iterator does what you want. I was going to follow up with a documentation link, but it appears we lost the documentation for QuerySet.iterator at some point. Opened a ticket In any case, Jeremy's right: the "iterator" method returns

Re: Django Development Position

2007-08-29 Thread James Bennett
On 8/29/07, Matt Davies <[EMAIL PROTECTED]> wrote: > you shouldn't limit your chances so much > > "must be US citizens with no criminal history" Somewhat OT, but for some companies this is a legal requirement. Citizenship for certain firms who do government work, no criminal record is common in i

Re: django.core.management.dump_data gone into management.commands - but how to address it?

2007-08-29 Thread James Bennett
On 8/29/07, Ulf Kronman <[EMAIL PROTECTED]> wrote: > Is there any documentation on this change around yet? As always, backwards-incompatible changes appear here: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Changestomanagement.pycommands -- "Bureaucrat Conrad, you are techni

Re: is possible to only select the specified fields?

2007-08-29 Thread James Bennett
On 8/29/07, Diego pylorca <[EMAIL PROTECTED]> wrote: > Somethimes I must show only field1 and field2. > > is some way to only select the field1 and field2? http://www.djangoproject.com/documentation/db-api/#values-fields -- "Bureaucrat Conrad, you are technically correct -- the best kind of co

Re: is possible to only select the specified fields?

2007-08-30 Thread James Bennett
On 8/29/07, Diego pylorca <[EMAIL PROTECTED]> wrote: > ok, but this not return a querySet, return a dictionary :S Read the documentation more carefully. Specifically: > Returns a ValuesQuerySet -- a QuerySet that evaluates to a list > of dictionaries instead of model-instance objects. And: >

Re: Internet Explorer, sessions, django on 64-bit machine

2007-08-30 Thread James Bennett
On 8/30/07, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > The session cookies for 64-bit machine based app have > additionally all this __utma .. __utmz items, not found in cookies for > 32-bit machine. > > Anybody experienced similar weirdness? The "utma", "utmz", etc. cookies are not set by Django.

Re: django.core.management changes

2007-08-30 Thread James Bennett
On 8/30/07, akonsu <[EMAIL PROTECTED]> wrote: > my script creates a fixture file at FIXTURE_PATH, and then runs the > reset command on my application. the relevant code is listed below. > now that i synced to the latest trunk, this code no longer runs > because the management module has no procedu

Re: Preferred way to expand User Model?

2007-08-31 Thread James Bennett
On 8/31/07, Rotlaus <[EMAIL PROTECTED]> wrote: > what is the preferred way to expand the user model? I would use a > model with a OneToOne Field, but documentation says i should not. What > should i do instead? A foreign key with unique=True, as covered in the Django book. -- "Bureaucrat Conra

Re: Releated data from models

2007-08-31 Thread James Bennett
On 8/31/07, sect2k <[EMAIL PROTECTED]> wrote: > One way of doing it would be to use template tags, but that would amount to > redundant SQL queries for each story. I guess another way of doing it would > be to write custom SQL using JOIN. > > What I would like to know is what is the django way of

Re: Preferred way to expand User Model?

2007-08-31 Thread James Bennett
On 8/31/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > There's also a blog entry about this: > > http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model Which reminds me I need to add a link from that entry to the relevant bit in the book. -- "Bureaucrat Conrad, you are tech

Re: problem with importing "Template" module

2007-08-31 Thread James Bennett
On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can anyone help me? any idea? Read the Django tutorial, which will explain how to create a Django settings file and specify it for use when importing/using parts of Django. -- "Bureaucrat Conrad, you are technically correct -- the best

Re: ObjectPaginator Performance in Busy Sites

2007-08-31 Thread James Bennett
On Aug 31, 9:11 pm, Sebastian Macias <[EMAIL PROTECTED]> wrote: > What I'm concerned about is that Article.objects.all() will return a > query_set with all of the records. If I have millions of records it > means the returned query_set will be huge and I'm affraid performance > will be poor in and

Re: auth.view.login acting very weird

2007-08-31 Thread James Bennett
On 8/31/07, jfagnani <[EMAIL PROTECTED]> wrote: > I can't figure out what's going on, the form obviously works in some > circumstances, and the log-in data is also correct. You're running into the issue in ticket #3393[1]. I keep meaning to put together a better patch, but other things keep comin

Re: DRY violation: site name in project files

2007-08-31 Thread James Bennett
On 8/31/07, Davidov <[EMAIL PROTECTED]> wrote: > This means that project should have some knowledge about parent site. > This makes it difficult to move projects from site to site. Also this > violates DRY (you have to write site name again). For sake of convenience, the tutorial walks you throug

Re: 500 error email to admins - user information is missing...

2007-09-01 Thread James Bennett
On 8/31/07, Udi <[EMAIL PROTECTED]> wrote: > I see the request object has > 'REMOTE_USER': self._req.user, > in meta, but I'm getting None there despite the fact that only > authenticated users are using my site. Am I looking in the wrong > place? Is there any way to get this info into the

Re: how to use get_profile?i have a question,thx!

2007-09-01 Thread James Bennett
On 9/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > then changed to : {{ post.author.get_profile().image }}, still got a > error as following: You **never** use parentheses in a template. The template language is not Python, and does not use the same syntax as Python. {{ post.author.get_pr

Re: Another UnicodeError: django-registration or send_mail

2007-09-02 Thread James Bennett
On 9/2/07, patrickk <[EMAIL PROTECTED]> wrote: > I´m using django-registration and changed line 80 of models.py from > subject = "Account activation for %s" % current_domain > to > subject = "Account-Aktivierung für %s" % current_domain Try subject = u"Account-Aktivierung für %s" % current_domai

Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-02 Thread James Bennett
On 9/2/07, Brandon Taylor <[EMAIL PROTECTED]> wrote: > I have Python 2.5.1 and Django installed and running on OS X 10.4.10, > but can't seem to get either the Psycopg2 or MySQL-python bindings > installed so I can actually use a database with Django. For Mac, this is the easiest way to get the n

Re: truncating posts with markdown

2007-09-02 Thread James Bennett
On 9/3/07, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Markdown wraps all text in tag so truncate_html doesn't work ? I'm using Markdown and I've *never* seen it do that... -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~--

Re: django checkout doesn't work..

2007-09-03 Thread James Bennett
On 9/3/07, Devi <[EMAIL PROTECTED]> wrote: > I was trying to get the developement version of django and that > doesn't work by this.. > svn co http://code.djangoproject.com/svn/django/trunk/ > > I'm able to see the files in the browser. Any ideas of what can be > done? Without knowing what sort

Re: Django & postgresql schemata

2007-09-03 Thread James Bennett
On 9/3/07, Giuseppe Ciotta <[EMAIL PROTECTED]> wrote: > Does Django support postgresql schema different from the default (public)? No. Patches would be welcome. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~--

Re: .latest() view not showing latest entry

2007-09-03 Thread James Bennett
On 9/3/07, synthrabbit <[EMAIL PROTECTED]> wrote: > latest_info_dict = { > 'queryset': Page.objects.all(), > 'slug': Page.objects.latest().slug, > } The bit which calls latest() here is evaluated exactly once: when your URLs module is first loaded into memory. Hence, whichever object is t

Re: Django on Nokia 770?

2007-09-05 Thread James Bennett
On 9/5/07, Steve Bergman <[EMAIL PROTECTED]> wrote: > Does anyone have comments about the possibility of running a django > server on the Nokia 770? Is it possible? I have a simple app that I > want to demo on it with both the django server and the browser running > on the same device. Some qui

Re: hai am new one to django

2007-09-05 Thread James Bennett
On 9/5/07, Brett Parker <[EMAIL PROTECTED]> wrote: > If those of us in Europe believed everything we read in the papers we'd > get the impression that the American way was to start war with anyone > that wasn't American and had oil... (of course, we don't all believe > that, but lets just change f

Re: Getting 2 apps to show on a homepage

2007-09-05 Thread James Bennett
On 9/5/07, Atendo <[EMAIL PROTECTED]> wrote: > urlpatterns = patterns('', > (r'^$', 'myproj.app1.views.index'), > (r'^$', 'myproj.app2.views.index'), This won't work because you only get one view function per URL; the same URL can't simultaneously route to multiple different views. Generally the

Re: How run a python script as standalone? (aka: Why django need the DJANGO_SETTINGS_MODULE anyway???)

2007-09-06 Thread James Bennett
On 9/6/07, mamcxyz <[EMAIL PROTECTED]> wrote: > Yeah, and maybe in mod_python I see the purpose... however why not > doing that to a single import anyway? And for fastcgi and the dev web > server that could by that simply... not? "A single import" from where, exactly? Either you set DJANGO_SETTIN

Re: Databases, one or many

2007-09-06 Thread James Bennett
On 9/6/07, Adam Jenkins <[EMAIL PROTECTED]> wrote: > This actually brings up an issue. I've heard that many Django developers > don't > use projects at all, that they just use apps. Is this correct? Should I > default to one > project and break it up into smaller ones if the need arises? First of

Re: Django Book

2007-09-07 Thread James Bennett
On 9/7/07, Griffin Caprio <[EMAIL PROTECTED]> wrote: > This may have been answered already, but I couldn't find it. Which is strange, because this thread comes up if you go to the Google Groups page and search for "djangobook status": http://groups.google.com/group/django-users/browse_frm/thread

Re: alter FreeComment date/time?

2007-09-07 Thread James Bennett
On 9/7/07, Drasty <[EMAIL PROTECTED]> wrote: > Unless there's some way to override this without actually tweaking the > source code? http://www.djangoproject.com/documentation/db-api/#raw-saves -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--

Re: Multi-table lookup ... ?

2007-09-08 Thread James Bennett
On 9/8/07, dbee <[EMAIL PROTECTED]> wrote: > If I have a campaign object that has 3 groups in it. And I want to > find all the reminder objects that are in those groups ... unless of > course it's a campaign with no groups in it - in which case I'd like > all the reminders associated with that cam

Re: Capisdjango

2007-09-08 Thread James Bennett
On 9/8/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Why hasn't anyone thought of something like capistrano for django. (Yeah > I know it can work, but there're a few features for RoR'ers). Lots of people have thought of it. What they haven't done is written it. Want to be the first? ;) -- "B

Re: php fsockopen equivalent in Django

2007-09-09 Thread James Bennett
On 9/9/07, Arnold Chen <[EMAIL PROTECTED]> wrote: > I am writing an application that require "silent" post of data to a > specific URL. I know that is a function fsockopen in PHP which can > achieve this, and i am looking for function in Django like that. http://docs.python.org/lib/module-socket.

Re: php fsockopen equivalent in Django

2007-09-10 Thread James Bennett
On 9/10/07, Brett Parker <[EMAIL PROTECTED]> wrote: > As it looked like he wanted to talk HTTP, maybe it'd be better to point > to: > http://docs.python.org/lib/module-urllib.html > http://docs.python.org/lib/module-urllib2.html > > Which let you do GET and POST really quite nicely

Re: Time Zone Errors

2007-09-10 Thread James Bennett
On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > the problem that occured while putting the same code on the server is > a Time Zone Error. No, it is not. Read the error message carefully: PostgreSQL is not saying the SET TIME ZONE was problematic, it is saying "an error occurred in one

Re: When 1.0 ?

2007-09-10 Thread James Bennett
On 9/10/07, est <[EMAIL PROTECTED]> wrote: > Hi I am a new web developer in django. Could anyone tell me when will > django go to 1.0? Search the archives of this mailing list for your answer. > Will django support py3k? Considering that Python 3.0 isn't due to be released until late next year,

Re: How to refer to a class defined later in the file

2008-01-07 Thread James Bennett
On Jan 7, 2008 7:59 AM, shabda <[EMAIL PROTECTED]> wrote: > This line gives me an error, > revision_for = models.ForeignKey(Page, related_name = 'revision_for') > as NameError: name 'Page' is not defined, obviously because page is > defined later in the file. I can not put PageRevision later as Pa

Re: Context processor a bit too helpful

2008-01-08 Thread James Bennett
On Jan 8, 2008 12:47 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: > How do I say "no thanks" to this helpfulness so my html can to thru? By reading the Django template documentation, which covers this in some detail. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct

Re: Adding a request.user to a ModelForm instance

2008-01-08 Thread James Bennett
On Jan 7, 2008 8:03 PM, Car <[EMAIL PROTECTED]> wrote: > Is it possible to add field formerly excluded in ModelForm in view > like in this example below: Yes, but you're not "adding a field". You're simply getting back a model object and then you're 100% done with the ModelForm. What you do with

Re: read only in Admin interface

2008-01-08 Thread James Bennett
On Jan 8, 2008 10:17 AM, Nader <[EMAIL PROTECTED]> wrote: > I have looked while for a answer to my problem but unfortunately I > haven't found a one, maybe I had to spend more time. However I have a > project with some applications. By using of Admin we can Create, Read, > Update and Delete (CRUD

Re: Adding a request.user to a ModelForm instance

2008-01-08 Thread James Bennett
On Jan 8, 2008 11:16 AM, l5x <[EMAIL PROTECTED]> wrote: > This should help you: > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser No. That's a nasty, ugly, horrible hack that's about fifty times more complicated than what's actually needed to do this. He got it right the first tim

Re: read only in Admin interface

2008-01-08 Thread James Bennett
On Jan 8, 2008 12:14 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Another dirty solution would be to simply create a user account, and > give it permissions to only view things. I haven't played with > permissions at all, but I imagine it would be possible. > The correct way is still to write yo

Re: anyone have luck with http://code.google.com/p/django-pyodbc/

2008-01-08 Thread James Bennett
Python module names cannot include hyphens, so 'django-pyodbc.db.mssql' is not a valid Python module name regardless of whether you have the code on your system. Try renaming the module to not include a hyphen. Also, make sure you're using a recent SVN checkout of Django; the ability to use exter

Re: Print view

2008-01-08 Thread James Bennett
On Jan 8, 2008 6:27 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > The only way I know to accomplish this is to modify the admin template, > and display a link based on the name of the model, as determined by the > template logic. > Is this the best way to do this? or is there a cleaner way? Thin

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 2:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > File "/home/grmadmin/webapps/django/classic/registration/views.py", > line 35, in activate >account.backend = 'django.contrib.auth.backends.ModelBackend' There is not and never has been any such line of code in django-re

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 9:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Unless I've gone utterly mad, it IS django-registration. I remember > installing django-registration, and most all of the code looks just > like django-registration, albeit an older version. Not that any of > that explains the

Re: How are the ids for Django models calculated?

2008-01-11 Thread James Bennett
On Jan 11, 2008 11:02 AM, shabda <[EMAIL PROTECTED]> wrote: > How are the values calculated. If Django asks the DB to provide it > those values, can we be sure, for all supported backends, that > 1. The ids are auto incrementing, (and not just unique). > 2. They start from zero. > 3. The differen

Re: #! ??

2008-01-11 Thread James Bennett
On Jan 11, 2008 9:03 PM, kbochert <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] public_html]# ./tmp3 > -bash: ./tmp3: /usr/local/bin/python2.5^M: bad interpreter: No such > file or directory Try running 'dos2unix' on that file to convert the line endings to the proper Unix style. -- "Bureaucr

Re: Auto login

2008-01-11 Thread James Bennett
On Jan 11, 2008 8:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How do I get access to that backend? The Django auth documentation covers this; look at the note on the documentation for the 'login()' function (in the section on how to log a user in manually). -- "Bureaucrat Conrad, you

Re: dynamic choices in a ChoiceField

2008-01-13 Thread James Bennett
2008/1/13 Alex Koshelev <[EMAIL PROTECTED]>: > When you explicitly write list in choices it evaluates at module > import type. To avoid this write function and pass it as 'choices' > parameter Or... deck = forms.ModelChoiceField(queryset=Deck.objects.all()) -- "Bureaucrat Conrad, you are tec

Re: file upload RAM buffer or stream to tmp

2008-01-14 Thread James Bennett
On Jan 14, 2008 12:01 PM, Vance Dubberly <[EMAIL PROTECTED]> wrote: > Kind of a bummer, guess I'll be using cherrypy for this project. Was > hoping to use django but it looks like there is no way to hook into > the request response loop before the request is parsed. :( If streaming uploads are vi

Re: Problem with Css and django template

2008-01-15 Thread James Bennett
On Jan 15, 2008 1:08 AM, laspal <[EMAIL PROTECTED]> wrote: This: > (r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/laspal/trytemplate/Template/', > 'show_indexes' : True}), Does not match the URL in this: > type="text/css" href="testing1.css" /> So change one

Re: Django Performance

2008-01-15 Thread James Bennett
On Jan 15, 2008 10:07 AM, Sadjad Fouladi <[EMAIL PROTECTED]> wrote: > I have a question. I'm going to use Django for my new website. Can I > use django in a shared hosting environment or I need to buy a > Dedicated server? Does Django need a lot of RAM, like Rails? Please > note that, this site mi

Re: A bug (I'm being rejected from submitting a ticket, as it thinks I'm a spammer. I'M NOT!

2008-01-15 Thread James Bennett
On Jan 15, 2008 9:12 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know I should have sent it using a ticket, but I'm being rejected > for some reason as a spammer. Hope this one will go throgh. Quoting from the "New ticket" page: "If you're getting rejected by the spam filter, we apologi

Re: One to many issue in Django admin

2008-01-15 Thread James Bennett
On Jan 15, 2008 9:34 PM, oak <[EMAIL PROTECTED]> wrote: > In Django admin I can add a track without specifying a file without a > problem however if I go into album and try to add a track that way. It > has an error saying that the file can not be null. It looks like you initially created the tab

Re: [beginner] Commonly used variables.

2008-01-15 Thread James Bennett
It's worth noting that I expanded that a bit and put it into my "template_utils" app: http://code.google.com/p/django-template-utils/ Sent from my iPod On Jan 15, 2008, at 7:46 PM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 16-Jan-08, at 3:26 AM, Petar wrote: > >> The thing is,

Re: These waters aren't so friendly after all

2008-01-16 Thread James Bennett
Ladies and gents, you'll do everyone a favor if you don't rise to the bait here. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: These waters aren't so friendly after all

2008-01-16 Thread James Bennett
Again, folks: please don't rise to the bait ;) -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Private (owner) vs. public records

2008-01-17 Thread James Bennett
On Jan 17, 2008 5:00 AM, Grindizer <[EMAIL PROTECTED]> wrote: > - If you want to retrieve the current logged user at model level, this > is a little more complicated, because models are note designed to see > what happen at process level, but it still possible, look at this: Any code which requir

Re: Private (owner) vs. public records

2008-01-17 Thread James Bennett
On Jan 17, 2008 5:36 AM, Grindizer <[EMAIL PROTECTED]> wrote: > For example, i found this very handy, when we have to support a > multilingual db: getting the current language like this and use it to > select the right values in db can save us a lot of work, and result in > a more clear views code

Re: I think the django's froms js too complicated and not flexible , is there anybody agree?

2008-01-17 Thread James Bennett
On Jan 17, 2008 6:30 AM, maoxl <[EMAIL PROTECTED]> wrote: > writing a html form is just NOT so complicated, and I really don't > think it deserve a py package as luxury as the > django.contrib.newfroms . why not just write html forms by hand . > I'm a new comer to django, hoping somebody tell me

Re: Help tracking down runaway RAM

2008-01-18 Thread James Bennett
Do you have "DEBUG = True" in your Django settings file? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: limit_choices_to in ModelForm

2008-01-19 Thread James Bennett
On Jan 19, 2008 3:51 AM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > I have a limit_choices_to in my model - but this does work on my > ModelForm. How do I do this? Either set up the ModelChoiceField manually and specify the QuerySet, or hang on while I get around to adding tests to the patch

Re: Another database for unit tests

2008-01-19 Thread James Bennett
On Jan 19, 2008 5:05 PM, Jim Crossley <[EMAIL PROTECTED]> wrote: > What's the common way of making unit tests use a different database > than what's in settings.DATABASE_{ENGINE,USER,PASSWORD,HOST,PORT}? http://www.djangoproject.com/documentation/settings/#test-database-name -- "Bureaucrat Con

Re: Another database for unit tests

2008-01-19 Thread James Bennett
On Jan 19, 2008 10:24 PM, Jim Crossley <[EMAIL PROTECTED]> wrote: > Yes, I knew I could override the NAME, but I'd like to override the > ENGINE,USER,PASSWORD,HOST, and PORT, too. Our settings are configured > for mysql/innodb, to match our production environment. But as our > test suite and ini

Re: differences between runserver and apache

2008-01-21 Thread James Bennett
On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote: > Exception Type: ViewDoesNotExist at /admin/ > Exception Value: Tried new_message in module ridgemoor.core.views. Error was: > 'module' object has no attribute 'new_message' Most likely is that something that's different between yo

Re: considering django for The Freesound Project, some (de)constructive critisism

2008-01-21 Thread James Bennett
On Jan 21, 2008 10:22 AM, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > 1. huge numbers of users make the admin almost unusable. Almost any > objects is related to a user (or two). Having to load 500K users in a > form makes for ultra big and slow web pages. Is there a fix for this > somewhe

Re: Tutorial03: question about efficiency

2008-01-22 Thread James Bennett
On Jan 22, 2008 8:16 AM, code_berzerker <[EMAIL PROTECTED]> wrote: > this gives 5 Poll objects. I wonder if this is efficient way of > getting them? Does django get all rows first and then sort it and then > slice it to get only 5? Or is it optimized somehow. The question is if > its simplified fo

Re: Template Macros Like In Jinja

2008-01-22 Thread James Bennett
On Jan 21, 2008 8:30 PM, Papalagi Pakeha <[EMAIL PROTECTED]> wrote: > i wonder if there is any way to have Macros in django templates > similar to what Jinja has (http://jinja.pocoo.org/)? No. The Jinja project was started specifically to add additional programming constructs that the Django tem

Re: Template Macros Like In Jinja

2008-01-22 Thread James Bennett
On Jan 22, 2008 4:15 PM, Papalagi Pakeha <[EMAIL PROTECTED]> wrote: > what's the reasoning behind not having and not planning to have macros > in django templates? they look like a very useful construct compliant > with DRY to me. Django's template system is meant to be a means of expressing pres

Re: How I see the SQL generated in the system in development?

2008-01-23 Thread James Bennett
On Jan 23, 2008 9:17 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote: > How I see the SQL generated in the system in development? > Its appears on the console? http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw-sql-queries-django-is-running -- "Bureaucrat Conrad, you are tech

Re: How do you filter fields from queries?

2008-01-23 Thread James Bennett
On Jan 23, 2008 4:38 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In other words, how do I invoke a query and supply what is essentially > a column list in a SQL SELECT statement? By following the instructions in the nice documentation that's provided with Django: http://www.djangoproject.

Re: Outputting individual fields of a Model form

2008-01-26 Thread James Bennett
On Jan 26, 2008 7:35 PM, almostvindiesel <[EMAIL PROTECTED]> wrote: > I figured {{ form['recipe_name'] }} or > {{ unicode(form['recipe_name']) }} should work per the documentation > here: http://www.djangoproject.com/documentation/newforms/, but doing > so returns the following error within the te

Re: ForeignKey _id not so transparent

2008-01-26 Thread James Bennett
On Jan 26, 2008 11:36 PM, msoulier <[EMAIL PROTECTED]> wrote: > instance = models.ForeignKey(TugInstance) > > When my form is submitted, I am assigning > > client.instance = form.clean_data['instance_id'] You can assign a numeric ID of a TugInstance object to 'instance_id' on a Client object. Yo

Re: exists created_at or updated_at ?

2008-01-27 Thread James Bennett
On Jan 27, 2008 10:54 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote: > Anyone know if there is something like created_at or updated_at of Ruby on > Rails. > These fields are filled automatically when saving and editing? For any DateField or DateTimeField, you can tell Django to automatically up

Re: Multiple sites

2008-01-27 Thread James Bennett
A better solution: 1. Completely forget that you ever learned from any source that it might be a good idea to have a project folder with the apps inside it; the tutorial does that because it's simpler and easier for purposes of introducing Django, but in real-world situations it's generally a ter

Re: Multiple columns for db_indexes ?

2008-01-27 Thread James Bennett
On Jan 27, 2008 10:35 PM, Hugh Bien <[EMAIL PROTECTED]> wrote: > I've been googling around for a while, but I haven't found a way to create > indexes with multiple columns, ie. Several options: 1. Instead of 'syncdb', use the 'sqlall' option of manage.py and pipe the SQL into a file, then edit i

Re: user.get_absolute_url()

2008-01-28 Thread James Bennett
On Jan 28, 2008 6:49 AM, Artiom Diomin <[EMAIL PROTECTED]> wrote: > For example in Middleware, in process_request. You could "monkeypatch" > User on the fly. Or he could use the standard, documented method for overriding a model's get_absolute_url() method: http://www.djangoproject.com/documenta

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread James Bennett
On Jan 29, 2008 10:04 PM, Mark Green <[EMAIL PROTECTED]> wrote: > Just curious, what's the state of connection pooling in django? My personal opinion is that the application level (e.g., Django) is the wrong place for connection pooling and for the equivalent "front end" solution of load balancin

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread James Bennett
On Jan 29, 2008 11:18 PM, Mark Green <[EMAIL PROTECTED]> wrote: > I agree on the loadbalancer front but the overhead for all > those TCP connections (and pgpool managing them) worries me a bit. I've used pgpool in production with great success, so I'm not really sure what overhead you're talking

Re: Simultaneous edits

2008-01-30 Thread James Bennett
On Jan 30, 2008 9:18 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: > Does Django have any built-in way to handle or prevent simultaneous, > incompatible edits to a database record? No, that's what your database's concurrency handling is for. -- "Bureaucrat Conrad, you are technically correct --

Re: Iterating over very large queryset

2008-01-30 Thread James Bennett
On Jan 30, 2008 10:21 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Can you share any hints on how to reduce the memory usage in such > situation? The underlying database structure is rather complicated and I > would like to not do all queries manually. At this level -- hundreds of thousands of ob

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 8:57 AM, Mark Green <[EMAIL PROTECTED]> wrote: > Well, "Build for failure". Temporary overload can happen at any > time and I'd expect django to behave exceptionally bad in that > case as it is. Running out of resources is never a good thing for any system. > Disclaimer: I haven'

<    1   2   3   4   5   6   7   8   9   10   >