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: 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 handle

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 self.

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 mo

Re: Doing query with 'ne' terms.

2007-06-14 Thread James Bennett
On 6/15/07, Nicholas Ding <[EMAIL PROTECTED]> wrote: > But why not add a 'ne' term to do this? > eg. Foo.objects.filter(column1__ne='', column2__ne='') > I think it's more simple. Older versions of Django supported that, but the current 'exclude' syntax is a little more robust in terms of things

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 t

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 databa

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 mo

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 met

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 relatively

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 mod

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: 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 e

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 Co

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', author__exact='dave'

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 s

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 o

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: 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 compatibility

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: Per-domain ROOT_URLCONF and TEMPLATE_DIRS

2007-07-01 Thread James Bennett
On 7/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Every django app grabs ~60mb of RAM. I'm currently running three > different django fcgi processes and that uses half of my available > RAM. I'm kind of curious what you're doing with all that RAM ;) I run my blog on FastCGI, with a fair

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 /home/john-scott/workspace/djang

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/ -- "Burea

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: 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 measure.

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: 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: 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 'li

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 m

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 serve

Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > widget=forms.CheckboxSelectMultiple, > choices=[(assignee.id, > assignee.nickname) for assignee >in > models.User.objects.filter(type__gte=models.User.DE

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/ > pref

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: 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 n

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 options

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 'admin/index.html'

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 with

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 n

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 g

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: 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: 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 Dja

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: 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: 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 multiple

Re: Blog engine

2007-07-17 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 disintereste

Re: Date Problem

2007-07-17 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: model and cascading

2007-07-18 Thread James Bennett
On 7/18/07, tyman26 <[EMAIL PROTECTED]> wrote: > Is it possible to set a property in my model that will set update > cascade/delete to true when the tables are generated? I know models > automatically do this anyways when you delete or update, but if I am > working directly with database informat

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]; Django

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 w

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 3

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 per

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 yo

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 its

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: 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: removal of Django

2007-07-20 Thread James Bennett
On 7/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all.Django auto loaded onto my computer from( I believe) a Harry > Potter web site.I want to remove it,as it is messing up one of the web > sites that I frequent.The site shows a 404 error.As I am a newby to > computer with NO codeing e

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: http://cod

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: Satchmo

2007-07-22 Thread James Bennett
On 7/22/07, kbochert <[EMAIL PROTECTED]> wrote: > If I do install it, will I be able to use it? The Satchmo site has > zips for 'those who have trouble using svn'. If you professionals have > trouble, what chance have I? The biggest problem with SVN that I've seen is not SVN itself, but overzealo

Re: Insert vs. Update

2007-07-24 Thread James Bennett
On 7/24/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > You're not the first to suggest insert() and update() methods that > explicity do SQL INSERT and UPDATE calls. I have a vague recollection > that a decision was made about adding these calls, but a quick search > in the ticket database d

Re: django db models error

2007-07-24 Thread James Bennett
On 7/24/07, akk <[EMAIL PROTECTED]> wrote: > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/django/db/models/base.py", > line 40, in __new__ > model_module = sys.modules[new_class.__module__] > KeyError: '__console__' You'll need to actu

Re: django.contrib.dataplot 0.3

2007-07-24 Thread James Bennett
On 7/24/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote: > Furthermore, is there a formal process for integrating into > django.contrib? How has it worked in the past? At the moment there isn't a formal process; when it's come up before, the most common suggestion seems to have been that an appl

Re: password reset for all cached users?

2007-07-25 Thread James Bennett
On 7/25/07, Patrick Anderson <[EMAIL PROTECTED]> wrote: > Anyway, why not reset password for a logged-in user only? Maybe I've look > at the code too briefly, and there might be a reason for iterating > through users_cache, but that approach sounds safer to me. Since the form accepts an email add

Re: extending user model, a different approach

2007-07-25 Thread James Bennett
On 7/25/07, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > I realized a new way to extend user models, it is simpler than official > get_profile approach of django[1] as there is only one model to work with, > and relationships are kept on the right model, and gives a less hacky feel > than "replaces_

Re: acute (á, é, etc) characters in my templates

2007-07-26 Thread James Bennett
On 7/26/07, vida <[EMAIL PROTECTED]> wrote: > As of 5764 (today, 1 AM) it still doesn't work. If your template files are in an encoding other than UTF-8, you'll also want to set the FILE_CHARSET setting to tell Django how to read your templates: http://www.djangoproject.com/documentation/setting

Re: acute (á, é, etc) characters in my templates

2007-07-25 Thread James Bennett
On 7/26/07, vida <[EMAIL PROTECTED]> wrote: > I get a UnicodeDecodedError if I try to include any of these acuted- > characters in my templates. It's fine if they come from the database > (unicode) but not if they are part of the markup. > >From what I read (and tried), changing settings.DEFAULT_C

Re: Is cloning Facebook in Django feasible?

2007-07-27 Thread James Bennett
On 7/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is it possible to develop a Facebook functional clone in Django? What > parts of it are provided out of the box? Any third-party contributions? This is like going to a company that sells construction equipment and saying "is it possible t

Re: Is cloning Facebook in Django feasible?

2007-07-27 Thread James Bennett
On 7/27/07, Duc Nguyen <[EMAIL PROTECTED]> wrote: > One facebook in america is enough. There is plenty of room for > competition in other countries. Yes, but a straight-up clone of Facebook isn't the way to do it. Facebook succeeded because it chose a specific target market and oriented itself

Re: Model design help

2007-07-28 Thread James Bennett
On 7/28/07, Cole Tuininga <[EMAIL PROTECTED]> wrote: > I could do something like a simple many to many relationship in the > attendee model, but that doesn't indicate ordering (most preferred to > least preferred) per timeslot. You might want to look at thisL http://www.djangoproject.com/documen

Re: Model code generator

2007-07-29 Thread James Bennett
On 7/29/07, dsinang <[EMAIL PROTECTED]> wrote: > Is there a Django model code generator which can generate code based > on a MySQL database schema ? http://www.djangoproject.com/documentation/django-admin/#inspectdb -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct.

Re: error on models with foreign key on each other

2007-07-29 Thread James Bennett
On 7/29/07, james_027 <[EMAIL PROTECTED]> wrote: > D:\private\james\documents\django\ksk>python manage.py validate > manning.employee: Reverse query name for field 'employee_contract' > clashes with field 'EmployeeContr > act.employee'. Add a related_name argument to the definition for > 'employee

Re: caching and "hello username" on each page

2007-07-29 Thread James Bennett
On 7/28/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > I would LOVE to use caching for both anonymous and logged in users, but > the problem is that every page on our site (http://www.splicemusic.com) > has the typical "hello username | log out | ..." at the top of each page. You might c

Re: What should I do to make admin display more fields in User model?

2007-07-30 Thread James Bennett
On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote: > Hey, nobody has ever needed this? Any thoughts? You might want to search the archives of this list, or go to Google and type in "django extend user"; this is a pretty common question and has been covered in a lot of detail ;) -- "Bur

Re: Flickr / Django

2007-07-31 Thread James Bennett
On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Your model and sync script looks exactly like what I was starting to > write!! Heck yeah! There's also an open-source app which aims to genericize the function of periodically pulling in some form of external content to your database, an

Re: Object variable name in admin templates?

2007-07-31 Thread James Bennett
On 7/31/07, biancaneve <[EMAIL PROTECTED]> wrote: > I can do it if I write a whole new view and define my own variables, > but then I lose a lot of the Admin functionality. I'd prefer to just > change the title line of the admin template. Try 'original'. -- "Bureaucrat Conrad, you are technica

Re: Object variable name in admin templates?

2007-07-31 Thread James Bennett
On 7/31/07, biancaneve <[EMAIL PROTECTED]> wrote: > Yes! It worked! Thanks so much! For future reference, you can see the variables passed into the intial context for a change page here: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py#L397 Note that other

Re: Including view in a template

2007-08-01 Thread James Bennett
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote: > I realize that this is an option but it seems to me more natural to > control the content from the template so a designer can build views > using "lego-blocks", without having to tweak the view. You either want: 1. More robust views, or 2. Some cust

Re: Including view in a template

2007-08-01 Thread James Bennett
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote: > Not clear on what you mean by "more robust views". Can you please > elaborate? Write views which select more data. > Regarding custom template tags, I guess I expect many users to want to > use django this way, so I think that having a "load_view" t

Re: Queryset of instances bound to particular ForeignKey

2007-08-02 Thread James Bennett
On 8/3/07, Collin Grady <[EMAIL PROTECTED]> wrote: > >>> B.objects.filter(a__isnull=False) > [, ] And as pointed out in our IRC discussion, that needs a distinct() slapped on the end to weed out duplicate results ;) -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct

