Re: Lookup by week

2006-01-30 Thread Max Battcher
Adrian Holovaty wrote: On 1/30/06, Jan Rademaker <[EMAIL PROTECTED]> wrote: Would it make sense to implement such a thing? An alternative would be to figure out at what date a week starts and ends and just use pub_date__range, but that's not really the point. I'm just curious how easy/hard it

Re: Extending User

2006-01-30 Thread Roberto Aguilar
I've done this with the latter approach. I made a person model that had more person-specific information and made the user field a foreign key and added the edit_inline option to have the information right there in the user interface: user = meta.ForeignKey(auth.User, edit_inline=meta.STACKED,

Re: Extending User

2006-01-30 Thread char
That did it. Thanks.

Extending User

2006-01-30 Thread char
I've seen a couple of approaches on this mailing list for adding application specific fields to the User class. The first involves extending auth.User but this seems a little complex, and was specifically labeled an "advanced" method. It doesn't seem like you should have to break out deep black

Re: error restoring project

2006-01-30 Thread Luke Skibinski Holt
Ah excellent - I think it's natural to presume after fixing a bunch of errors and updating paths after restoring from backup to a new dir that the fault is more than likely on your end than with product. For anyone who follows, 'ordering' should be a list and look like: class META:

Re: possible to validate a subset of a model's fields?

2006-01-30 Thread Julio Nobrega
You could pickle (as in, serialize) the data and save on the database. Then just unpickle when you need to view it. On 1/30/06, Oliver Rutherfurd <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion, but saving to the db after every page is a > requirement of the app. If someone fills out

Re: possible to validate a subset of a model's fields?

2006-01-30 Thread Oliver Rutherfurd
Hi Amit, On 1/30/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > On 1/31/06, Oliver Rutherfurd <[EMAIL PROTECTED]> wrote: > > The use case for this is a long registration process, where different > > data points from individual models are split across multiple pages. > > The application needs to

Re: Error when relating a model to another model more than once

2006-01-30 Thread Russell Keith-Magee
On 1/31/06, Rudolph <[EMAIL PROTECTED]> wrote: Hi,I'm using the development version of Django (trunk) and I've got twosimple classes. The Language class should contain the two letterlanguage abbreviations and the full name of the language in English. The LanguageTranslation class should contain

Re: possible to validate a subset of a model's fields?

2006-01-30 Thread Amit Upadhyay
On 1/31/06, Oliver Rutherfurd <[EMAIL PROTECTED]> wrote: The use case for this is a long registration process, where differentdata points from individual models are split across multiple pages.The application needs to save data collected after every step, so theuser doesn't have to start from

Re: Template inheritance problem

2006-01-30 Thread PythonistL
Adrian, Thank you for your reply. I still have problems with template inheritance Can you please help me with the following? I have the Index1.html ##Index1.html# {% extends "board/test" %} {% block title %}Tittle from Index.html {% endblock %} This is a text from

Oracle support?

2006-01-30 Thread Robert Hicks
On the Django site it lists the currently implemented databases and say "more to come soon". Is Oracle on that list? And relatively speaking, how "soon" is soon? Robert

Re: What is save to use in __repr__

2006-01-30 Thread Jan Rademaker
A bit of code would have clarified my problem. This is what I tried the first time: return "Testing %s %s %.2f" % (self.someForeignKey.someThing(), self.somedate.strftime("%d-%m-%Y"), self.someFloat) There were 2 problems, basically. First, I tried to access an object instance directly and not

Re: FileField :: mx file size

2006-01-30 Thread Maniac
Waylan Limberg wrote: I envision a simple script that intercepts the upload submit, checks the actual file size against the specified limit (perhaps in a hidden field or hard coded in script or even via an ajax request (but why?)) and either returns an error message or submits the upload. No,

Re: What is save to use in __repr__

