Re: Django db-api or raw SQL: getting top 10 blog posters

2007-07-22 Thread James Bennett
On 7/22/07, Patrick <[EMAIL PROTECTED]> wrote: > What would be the most efficient way to get 10 top authors using Django > db-api? Or should I switch to raw SQL to handle this query? The most efficient way would be to use raw SQL. There are a couple queries like that on djangosnippets.org to get

Re: Using django-comment-utils

2007-07-21 Thread James Bennett
On 7/21/07, Chris Moffitt <[EMAIL PROTECTED]> wrote: > I'm trying to get django-comment-utils working and I'm having a persistent > problem where I get the following error when running syncdb: Well, there is an issue tracker where I'll happily help people with any questions they have:

Re: Accessing the backend's string-quoting functionality?

2007-07-20 Thread James Bennett
On 7/20/07, Tim Chase <[EMAIL PROTECTED]> wrote: > Is there a way to access the back-end's string-quoting mechanism? from django.db import backend foo_quoted = backend.quote_name('foo') -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Blog engine

2007-07-20 Thread James Bennett
On 7/20/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > #2 is particularly interesting to me because I've written a simple > blog in Django and there are some non-obvious things that having a > reference implementation to look at would be nice. Things like: To be fair, though, a lot of these things

Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread James Bennett
On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote: > A view knows the logged in user through request.user but i could not > find if a signal has this information somewhere. No, this information is not available in the default signals. This is because Django can be used completely independently of

Re: Question about comment_utils

2007-07-19 Thread James Bennett
On 7/19/07, Shankar <[EMAIL PROTECTED]> wrote: > Is anyone else seeing the same behavior? Should I be running the latest > SVN version of Django to take advantage of comment_utils? You should go here http://code.google.com/p/django-comment-utils/issues/list and paste in the code -- including

Re: Synchronising Database.

2007-07-18 Thread James Bennett
On 7/19/07, Dmitriy Sodrianov <[EMAIL PROTECTED]> wrote: > After typing manage.py syncdb again the table is not synchronised with > the model despite the name of the command syncdb. http://www.djangoproject.com/documentation/django-admin/#syncdb > How should the process of synchronisation be

Re: error accessing /admin/doc/views/

2007-07-18 Thread James Bennett
On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I can access other pages in the doc area (ex: /admin/doc/filters/ or / > admin/doc/tags/) but when I try to access the views documentation, I > receive: ...snip... > SyntaxError at /admin/doc/views/ > invalid syntax (views.py, line

Re: MySQL Clustering

2007-07-18 Thread James Bennett
On 7/18/07, Richard Leland <[EMAIL PROTECTED]> wrote: > Trying to set up a connection from Django to a MySQL cluster. I've never > done this before, so any guidance you could provide would be excellent. Though I may be wrong, I was under the impression that the engine only needs to be specified

Re: template preprocessor ?

2007-07-18 Thread James Bennett
On 7/18/07, olivier <[EMAIL PROTECTED]> wrote: > I'm thinking about a very simple processor that would remove lines > beginning by ## (ala mako), because the Django comment syntax is sooo > verbose and tedious to type You'll probably want to implement it as a custom template loader[1];

Re: Date Problem

2007-07-18 Thread James Bennett
On 7/18/07, Nash <[EMAIL PROTECTED]> wrote: > I am running django pre-0.97 on a linux box. the date command on linux > and in python datetime.now() both give me the correct times. However, > in one of my models, there is a datetime attribute 'created_on' with > default=datetime.now(). The default

Re: Blog engine

2007-07-18 Thread James Bennett
On 7/18/07, Paulo <[EMAIL PROTECTED]> wrote: > No to mention a good blog app that people can standardize on would be > a nice alternative to Wordpress[1] and Simplelog[2]. Having one would > definitely be helpful in the "spreading the word about Django" > department. I'm not entirely

Re: ANN: DMigrate - A Django Database Migration Tool

2007-07-17 Thread James Bennett
On 7/17/07, Noam Raphael <[EMAIL PROTECTED]> wrote: > I would really like to hear what you think about it (especially if > it's good things...) Tell me! I haven't looked at the code, but I wonder about the dependency on multiple ORMs; the Django ORM cannot expose its own functionality on

Re: Missing packages

2007-07-17 Thread James Bennett
On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] mysite]$ ./manage.py validate > admin.logentry: 'user' has relation with model User, which has not > been installed > admin.logentry: 'content_type' has relation with model ContentType, > which has not been installed > 2