Re: Queryset of instances bound to particular ForeignKey

2007-08-02 Thread James Bennett
On 8/3/07, Collin Grady <[EMAIL PROTECTED]> wrote: > He wants every B that has an A fkeyed to it. > > In other words, every instance of B where b.a_set.count() > 0 In which case what he wants is probably something like ModelB.objects.filter(id__in=[o.id for o in ModelA.objects.all()]) Which is

Re: Queryset of instances bound to particular ForeignKey

2007-08-02 Thread James Bennett
On 8/3/07, James Bennett <[EMAIL PROTECTED]> wrote: > Foo.objects.extra(where=['id IN (SELECT %s FROM %s)' % Bar._meta.db_table]) Should have been: > Foo.objects.extra(where=['id IN (SELECT foo_id FROM %s)' % > Bar._meta.db_table]) (sent before I realize

Re: extending django.contrib.auth

2007-08-04 Thread James Bennett
On 8/4/07, eXt <[EMAIL PROTECTED]> wrote: > You shold read very good summary on extending user model here: > http://www.amitu.com/blog/2007/july/django-extending-user-model/ This method will probably have serious problems on multi-site installations, and -- unlike AUTH_PROFILE_MODULE -- has no

Re: newforms errors translation

2007-08-04 Thread James Bennett
On 8/4/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > i'm trying to find a way to translate newforms errors but i can't find > it in docs. > does anybody know if this is documented somewhere? Newforms error messages should be Unicode strings, so use the 'ugettext' or 'ugettext_lazy' functions

Re: startproject errors with Ubuntu

2007-08-05 Thread James Bennett
On 8/5/07, john <[EMAIL PROTECTED]> wrote: > I created a symlink at /usr/local/bin to the django django-admin.py > file under python2.5. If I go to my home directory and try to create > a new project I get a syntax error pointing at the end of > startproject. If I try " >>> /usr/lib/... djan

Re: startproject errors with Ubuntu

2007-08-05 Thread James Bennett
On 8/5/07, john <[EMAIL PROTECTED]> wrote: > thks - the tutorial shows the .py extension and that was giving the > error. The file's name is 'django-admin.py', not 'django-admin', and the tutorial is correct; the problem was that you did not have the executable bit set on django-admin.py, and so

Re: DB ProgrammingError

2007-08-06 Thread James Bennett
On 8/6/07, Michal <[EMAIL PROTECTED]> wrote: > Is there some similar function please? (I read somewhere how to do this, > but forgot it, and solution wasn't so straightforward). You will need to find some way to issue a ROLLBACK statement to your database. One such way is from django.db import c

Re: database permissions

2007-08-08 Thread James Bennett
On 8/8/07, Stephen Bunn <[EMAIL PROTECTED]> wrote: > Understandable. But for somebody new to an ORM type model (like me) > things might not be so clear. If I am writing a PHP or Perl > application, I know exactly what permission it needs because I am > constructing the SQL. With Django, it is b

Re: Showing a Maintenance Page

2007-08-08 Thread James Bennett
On 8/8/07, cwurld <[EMAIL PROTECTED]> wrote: > Occasionally, even thought the code works locally, it breaks the live > site. This would be much less of a problem if I could display a static > page describing to the users that the site is temporarily unavailable > because of maintenance. The templ

Re: mysite.polls application error

2007-08-08 Thread James Bennett
On 8/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi, after hitting > python manage.py sql polls > an error appears and i don't know how to debug in python for find the > error. There is a large warning at the top of the tutorial page: "This document is for Django's SVN rele

Re: Rails-like Flash in Django

2007-08-10 Thread James Bennett
On 8/10/07, sagi s <[EMAIL PROTECTED]> wrote: > In Rails, flash is a way to display a message in the next page. It is > extremely useful to provide lightweight feedback to user operations. > For examples when the user, say, submits a new article and after > clicking on the "Submit" button, then is

Re: Error loading MySQLdb module

2007-08-11 Thread James Bennett
On 8/11/07, Kelsey Ruger <[EMAIL PROTECTED]> wrote: > I have the same problem even though I have installed MySQLdb. Open up a Python interpreter, and try: import MySQLdb If you see an ImportError, MySQLdb may have been installed into a location that's not on your Python import path; you can fix

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, sagi s <[EMAIL PROTECTED]> wrote: > Surely not. It is... darn - Can I just use SQL and be done with it? Of course. But keep in mind that, when programming in an object-oriented language, it's often more useful to get back a set of domain-specific objects -- which requires using Djang

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, Amirouche <[EMAIL PROTECTED]> wrote: > What do you mean, I can't understand. OK, suppose you are running an online store, so you have a database table "orders", which lists orders customers have placed, and another "addresses" which lists the addresses to ship the orders to. To calcul

Re: DjangoSnippets.org is down

2007-08-14 Thread James Bennett
On 8/14/07, TheMaTrIx <[EMAIL PROTECTED]> wrote: > Seems DjangoSnippets is down. > Yesterday it took 10 minutes to load a page and now its simply > erroring out. Yes, it was down. Usually, when it goes down, there is no need to send an email to this mailing list, or to me, or to ping me on IRC;

Re: 0.96 tarball is corrupt

2007-08-14 Thread James Bennett
On 8/14/07, john <[EMAIL PROTECTED]> wrote: > I've downloaded the tarball several times - each time the archiver > shows it as corrupt (other tarballs work fine). Using Ubuntu Feisty. > (and the Feisty backport package is broken as well). I'm able to download it and unpack it just fine on each o

Re: next page in this category

2007-08-14 Thread James Bennett
On 8/14/07, James Tauber <[EMAIL PROTECTED]> wrote: > Okay, this is the solution I came up with: > > http://dpaste.com/16869/ I've done some similar things to account for a get_next/get_previous on a model where some objects aren't meant to be publicly visible, and remembered a little-known but i

Re: Deployed project keeps reloading

2007-08-14 Thread James Bennett
On 8/14/07, Lars <[EMAIL PROTECTED]> wrote: > My first thought was: I've missed a debugging flag somewhere that > needs to be off. Here's what I roughly have: Have you checked the Apache directives which control how many requests a process may server before it gets recycled? Remember that Apache

Re: Changing database structue

2007-08-15 Thread James Bennett
On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What I'd normally do is use alter table to update the fields. I was > surprised to see django won't do it, while using manage.pl syncdb. Is > there a practical way to handle this issue? Or am I doomed to live > with the tables I've created

Re: 404 Page not found handling

2007-08-15 Thread James Bennett
On 8/15/07, TheMaTrIx <[EMAIL PROTECTED]> wrote: > that doesn't exist, gets called, the user gets a 404 page inline with > the sites main layout + a bunch of suggestions for pages that might > fit what the user was looking for, like there are pages relevant to > banana at Write a view which does

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