2006-01-30 Thread Adrian Holovaty
On 1/30/06, Jan Rademaker <[EMAIL PROTECTED]> wrote: > What is save to use __repr__ ? > > I've found out that I shoud use self.get_someForeignKey().someThing() > instead of self.someForeignKey.someThing(), but what about date fields > and such? > > Because, when I use self.someDateField in

Re: What is save to use in __repr__

2006-01-30 Thread Roberto Aguilar
I ran into the same thing in a model with a ForeignKey to an auth.User object. In my __repr__ function I had: self.get_user() which would crash Django. In this instance, I wanted the username specifically, so I resorted to using: self.get_user().username I didn't try, but I think this would

Re: FileField :: mx file size

2006-01-30 Thread Waylan Limberg
On 1/30/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > On 1/30/06, Maniac <[EMAIL PROTECTED]> wrote: > > > > Amit Upadhyay wrote: > > > > > It would be good to have a general django wide setting specifying the > > > maximum length allowed for POST data, if underlying server allowed it. > > > >

Re: editable in fields

2006-01-30 Thread Maniac
Tim TerlegÄrd wrote: To get a non-editable field you can do field = meta.CharField(editable = False). This is meant for hiding the field, right? Not to make it readonly in code? It means (as far as I know) that default manipulators will skip it and won't complain about their invalidity. So

Re: Error when relating a model to another model more than once

2006-01-30 Thread Rudolph
To be complete, this is the Error page I get: TypeError at /admin/reg/languages/2/ 'bool' object is not callable Request Method: GET Request URL:http://localhost:8000/admin/reg/languages/2/ Exception Type: TypeError Exception Value:'bool' object is not callable

Re: Lookup by week

2006-01-30 Thread Adrian Holovaty
On 1/30/06, Jan Rademaker <[EMAIL PROTECTED]> wrote: > Would it make sense to implement such a thing? An alternative would be > to figure out at what date a week starts and ends and just use > pub_date__range, but that's not really the point. I'm just curious how > easy/hard it would be to

editable in fields

2006-01-30 Thread Tim TerlegÄrd
To get a non-editable field you can do field = meta.CharField(editable = False). This is meant for hiding the field, right? Not to make it readonly in code? To me hidden is more intuitive than editable. I thought that when so much was renamed anyway... :) Tim

What is save to use in __repr__

2006-01-30 Thread Jan Rademaker
What is save to use __repr__ ? I've found out that I shoud use self.get_someForeignKey().someThing() instead of self.someForeignKey.someThing(), but what about date fields and such? Because, when I use self.someDateField in __repr__ django crashes the moment _add_ a new object (using admin).

Re: FileField :: mx file size

2006-01-30 Thread Maniac
Amit Upadhyay wrote: No time for investigating it right now, but existence of those projects imply its doable, even if its a hack, atleast on some servers. Hm... Yes, they do it with some patched FCGI code.

Re: FileField :: mx file size

2006-01-30 Thread Adriano Bonat
I think that this is doable, but need to be implemented by an Apache Hook/Handler. I've done some searches now for something related with mod_python, but not found anything, just a link with this same problem but using Perl. http://www.experts-exchange.com/Web/Web_Languages/CGI/Q_20862752.html

Lookup by week

2006-01-30 Thread Jan Rademaker
Hello, As far is I know it's not possible to query date fields for a cerain week number, eg. # Select all polls from week 5, 2006 polls.get_list( pub_date__year=2006, pub_date__week=5 ) Would it make sense to implement such a thing? An alternative would be to figure out at what date a

Re: FileField :: mx file size

2006-01-30 Thread Amit Upadhyay
On 1/30/06, Maniac <[EMAIL PROTECTED]> wrote: Amit Upadhyay wrote:> It would be good to have a general django wide setting specifying the> maximum length allowed for POST data, if underlying server allowed it.Django just doesn't control these things. Read my answer in this very thread, it's

Re: FileField :: mx file size

2006-01-30 Thread Maniac
Amit Upadhyay wrote: It would be good to have a general django wide setting specifying the maximum length allowed for POST data, if underlying server allowed it. Django just doesn't control these things. Read my answer in this very thread, it's http-server and browser that don't let it