Re: The model doesn't check for valid data

2007-07-17 Thread James Bennett
On 7/17/07, Mohammad Tayseer <[EMAIL PROTECTED]> wrote: > Shouldn't these be done at the "save" method? Django shouldn't depend on the > DBMS do these checks, because some fields cannot be represented by the > underlying DB You'll want to search the archives of this and the developers' list for

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread James Bennett
On 7/16/07, Michael <[EMAIL PROTECTED]> wrote: > after many indecisions, I decided to leave Django and keep working > with PHP > I'm really disappointed that I had to make this decision :-( I can certainly sympathize; back in my freelance days I enjoyed writing Python and fell in love with

Re: Flash Message template tag

2007-07-16 Thread James Bennett
On 7/15/07, rtconner <[EMAIL PROTECTED]> wrote: > So one of the (very few) things I had not been happy with regarding > Django is its flash message handling. So I wrote something that would > make me happy. Its just a template tag add-on. Since so far Django has > been so great to me, I wanted to

Re: Flash Message template tag

2007-07-15 Thread James Bennett
On 7/15/07, rtconner <[EMAIL PROTECTED]> wrote: > Yeah I could not get http://www.djangosnippets.org to work. Every time > I tried to add a snippet I got an error. Try again; I just kicked the server and things seem OK now. -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: Updating multiple rows with Django DB API?

2007-07-15 Thread James Bennett
On 7/14/07, Steven Hilton <[EMAIL PROTECTED]> wrote: > I could be updating any number of rows in bar. I want to do this > without do a select on bar. Also, it's worth noting that this is also fairly easy to do, it just involves a little bit more code. Something like the following example should

Re: Updating multiple rows with Django DB API?

2007-07-15 Thread James Bennett
On 7/14/07, Steven Hilton <[EMAIL PROTECTED]> wrote: > When foo.level drops to zero, I need to flip bar.switch like so... > > update bar set switch = 0 where foo_id = foo.id and switch = 1 > > I could be updating any number of rows in bar. I want to do this > without do a select on bar. > > Do I

Re: is there any host servers that supports Django based sites?

2007-07-14 Thread James Bennett
On 7/14/07, Michael <[EMAIL PROTECTED]> wrote: > That's means that I can't use Django or any other python-based > framework for my job ? If the host does not offer Python, you cannot use a Python-based framework. > I'm asking all the programmers that work for other people, how do you > work

Re: Is there any way to custom group models in the admin panel?

2007-07-12 Thread James Bennett
On 7/12/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > This isn't possible at present. You can collect the fields on an > individual model into groups, but there isn't currently a mechanism to > group models other than by application. Sure there is, just supply a template

Re: avoiding 'matching query not exist'

2007-07-11 Thread James Bennett
On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > Huh. I would have expected this case would have been provided for. No, the raising of the exception is quite deliberate on Django's part -- when you use a method which is expected to return one and only one object, Django has only two

Re: avoiding 'matching query not exist'

2007-07-11 Thread James Bennett
On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > How can I do something similar with: > coursestatus = Event.objects.filter( >eventtype__eventcode='corsecond', >eventdate__lt = datetime.now() >).latest('eventdate') > > Currently I get " Event matching query does

Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > I tried the following in a Form class ... > > ]def __init__(self, **kwargs): > ]super(IssueFilterForm, self).__init__(**kwargs) > ]self.assigned_to.choices = [(assignee.id, assignee.nickname) > for assignee > ]

