admin_list cannot import isleap

2007-07-03 Thread omat
Hi all, When I try to view list of objects in admin I get the following error message for every list view of every application, including the contributed ones such as comments: 'admin_list' is not a valid tag library: Could not load template library from django.templatetags.admin_list, cannot im

newforms: prefix delimiter (minus) not javascript friendly

2007-07-03 Thread Thomas Guettler
Hi, the prefix delimiter (minus) is not very javascript friendly. Why not use e.g. two underscores? See newforms/forms.py class BaseForm: def add_prefix(self, field_name): """ Returns the field name with a prefix appended, if this Form has a prefix set. Subcla

Re: admin_list cannot import isleap

2007-07-03 Thread omat
BTW, my models do not yield any error, and everything except the admin are working as expected. On 3 Temmuz, 11:22, omat <[EMAIL PROTECTED]> wrote: > Hi all, > > When I try to view list of objects in admin I get the following error > message for every list view of every application, including t

Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-03 Thread bluszcz
Hello people - I wrote earlier this mail on django devs but Adrian and Graham pointed me, that I should write here. I am using Apache 2.0 and mod python 3.3,1 on Ubuntu Dapper x86_64. I found a strange behavior during SetEnv directive. But let's start from the beginning. I have two virtual hosts,

Re: Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-03 Thread Graham Dumpleton
On Jul 3, 8:40 pm, bluszcz <[EMAIL PROTECTED]> wrote: > Hello people - I wrote earlier this mail on django devs but Adrian and > Graham pointed me, that I should write here. > > I am using Apache 2.0 and mod python 3.3,1 on Ubuntu Dapper x86_64. I > found a strange behavior during SetEnv directive

Re: Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-03 Thread bluszcz
Thanks Graham for the fast reply. Unfortunately, I cannot list the sites directly - too much of them (about 100), and generally I have to handle all except of 'admin' one :( On 3 Lip, 13:07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jul 3, 8:40 pm, bluszcz <[EMAIL PROTECTED]> wrote: > > >

newb: Model DateTimeField and Timedelta

2007-07-03 Thread johnny
My model named: Post It has a field created_at as: created_at = models.DateTimeField(auto_now_add = True) Would Post.created_at be of string or datetime ? I want to add 2 weeks to it, like Post.created_at + 14 days. Can I do this? Post.created_at =Post.created_at + datetime.timedelta(weeks=2)

Re: Sybase support for Django

2007-07-03 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/3/07, adm <[EMAIL PROTECTED]> wrote: >> Russ, >> I sure can try that. The problem is I haven't gone through the >> Django framework in details as such, which make me quite helpless >> while adding the support. > > Thats fine. However, as fair warning - this

Re: Sybase support for Django

2007-07-03 Thread Russell Keith-Magee
On 7/3/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > Thats fine. However, as fair warning - this is the first time that > > Sybase support has been requested (compared to the regular requests > > for MS SQL Server support), so I wouldn't expect to see Sybase suppor

Re: Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-03 Thread bluszcz
I've just found one thing - this happen if two users send two request at once - one for admin.coke, second for *.coke. This happen when apache handling these requests by one process (i set PID logging..) On 3 Lip, 13:41, bluszcz <[EMAIL PROTECTED]> wrote: > Thanks Graham for the fast reply. Unf

MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread [EMAIL PROTECTED]
Hi We are using mysql 5.0.42 and are getting this error when trying to insert records of over 5M. We have set max_allowed_packet as per the advice on http://dev.mysql.com/doc/refman/4.1/en/packet-too-large.html to be 1G but to no avail althought this did allow the direct sql to suceed. Does djang

Re: newb: Model DateTimeField and Timedelta

2007-07-03 Thread Andreas Pfrengle
I'd suggest: from datetime import datetime, timedelta p = Post() # create an instance of Post # p.created_at should now be a datetime-object to python p.created_at + timedelta(weeks=2)# will also be a datetime object see also: http://docs.python.org/lib/module-datetime.html --~--~

Re: Sybase support for Django

2007-07-03 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/3/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Russell Keith-Magee wrote: >>> Thats fine. However, as fair warning - this is the first time that >>> Sybase support has been requested (compared to the regular requests >>> for MS SQL Server support), so I wouldn't

Form isn't appearing properly in template

2007-07-03 Thread Rishtastic
Hi, I'm a django newb and I am trying to make an upload form. my view is: 11 def newupload(request): 12 manipulator = PFile.AddManipulator() 13 username = request.user.username 14 u = User.objects.get(username=username) 15 16 if request.POST: 17

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Martin Winkler
Am Tue, 03 Jul 2007 15:07:14 - schrieb "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>: > We are using mysql 5.0.42 and are getting this error when trying to > insert records of over 5M. I may sound nosy, and apologize for that. But don't you think that you have a software design bug when one record

Re: newb: Model DateTimeField and Timedelta

2007-07-03 Thread Carl Karsten
johnny wrote: > My model named: Post > > It has a field created_at as: > created_at = models.DateTimeField(auto_now_add = True) > > Would Post.created_at be of string or datetime ? > > I want to add 2 weeks to it, like Post.created_at + 14 days. Can I do > this? > Post.created_at =Post.created

Re: Ideas for performance improvement?

2007-07-03 Thread jj
It's indeed a python piece of code: def is_visible_by(self, author): projects = author.projects.all() return author.user.is_staff or\ author.is_manager or\ (author.is_lead_writer and (self.project in projects)) or\ (author == self.main_auth

Re: Questions about Django Templating

2007-07-03 Thread scadink
1. Rails people are big on not writing HTML. <%= link_to 'Apple', :url => 'http://apple.com' %> http://apple.com";>Apple The shortcuts just aren't shorter. And, as anyone with a large Rails app will tell you, once you get users, you frantically go around removing all of those template helpers.

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Carl Karsten
Martin Winkler wrote: > Am Tue, 03 Jul 2007 15:07:14 - > schrieb "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>: > >> We are using mysql 5.0.42 and are getting this error when trying to >> insert records of over 5M. > > I may sound nosy, and apologize for that. But don't you think that you > have a

Re: Questions about Django Templating

2007-07-03 Thread Jeremy Dunck
On 7/3/07, scadink <[EMAIL PROTECTED]> wrote: > 3a. I wish Django would simply assume that my templates are under > app_name/templates. That way, I would have my models and views in the Use the app template loader? http://www.djangoproject.com/documentation/templates_python/#loader-types >

Re: Ideas for performance improvement?

2007-07-03 Thread Jeremy Dunck
On 7/3/07, jj <[EMAIL PROTECTED]> wrote: > def is_visible_by(self, author): > projects = author.projects.all() > return author.user.is_staff or\ > author.is_manager or\ > (author.is_lead_writer and (self.project in projects)) or\ > (author =

Re: caching between successive calls to model.objects.all()?

2007-07-03 Thread Benjamin Slavin
On 7/2/07, Lawrence Wang <[EMAIL PROTECTED]> wrote: > tell me more about transaction management -- i don't believe i'm using any, > because there's nothing in my settings.py that would seem to apply, but > perhaps i've overlooked something trivial. You can read about it at [0]. You can read more

How to know what went wrong with the .save()

2007-07-03 Thread AnaReis
Hi! In my project, I'm doing a .save() but nothing is being saved and I cant figure out why... The code is: [models.py] class LevelForm(forms.Form): level_Name=RegexField('^level\d[a-b]?$', required=True, max_length=20, initial='level', error_message='Blah') instrument_Name=ChoiceField(re

Re: caching between successive calls to model.objects.all()?

2007-07-03 Thread Lawrence Wang
On 7/3/07, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > > > On 7/2/07, Lawrence Wang <[EMAIL PROTECTED]> wrote: > > tell me more about transaction management -- i don't believe i'm using > any, > > because there's nothing in my settings.py that would seem to apply, but > > perhaps i've overlooked s

Basic Form Question - Radio Option Values

2007-07-03 Thread Blaine Garrett
Hi, I have a basic form question I have been struggling with. I have a form with a set of radio options and I want to specify the option values. I got this to work. However, I was assigning the values external to the form in the view. This form will be used in quite a few spots and I would

Again, django and MSSQL

2007-07-03 Thread mamcxyz
I try, with not sucess to apply the patch for make worj django and MS Sql. The tickets is a jungle and not see the logic in how is the thing organized. I'm building a store based in satchmo for integrate a couple of local ERP system, based in MS Sql, so I have a motivation to work on it... Anyb

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Martin Winkler
Am Tue, 3 Jul 2007 17:34:33 +0200 schrieb Martin Winkler <[EMAIL PROTECTED]>: > If you have binary data, why don't you use FileField and ImageField? > That way you'd store the large data in the filesystem and only have a > reference to the file in the database. Maybe I should clarify the problem

Accessing Web Services using Django

2007-07-03 Thread Roboto
Hey guys, I'm still new to Python and Django, heck I guess I consider myself new to web development in general, and I'm at a part where I'm a little lost on what to do. In a nutshell I have a form that will take in a Country (from a drop down) and a postal code. I want to grab the province/state

Re: Again, django and MSSQL

2007-07-03 Thread Carl Karsten
mamcxyz wrote: > I try, with not sucess to apply the patch for make worj django and MS > Sql. > > > The tickets is a jungle and not see the logic in how is the thing > organized. I'm building a store based in satchmo for integrate a > couple of local ERP system, based in MS Sql, so I have a moti

Re: Accessing Web Services using Django

2007-07-03 Thread Jacob Kaplan-Moss
Hey Roboto -- There isn't anything Django-specific about consuming web services; it's just Python. You might want to check out the section of Dive Into Python that covers web services: http://diveintopython.org/http_web_services/index.html God luck, Jacob --~--~-~--~~~-

augmenting admin delete

2007-07-03 Thread Bryan
Is there an easy way to augment deleting from the admin page. Specifically, I'm uploading an image and as part of saving the image model I make a thumbnail (which isn't part of the model). The admin delete will remove the uploaded image but not the thumbnail, so I'd like to basically say, whenever

Re: Accessing Web Services using Django

2007-07-03 Thread Roboto
Thanks Jacob, I was looking for something like this! On Jul 3, 2:17 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Hey Roboto -- > > There isn't anything Django-specific about consuming web services; > it's just Python. You might want to check out the section of Dive Into > Python that cov

Re: {{ perms }} seems to be empty

2007-07-03 Thread rskm1
rskm1 wrote: > Any chance of getting the _DOCS_ updated? > > For example, it would be nice if the first place {{perms.foo}} was > mentioned would at least hint that it wouldn't work in conjunction > with the render_to_response() shortcut, or perhaps it could introduce > the RequestContext class (

Re: {{ perms }} seems to be empty

2007-07-03 Thread rskm1
Jeremy Dunck wrote: > On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote: > ... > > return render_to_response('lab/user.html', data) > > Yeah, that's your problem right there. > : > ... I imagine this bites a lot of people on the ass. :( Add me to the list of ass-bitten and extremely frust

Re: How to know what went wrong with the .save()

2007-07-03 Thread RajeshD
Hi Ana, > > [views.py] > level=Level() > level.level_name=form.clean_data.get('level_Name') > level.instrument_name=form.clean_data.get('instrument_Name') > level.available=form.clean_data.get('available') > level.tablename=form.clean_data.get('tabelname') > > level.save()

Re: Form isn't appearing properly in template

2007-07-03 Thread RajeshD
Hi, > I was basing my template off > of:http://www.djangoproject.com/documentation/0.95/forms/ You should definitely move to the newforms framework with either the 0.96 release or the SVN trunk. See the newforms docs here: http://www.djangoproject.com/documentation/newforms/ -Rajesh --~--~-

When to use Admin Forms and/or Generic Views and/or New Forms ?

2007-07-03 Thread Vizcayno
Hello: I know that Django provides 3 ways in using Web forms: Admin Forms, Generic views and New Forms where Admin forms is the easiest one to use. What I would like to know is: 1) Which determinant aspects should force me to use Generic Views instead of Admin Forms? And 2) Which determinant aspec

Generic Relations + Admin Interface

2007-07-03 Thread David
I was really excited about Rails. But however much it claims that it follows the DRY convention, I unfortunately do find myself repeating myself for things like the admin area of my site. That's why the Admin interface of Django has now become ever so much more appealing to me. Having spent a who

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-07-03 Thread JHeasly
> Ah, ok. Yeah, this has been broken a long while. Well, I guess that's a good reason for it not to work! : ) > The comments contrib needs some love, but I understand Jacob's working > on a rewrite Good deal! I look forward to it. > But you're in luck; I recently ported from an old version of

Trying to use many-to-many to emulate a one-to-one field

2007-07-03 Thread Charles Wesley
Hi, Since I can't (as far as I can tell) enable inline editing on a one-to- one field, I'm trying to use an inline-edited many-to-many field with a related object maximum of 1. Trivial example: class Trivial(models.Model): name = models.CharField(maxlength=50) class Admin: pass

Extending the User class - AUTH_PROFILE_MODULE

2007-07-03 Thread rycole
Hey guys, I'm trying to extend the User class to add some additional information to user's profiles. I've been reading http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model for some information, but I don't think the blog post really explains how to get it fully working. What I'

Re: Generic Relations + Admin Interface

2007-07-03 Thread Wiley
I posted about the exact same issue a couple days ago and someone suggested using the js attribute of the admin class. Unfortunately as a novice programmer this is going to take me a while to navigate so I've moved on to other areas of my application before I get down into it. I'm watching this

Re: Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-03 Thread Graham Dumpleton
Correct. The whole problem is effectively the result of a race condition on setting os.environ the first time just before Django settings file is imported. Normally the requests should be getting handled in the same Python subinterpreter though and thus os.environ would be different for each subin

Random string template tag

2007-07-03 Thread Bryan Veloso
I don't know if this exists or not, but I'd like to insert a tag (much like cycle) that allows the random selection of a string. I'm trying to randomly assign a class to a to simulate "random image rotator" type functionality. Something like... Any ideas? --~--~-~--~~

Re: Random string template tag

2007-07-03 Thread Tim Chase
> I don't know if this exists or not, but I'd like to insert a tag (much > like cycle) that allows the random selection of a string. I'm trying > to randomly assign a class to a to simulate "random image > rotator" type functionality. Something like... > > Sounds like you want to make a custo

Re: Basic Form Question - Radio Option Values

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, Blaine Garrett <[EMAIL PROTECTED]> wrote: > > The very last line is the one that doesn't work. Says > BookmarkSubmitForm is not defined. This makes sense, but I have no > idea how idea to assign this. I tried self which is undefined, etc. 'self' won't be defined until there is an insta

Re: When to use Admin Forms and/or Generic Views and/or New Forms ?

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, Vizcayno <[EMAIL PROTECTED]> wrote: > > Hello: > I know that Django provides 3 ways in using Web forms: Admin Forms, > Generic views and New Forms where Admin forms is the easiest one to > use. > What I would like to know is: > 1) Which determinant aspects should force me to use Generic

MultiWidget, DateField and form.is_valid() problem

2007-07-03 Thread xgdlm
Hello all, I have a trouble with newforms lib and MultiWidget. I created a custom MultiWidget based on SplitDateTimeWidget. The problem is that when I run the form.is_valid() The value send to the DateField clean method is a list ['1', '1', '2000']. Then the strptime command in this function fai

Re: Random string template tag

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, Bryan Veloso <[EMAIL PROTECTED]> wrote: > > I don't know if this exists or not, but I'd like to insert a tag (much > like cycle) that allows the random selection of a string. I'm trying > to randomly assign a class to a to simulate "random image > rotator" type functionality. Something

Re: Random string template tag

2007-07-03 Thread Bryan Veloso
> One option is to use the 'random' filter; your context would need to > define the list of possible strings: > > Context({ >'classes': ['class1','class2','class3','class4'] > > }) > > but then your template could use: > > {{ classes|random }} Can you serve Context to the base template? I tho

Re: Generic Relations + Admin Interface

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, David <[EMAIL PROTECTED]> wrote: > > Please let me stress that that isn't the full implementation (if you > want me to go into further detail, please let me know). Basically, I > want to be able to assign many different objects (of different model > types) to an Article. I need to be a

Re: Form isn't appearing properly in template

2007-07-03 Thread Malcolm Tredinnick
On Tue, 2007-07-03 at 15:21 +, Rishtastic wrote: > Hi, I'm a django newb and I am trying to make an upload form. > > my view is: > > 11 def newupload(request): > 12 manipulator = PFile.AddManipulator() > 13 username = request.user.username > 14 u = User.object

Re: Random string template tag

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, Bryan Veloso <[EMAIL PROTECTED]> wrote: > > > {{ classes|random }} > > Can you serve Context to the base template? > I thought of that earlier, but I couldn't think of how to give it > Context. What do you mean? You pass a context to the template renderer; if the template you render re

Re: Random string template tag

2007-07-03 Thread Bryan Veloso
> If you want to hardcode the availability of the 'classes' variable in > every context (so you don't have to remember to define it every time), > you could write a context processor. See > django.core.context_processors for examples. That's probably what I'll need since it'll always have to be t

Refreshing dirty objects

2007-07-03 Thread Lars
Hello! I'm using the "nested set" abstraction to store some tree data in a Django model. So the model class looks like class TreeNode(models.Model): value = models.CharField(maxlength=10) leftVisit = models.IntegerField(primary_key=True) rightVisit = models.IntegerField(db_index=True

Re: Refreshing dirty objects

2007-07-03 Thread Malcolm Tredinnick
On Wed, 2007-07-04 at 05:29 +, Lars wrote: > Hello! > > I'm using the "nested set" abstraction to store some tree data in a > Django model. So the model class looks like [...] > This all works fine, but, in this abstraction, an insert into the tree > updates everything to the "right" of it. T

Re: Refreshing dirty objects

2007-07-03 Thread Lars
Hi Malcolm, On Jul 4, 3:39 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > In the general case, this would be very hard to solve, because you could > have objects in a different process space that also need to be notified. Ah, I hadn't thought of that. > If you are satisfied with only updat

Re: MultiWidget, DateField and form.is_valid() problem

2007-07-03 Thread xgdlm
On 4 juil, 04:45, xgdlm <[EMAIL PROTECTED]> wrote: > Is there someting special to do before "cleaning" the form with > MultiWidget based fields ? The answer is ... ... implementing a custom value_from_datadict method for the class DropDownDateWidget(MultiWidget) xav --~--~-~--~~---