Re: error restoring project

2006-01-30 Thread Max Battcher
Luke Skibinski Holt wrote: my hd failed the other day taking my db with it. I'm trying to restore my project now, but I'm getting this error in the admin app: ERROR: missing FROM-clause entry for table "auth_users" SELECT

Re: Template inheritance problem

2006-01-30 Thread PythonistL
Adrian,thank you for your reply. Yes, they both are in the same (board) directory. So, what shall I try to find out the reason why it doesn't work? Thank you Regards, L.

Re: FileField :: mx file size

2006-01-30 Thread Eric Walstad
On Sunday 29 January 2006 20:29, arthur debert wrote: > is there a way to check for this BEFORE the file > is uploaded? On Monday 30 January 2006 08:15, Adrian Holovaty wrote: > On 1/30/06, tonemcd <[EMAIL PROTECTED]> wrote: > > So does this happen *before* the file is uploaded - I mean when the

Re: FileField :: mx file size

2006-01-30 Thread tonemcd
Cheers Adrian, that's very handy to know.. Tone

validators combined

2006-01-30 Thread Jiri Barton
I have two text input fields in a form. At least one of them is required. My question is, how can I check for this? class MyManipulator = (formfields.Manipulator): def __init__(self, request=None): self.fields = [ formfields.TextField(

Re: mod_python installation problems

2006-01-30 Thread Adrian Holovaty
On 1/30/06, treelife <[EMAIL PROTECTED]> wrote: > Firstly, Debian 3.1 does not have a python2.4 version of the software > for Apache2.0 and when I install the 2.3 version Apache is giving me > some ".. Segmentation fault (11)". Try disabling the PHP Apache module. There are some known issues

Re: FileField :: mx file size

2006-01-30 Thread Adrian Holovaty
On 1/30/06, tonemcd <[EMAIL PROTECTED]> wrote: > So does this happen *before* the file is uploaded - I mean when the > submit button is pressed? It seems that Django will be getting > information from the browser about the length of the data to be > uploaded - and that's something I've always

Re: assign or rename a variable in templates

2006-01-30 Thread tonemcd
Bryan, If you can handle Zope PageTemplates, the plugin from Stefan might be useful: http://www.zope.org/Members/shh/DjangoPageTemplates That allows for variable creation, but of course you don't get the django templates... Cheers, Tone

Re: FileField :: mx file size

2006-01-30 Thread tonemcd
Amit, I think that's more a progress 'barber pole' widget than something which will detect the length of a file and drop the connection if it's over a certain size (although it's hard to tell...) Cheers, Tone

Re: FileField :: mx file size

2006-01-30 Thread Maniac
Adrian Holovaty wrote: def isSmallFile(self, field_data, all_data): if len(field_data["content"] > 1: # 10,000 bytes raise validators.ValidationError, "Please enter a smaller file." The trick here is to operate on field_data['content'] instead of field_data.

Re: image field update impossible.

2006-01-30 Thread [EMAIL PROTECTED]
thank you mary ! MEDIA_ROOT = '/home/greg/Projects/woot/' with 'postimgs' as the path in imagefield allow editing without error.

error restoring project

2006-01-30 Thread Luke Skibinski Holt
my hd failed the other day taking my db with it. I'm trying to restore my project now, but I'm getting this error in the admin app: ERROR: missing FROM-clause entry for table "auth_users" SELECT

mod_python installation problems

2006-01-30 Thread treelife
Many people seem to have some difficulties configuring apache mod_python, at least initially to work with Django. I have also had these initial configuration difficulties, but have successfully configured it on my local box, which runs Suse 9.3. However, I am having real difficulties just

Re: image field update impossible.

2006-01-30 Thread mary
u have to check your media_root that is in settings.py cause i think the problem is that he can't find the right path for your media files and the right path had to be media_root path+ the path of upload_to [EMAIL PROTECTED] wrote: > It doesn't solve the problem, i can't still override the image