Re: TestCase, Client() and Exception

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > As you see, I view function raises an exception, the exception is > always regarded as "TemplateDoesNotExist". > So I have to change the test case to... > > ] client = Client() > ] self.assertRaises(TemplateDoesNotExist, client.get, "/user/ >

Re: never_cache

2007-07-10 Thread James Bennett
On 7/10/07, Mason <[EMAIL PROTECTED]> wrote: > Hello, I'm a newbie to Dajngo (using version 0.96). I am trying to > keep a particular web page from being cached, ie. I don't want the > user to be able to hit the "Back" button on the browser and use the > previous page to resubmit data to the

Re: User Profiles and Save()

2007-07-09 Thread James Bennett
On 7/9/07, Chris Kelly <[EMAIL PROTECTED]> wrote: > Or do I have to manually manage saving both objects when making a > change? If so, what's the preferred way to do this? by managing the > profile via the user object, or by managing the user object via the > profile (overriding the profile save

Re: psycopg/psycopg2 - error at the loading

2007-07-09 Thread James Bennett
On 7/6/07, uxmal <[EMAIL PROTECTED]> wrote: > using psycopg : > Error loading psycopg module: libpq.so.5: cannot open shared object > file: No such file or directory PostgreSQL's libraries often install into a location where the default ld configuration won't find them; locate the PostgreSQL

Re: Database operations too slow

2007-07-09 Thread James Bennett
On 7/9/07, Santhosh <[EMAIL PROTECTED]> wrote: > Im working on a small web-app using django. The problem is.. the > database operations are too slow. I think it may be because django > makes a new connection and authenticates etc.. to the db everytime it > wants something..Is there some way i can

Re: forms and designers

2007-07-08 Thread James Bennett
On 7/8/07, Al Abut <[EMAIL PROTECTED]> wrote: > Does using a newform shortcut make things that much easier from a > programmatic standpoint? Or to ask the opposite, is using and > elements in a template make things that much harder for > things like data validation? Well, the thing to remember

Re: importing users from another db

2007-07-07 Thread James Bennett
On 7/7/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > If you want Django to handle the full stack, then you will need to > write a Django model that corresponds to the model you are trying to > import. Usually not that difficult to do, but somewhat excessive > effort for a temporary

Re: Filtering foreignkey results with newforms form_for_model

2007-07-06 Thread James Bennett
On 7/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > EventFormClass.base_fields['club'].widget = > widgets.Select(choices=Club.objects.filter(approved=True)) > > But that throws > TypeError at /clubs/events/ > unpack non-sequence The 'choices' argument should look like this: ((1, 'Foo'),

Re: TextField in newforms

2007-07-06 Thread James Bennett
On 7/6/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > Is there any reason there's not a TextField in newforms that defaults to > use a TextArea widget other than the fact that no one has written one > yet? http://groups.google.com/group/django-users/browse_frm/thread/b3dc5cc742f3f068/ --

Re: ubuntu 6.06 deployment issues

2007-07-05 Thread James Bennett
On 7/5/07, John-Scott <[EMAIL PROTECTED]> wrote: > @Nimrod - You were right about the permissions on /home/john-scott/ > workspace, chmod 755 fixed that. But I still have to have the django > development code in /opt to get it to load. Any ideas why symlinking > to

Re: AttributeError: 'bool' object has no attribute 'get'

2007-06-28 Thread James Bennett
On 6/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i'm using 0.96pre, the multi-db branch. The bug was in the oldforms system, and has been fixed in trunk and in the older releases we maintain support for; the multi-db branch went stagnant for a long time, and is only now being picked up

Re: Password Logistics Help Needed

2007-06-28 Thread James Bennett
I wrote a quick off-list reply to this last night, but thought it might be worth pointing out parts of it publicly as well so anyone who searches the archives with similar problems will spot this: 1. Django does still support plain old unsalted md5 passwords for login (for backwards

Re: pydoc problem

2007-06-27 Thread James Bennett
On 6/27/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Looks like this is the default result for Model subclasses. Possibly > related to the way we create them (using a metaclass). Feel free to work > out a patch in django/db/models/base.py (in the ModelBase class, > probably) if you want to

Re: Custom admin field widgets in the newforms-admin branch

2007-06-27 Thread James Bennett
On 6/27/07, leif strickland <[EMAIL PROTECTED]> wrote: > After some digging around, it looks like the newforms-admin branch > does not allow widget declarations within the model class itself. Yeah. As you've discovered, one of the big points of newforms-admin is to get as much stuff as possible

Re: Custom admin field widgets in the newforms-admin branch

2007-06-27 Thread James Bennett
On 6/27/07, leif <[EMAIL PROTECTED]> wrote: > Does anyone have information on this topic? I have a feeling I'm not > the only one who's wondering this. Thanks! Your best bet is probably to read the source right now; when the branch is complete there will undoubtedly be documentation showing the

Re: Problem with query over relationships and the FOO_set Manager

2007-06-25 Thread James Bennett
On 6/25/07, ilDave <[EMAIL PROTECTED]> wrote: > So, I looked in the documentation and I found the 'FOO_set' Manager, > and I tried something like this: > > d = Details.objects.filter(creation_date__gte=datetime.date(2007, 06, > 01)) > d = d.header_set.filter(code__exact='123',

Re: no newforms.TextField() available?!?!?

2007-06-25 Thread James Bennett
On 6/25/07, Jens Diemer <[EMAIL PROTECTED]> wrote: > This works: > mail_text = forms.CharField(widget=forms.Textarea) That's by design. Whether to show an input type="text" or a textarea is a matter of widgets, so you differentiate between them by using different widgets. -- "Bureaucrat

Re: Introducing DjangoSites.Org

2007-06-25 Thread James Bennett
On 6/25/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > wasnt in spam either - seems to have got eaten up somewhere on the > way - I noticed djangosnippets also had this problem at the start ... > maybe you should consult james bennet On average, I get three or four emails bounced back at me

Re: admin: suggestions for how to warn users that an object is being viewed for editing

2007-06-22 Thread James Bennett
On 6/22/07, ToddG <[EMAIL PROTECTED]> wrote: > Rails has an implementation you could look at for an example, likely > simpler to read than something like Hibernate... not sure how/if > anything could be hooked/monkey'd into the django-admin though. This is best handled by your database (assuming

Re: User data shared between two websites

2007-06-21 Thread James Bennett
On 6/21/07, Petey <[EMAIL PROTECTED]> wrote: > Is there a way to use the same authentication tables between multiple > sites? I want users on one of my websites to be able to use the same > login on another without duplicating the tables. Is this possible. I > couldn't tell if the add-on sites

Re: Hypothetical: Customizable Member Pages

2007-06-20 Thread James Bennett
On 6/20/07, Bryan Veloso <[EMAIL PROTECTED]> wrote: > This feature is a show-stopper, since the market I'll be gearing this > to almost requires features like this to be there. So am I dreaming > that this can be done? Has anybody else attempted something like this > yet? It should be

Re: Time duration - which field type to use

2007-06-20 Thread James Bennett
On 6/20/07, Joe Bloggs <[EMAIL PROTECTED]> wrote: > This means the duration is 25 minutes long. What would be the best field to > keep this data in? I suspect that I will use this data to calculate the end > time of the programme but the duration is also useful. Assuming that another piece of

Re: Maintain data over request/response in memory

2007-06-20 Thread James Bennett
On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Well, I 'm implementing a performance counter. This counter will be > updated everytime someone view our web page. > So, I don't want to rely on another external system such as database. > I just want to provide counter to some external

Re: Maintain data over request/response in memory

2007-06-20 Thread James Bennett
On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > One way I can think is, create a service to allow any views to > update data and provide a call for reader. Generally we call that a "database" or a "cache" ;) Any reason why you can't store this data using either Django's

Re: Admin: Hiding fields from certain user groups

2007-06-15 Thread James Bennett
On 6/15/07, andyhume <[EMAIL PROTECTED]> wrote: > Other than writing a new view for the change form, is there anything I > can do to stop certain users or user groups from being able to edit a > particular field of the model in the admin? Not at the moment, no. Please remember when considering

Re: How can access the model.manager in the model?

2007-06-14 Thread James Bennett
On 6/14/07, Young Gyu Park <[EMAIL PROTECTED]> wrote: > This is only valid when the category have one depth. > > But what about two or three depth? Look at it carefully; it works with *any* depth of categories. To confirm, run this simplified example which uses plain Python objects instead of

Re: How can access the model.manager in the model?

2007-06-14 Thread James Bennett
On 6/14/07, Young Gyu Park <[EMAIL PROTECTED]> wrote: > To do this I try to modify __str__ function by recursive function > > To get the parent category I need to call the filter function, But the > python told me No, you can do it pretty easily like this: def __str__(self): if

Re: Database protection/coherency between multiple applications accessing the same tables

2007-06-13 Thread James Bennett
On 6/13/07, womble <[EMAIL PROTECTED]> wrote: > It sounds like we should be looking into transactions, but I can't find > any examples regarding how to set them up, what will happen when a > transaction fails (e.g. try to update a row that has been locked by > another db client), and how to

Re: Database protection/coherency between multiple applications accessing the same tables

2007-06-12 Thread James Bennett
On 6/12/07, womble <[EMAIL PROTECTED]> wrote: > We're a little closer to experimenting with this, and have another question: > is there any coherency checking/row (table?) locking implemented in > django's db layer? Django itself does not implement any locking features, or anything else designed

Re: Including [django-users] in subject line?

2007-06-09 Thread James Bennett
On 6/9/07, Mike Schinkel <[EMAIL PROTECTED]> wrote: > Ironic. I was asking for a method that would help me make the list more > managable, and have been told "no." Ironic because it will likely cause me > to leave before I can really learn more about Django, my reason for wanting > to get on the

Re: Including [django-users] in subject line?

2007-06-09 Thread James Bennett
On 6/9/07, Mike Schinkel <[EMAIL PROTECTED]> wrote: > Thanks for the warm welcome to a new list member. I'm sorry if it sounded rude; again, I wasn't trying to pick on you, but it's also hard to articulate this without sounding like an asshole. It's kind of a lose-lose situation. This list has

Re: Including [django-users] in subject line?

2007-06-09 Thread James Bennett
On 6/9/07, Mike Schinkel <[EMAIL PROTECTED]> wrote: > Is there any chance the owners of this list could modify the configuration > so that the emails contain [django-users] in the subject line? It would > make it so much easier to deal with the volume of email if this could be > done. I'm not

Re: Custom filters failing with "no module"

2007-06-09 Thread James Bennett
On 6/9/07, Andrew R <[EMAIL PROTECTED]> wrote: > I think a better long term solution is something like: > > Template.add_templatetags_file('filename.py') > So long as your code is in a location where your code can be imported by Python, there is another way; there are a couple of

Re: Custom filters failing with "no module"

2007-06-08 Thread James Bennett
On 6/6/07, Andrew R <[EMAIL PROTECTED]> wrote: > whereas I just want it to import "javadoc_filter" from my current dir. I'm > sure > this is by design in django but there must be a way around it. This is one of the tricky bits of Django that you don't often see. Django needs to have some

Re: manipulator for auth.user

2007-06-08 Thread James Bennett
On 6/8/07, Dushyant Sharma <[EMAIL PROTECTED]> wrote: > come on somebody pl. reply Please don't do this. Sometimes it takes a little while -- maybe even a day or so -- for someone to read through and figure out how to help you with your problem, and quickly posting followups like this won't

Re: form_for_model, custom save(), and saving excluded fields?

2007-06-06 Thread James Bennett
On 6/6/07, ringemup <[EMAIL PROTECTED]> wrote: > If I've got a form_for_model but I've excluded some fields from it > entirely (because I don't want people to be able to find the values in > hidden fields, or even try to submit them), how do I set values back > for those fields before saving the

Re: apache memory requirement ballparks?

2007-06-04 Thread James Bennett
On 6/4/07, Andrew <[EMAIL PROTECTED]> wrote: > What are some ballpark memory figures (memory vs requests/sec or > concurrent connections) for people running django on Apache prefork w/ > mod_python? Would, say, 150 requests/sec for a 2GB memory allocation > seem reasonable? As always: it

Re: Creating a current path Context Processor

2007-06-03 Thread James Bennett
On 6/3/07, Evan H. Carmi <[EMAIL PROTECTED]> wrote: > I don't know how to pass the context processor with HttpResponse so my > template can do the ifequal. If someone can send me in the right > direction it would be glorious. Have a look at the documentation, which covers the fact that you need

Re: Applications imports best practices ?

2007-05-30 Thread James Bennett
On 5/30/07, Luper Rouch <[EMAIL PROTECTED]> wrote: > 2. import bar.module > the application is more portable, but its path has to be included in > PYTHON_PATH (at least under mod_python) I generally opt for this one, but with one caveat: I almost *never* place applications directly inside the

Re: obscenely long load times for simple create/update functions

2007-05-29 Thread James Bennett
On 5/29/07, hotani <[EMAIL PROTECTED]> wrote: > in the model, I changed to: > models.ForeignKey(Client,raw_id_admin=True) To be fair, the official model docs do recommend using raw_id_admin when the related table contains large numbers of records; otherwise, building a drop-down form of all of

Re: Alternative approach to UserProfile

2007-05-28 Thread James Bennett
On 5/28/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I thought I had the lock on the grumpy old man role in this list. I'm grumpy but not old; what prize do I get? Dang kids these days with their user profiles... -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: [bug]URLField 200 max_length is not enough.

2007-05-28 Thread James Bennett
On 5/28/07, flyaflya <[EMAIL PROTECTED]> wrote: > I have a url, its length is 201. I'm not trying to be mean here, but... 1. We have a public bug-tracking system for bug reports: http://code.djangoproject.com/timeline 2. Please search the bug-tracking system before reporting an issue; odds are

Re: change db connection upon login

2007-05-27 Thread James Bennett
On 5/27/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > No, Django is not designed like that. All connections to the database > are done as the user you specify in the settings file. You would need to > reimplement connection and cursor management inside the > django/db/backends/* if you

Re: reusing python objects

2007-05-24 Thread James Bennett
On 5/24/07, wesman <[EMAIL PROTECTED]> wrote: > I just don't want to have to write this stuff all again and > maintain two copies of it - can I use multi-inheritance and create a > model that is sub-classed from my "job" class and the models class? Sure. The only time you'll run into problems is

Re: Can you define an extra filter to be applied to a class in all cases via the model?

2007-05-24 Thread James Bennett
On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Rather than going to every function I am displaying items ( 99% of the > time I'm using .filter then some filter ), is there a way to tell it > in the model to always append delete_flag=0 to any of the .filter > parameters I am passing

Re: Is it essential to run setup.py?

2007-05-22 Thread James Bennett
On 5/23/07, Thomas Ashelford <[EMAIL PROTECTED]> wrote: > I'm hoping that setup.py is just a convenience file that does > something I can do manually (I'm a python newbie, so when I took a > look inside I was a bit bamboozled. I could probably figure it out > given a spare hour or two!) In order

Re: Offline Django Apps

2007-05-22 Thread James Bennett
On 5/22/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > I'm curious if there are others who could use this functionality but > for Django. If so, perhaps we can all collaborate and come up with a > solution that runs on Mac, Windows, and Linux. Data syncing would be > nice but can come later. I'd

Re: Generic relations naming

2007-05-21 Thread James Bennett
On 5/21/07, Sebastjan Trepca <[EMAIL PROTECTED]> wrote: > I just started to use generic relations and I was wondering why are the > default field names "object_id" and "content_type" and not "object_id" and > "object_type"? > Seems better that way and more logical ... or is it? I would guess

Re: Scheduler proposal

2007-05-20 Thread James Bennett
On 5/20/07, Marc Fargas Esteve <[EMAIL PROTECTED]> wrote: > Both cases are really really bad depending on what you are trying to achieve. > > You could simply run a cronjob that dispatches different signals like: > "hourly_signal", "daily_signal" and listen for them anywhere. The idea of some

Re: Where is newform admin in trunk?

2007-05-19 Thread James Bennett
On 5/19/07, ivan_d <[EMAIL PROTECTED]> wrote: > I read that newform admin was merged to trunk I don't see anything in that thread which says it's been merged, and it hasn't been merged; it's still a separate branch. If you want, you can look at the code here:

Re: rendering files in markdown

2007-05-17 Thread James Bennett
On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: > So how would i extend the markdown filter? > > Would this be better handled in another place, better way or different > module? Shameless self-promotion: I wrote a little app a while back which is designed to make this sort of thing much

Re: Is it really this hard?

2007-05-16 Thread James Bennett
On 5/16/07, John M <[EMAIL PROTECTED]> wrote: > portfolio = Portfolio.objects.get(pk=portid) > > obj.portfolio = portfolio Somewhat undocumented, but you should be able to do obj.portfolio_id = portid Instead of doing the lookup and assigning the object, if you're concerned

Re: Scalability / Traffic-Volume Numbers

2007-05-16 Thread James Bennett
On 5/16/07, Ray Dookie <[EMAIL PROTECTED]> wrote: > I'm interested to know how much load can a django box say with 512MB > ram handle. The biggest question to ask here is what level of traffic you're expecting, and how quickly you expect that traffic to go; there are lots of things you can do to

Re: Is it really this hard?

2007-05-16 Thread James Bennett
On 5/16/07, John Matthew <[EMAIL PROTECTED]> wrote: > So, assuming my commit=false works, i should be able to say something like: > > form.clean_data['fk_id'] = fkobjid No; you want your form to not have any field at all for the foreign key, because you want the form to completely ignore the

Re: __str__() returning unicode strings

2007-05-16 Thread James Bennett
On 5/16/07, Andreas Ahlenstorf <[EMAIL PROTECTED]> wrote: > I've some models where the strings returned by __str__() are unicode > strings and contain non-ascii characters, especially umlauts. With a > recent Django version, this causes UnicodeEncodeErrors all over the > place. Could anybody give

Re: Is it really this hard?

2007-05-16 Thread James Bennett
On 5/16/07, John M <[EMAIL PROTECTED]> wrote: > Thanks for info, but what happens when the form.save() is called, > since the FK isn't part of the clean_data, it will fail no? Form.save accepts a 'commit' keyword argument, which default to True; when it's True the form will try to actually save

Re: How to set FORLOOP.COUNTER=0?

2007-05-16 Thread James Bennett
On 5/16/07, Renato Lipi <[EMAIL PROTECTED]> wrote: > I am using FORLOOP built-in tag. There is a time that I need to restart this > count, setting forloop.counter=0. How can I do something like that? The plain template language (deliberately) cannot perform variable assignments; custom template

Re: Is it really this hard?

2007-05-15 Thread James Bennett
On 5/15/07, John M <[EMAIL PROTECTED]> wrote: > I wish the custom form option would allow me to bind to a data object, > based on field names being the same, that way I could have fields in > the form that aren't bound and ones that are, without a lot of hassle. To do that you want to get a

Re: Is it really this hard?

2007-05-15 Thread James Bennett
On 5/15/07, John M <[EMAIL PROTECTED]> wrote: > When I put up the form for order, I don't want the Customer (foreign > key) to appear. I've not seen anything on the forum that shows you > can easily eliminate a field from the form? In general, form_for_model and form_for_instance are for when

Reminder: if you're using an SVN checkout, watch for changes

2007-05-15 Thread James Bennett
Howdy, folks! Since a recent change in Django's development trunk caught a few people unawares (see the thread today on 'clean_data' versus 'cleaned_data' in newforms), I thought I'd take this opportunity to put on my release-manager hat and remind everybody that if you're working from a

Re: Style with newforms

2007-05-15 Thread James Bennett
On 5/15/07, Tipan <[EMAIL PROTECTED]> wrote: > When rendered to the template, it produces a bullet point alongside > each radio button. In your template -- not in Python code -- add an HTML 'id' to your form, and then put a rule like this in your site's stylesheet: #my_form_id ul li {

Re: SQL Queries over multiple Tables

2007-05-14 Thread James Bennett
On 5/14/07, Sven Herzing <[EMAIL PROTECTED]> wrote: > and I like to get the Products for a specific group and for a specific > company. Given a specific company name and a specific product group name, the following retrieves all the products which belong to that company and that group: >>>

Re: Template Tag param=Model

2007-05-14 Thread James Bennett
On 5/14/07, Jimmy <[EMAIL PROTECTED]> wrote: > I have a templatetag that basically fetches archive information for a > specific model, the only thing is I cannot figure out how to convert the > model parameter which is passed in as a string to an actual django Model You want the function

Re: where to "listen" for backwards incompatible changes in trunk?

2007-05-14 Thread James Bennett
On 5/14/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > Anyway, where do I "listen" to backwards incompatible changes? Is there > an RSS feed? Is there a mailinglist (django dev??)? Watch this wiki page: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges -- "Bureaucrat

Re: Custom filter/tag and template inheritance

2007-05-14 Thread James Bennett
On 5/14/07, Olivier Guilyardi <[EMAIL PROTECTED]> wrote: > Is this the expected behaviour? Yes; tag libraries don't persist across blocks or into child templates. You can make a particular tag library "global" by using the (undocumented) function django.template.add_to_builtins, however;

Re: QuerySet from list of objects

2007-05-12 Thread James Bennett
On 5/12/07, checco <[EMAIL PROTECTED]> wrote: > into a QuerySet? Or maybe there is a way to pass to the object_list > view directly the list of objects as returned by the SQL statement > (with cursor.fetchall())? If you've got the list of ids, you can use an 'id__in' lookup to get a QuerySet out

Re: django-tagging and admin pages

2007-05-11 Thread James Bennett
On 5/11/07, akonsu <[EMAIL PROTECTED]> wrote: > the tags_list field that you propose is an extra field that is stored > in the database. i want to avoid this because tags are stored in their > own tables and this field is only used for conveniency. the contents > of this field is not needed at

Re: Tagging

2007-05-11 Thread James Bennett
On 5/11/07, Christian M Hoeppner <[EMAIL PROTECTED]> wrote: > Just what I needed. Still... I have to handle this in a custom admin view, do > I? Even after reading that chapter in the django book I'm unsure about those > custom views. Where do I tell it to show that text input if it's not in the

Re: Tagging

2007-05-11 Thread James Bennett
On 5/11/07, Christian M Hoeppner <[EMAIL PROTECTED]> wrote: > How would one handle this? > > * Display text input instead of default multi-select. > * Handle the input and save it to the right places. You might want to have a look at Jonathan Buchanan's Django tagging application, which seems

Re: First impression of django

2007-05-11 Thread James Bennett
On 5/11/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > there should be a clear way to trigger exceptions when non-existing > variables are added to the templates. Again, the reasoning is that it's better to have an empty string (or TEMPLATE_STRING_IF_INVALID, if set) come back than to

Re: First impression of django

2007-05-11 Thread James Bennett
On 5/11/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I can't speak for others, but I'd like to see a little more than that. > The Wiki page about schema evolution [1] has a decent set of ideas. > From that document, specifying raw SQL for model transforms is a > necessary, but not

Re: First impression of django

2007-05-11 Thread James Bennett
On 5/11/07, Nic James Ferrier <[EMAIL PROTECTED]> wrote: > Something needs to be done though... or ongoing maintenance of Django > apps is going to be really hard. I haven't found it terribly hard with a little coding discipline; the way we've handled it is to write the necessary SQL and commit

Re: First impression of django

2007-05-11 Thread James Bennett
On 5/11/07, Thomas Guettler <[EMAIL PROTECTED]> wrote: > First I missing a way to sync the database with the model. The command > syncdb has a bad name. It should be called initdb. But you can live > without autosync: Redirect the output of sqlall to a file. Update model, > redirect the output

Re: How well should I know Python before using Django?

2007-05-09 Thread James Bennett
On 5/9/07, walterbyrd <[EMAIL PROTECTED]> wrote: > Thanks to all who replied. BTW: I have programmed professionally in > about a dozen different languages, and have a degree in math with a > concentration in comp sci. But, I'm new to Python. I've been reading > up, and writing a few simple

Re: how to use django model independently?

2007-05-09 Thread James Bennett
On 5/9/07, bear330 <[EMAIL PROTECTED]> wrote: > Did anyone try to use django model independently? > How to do that? Yes, it's a fairly frequently asked question on this list, and in fact I think it's been asked and answered at least once in the last week. I don't mean to go after anyone in

<    5   6   7   8   9   10   11   12   13   14   >