Free Comments problem...

2008-07-02 Thread [EMAIL PROTECTED]
I'm trying to use Free Comments, but coming up against a problem displaying the form. I've followed the tutorial at djangoproject.com (http://code.djangoproject.com/wiki/UsingFreeComment) So I've done these things: - amended my urls.py to include: (r'^comments/', include('django.contrib.comment

Re: Tutorial method was_published_today() - problem

2008-07-02 Thread Collin Grady
You can use tabs, but you have to /always/ use tabs if you do so - you can't mix tabs and spaces, or you hit issues like this :) Especially if your editor is showing tabs as four spaces, since python would use eight. --~--~-~--~~~---~--~~ You received this message

Re: Client testing with custom http request referrer

2008-07-02 Thread Collin Grady
Please do not re-post your question - you already submitted this 7 hours before you posted this one, so you should just wait for replies to that :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Admin functionality: someadmin.articles.models.article_genre'> instance needs to have a primary key value before a many-to-many relationship can be used.

2008-07-02 Thread [EMAIL PROTECTED]
Hi all, I am using django admin to show my tables. I used ManyToMany field, and facing this error. instance needs to have a primary key value before a many-to-many relationship can be used. Actually I am trying to create new record of article which has many to many field to article

forms + UI question

2008-07-02 Thread pihentagy
Hi! I have an auction site, the items appear in more views (and there are more items in a view), and I would like to allow users to bid on every view. I have done it somehow, but I think that solution is not pretty (I mean the code quality). I would like to use the same newforms form on every vie

Re: testing login problem

2008-07-02 Thread laspal
Hi, I have created initial_data.xml using dumpdata and """manage.py loaddata initial_data.xml""" gives me no error. but still I am not able to login using setUp().. and this is essential as all my views functions required login.. here is my test file: import unittest from django.test import

Re: url views problem

2008-07-02 Thread sebey
wonderful!! its works thank you!!! On Jul 1, 3:27 pm, sebey <[EMAIL PROTECTED]> wrote: > cool sorry i will try that out sorry for replying so late but I will > post what the results are > > thanks again > > On Jun 26, 9:23 pm, "Emil Styrke" <[EMAIL PROTECTED]> wrote: > > > This line: > > >    que

Re: i18n model - tri-lingual data

2008-07-02 Thread Nebojša Đorđević
On 26 Jun 2008, at 15:22, pihentagy wrote: > Is there a way I can tell the model about the request's language? Or, > well, I know it is a violation of MVC, but how to solve this problem? from django.utils.translation import get_language lang = get_language() -- Nebojša Đorđević - nesh, Studio

Re: i18n model - tri-lingual data

2008-07-02 Thread KONTRA, Gergely
Many thanks! Will make my views and templates definitely shorter. On Wed, Jul 2, 2008 at 12:01 PM, Nebojša Đorđević <[EMAIL PROTECTED]> wrote: > On 26 Jun 2008, at 15:22, pihentagy wrote: >> Is there a way I can tell the model about the request's language? Or, >> well, I know it is a violation of

Re: Strange display of date

2008-07-02 Thread Evert
> Anyone? > > On Jun 27, 9:38 am,gumbah<[EMAIL PROTECTED]> wrote: > > > Hi all, > > > does anyone know what i am doing wrong when i see adatelooking like > > this in the "change history" part of the admin app: > > > FriAMCDTE_261CDT02_CDT1JunE_June1218655750TrueTrue > > > I see this throughout the

django+mod_python, caching or something else?

2008-07-02 Thread Mario
Hi, all! I have a some little project that consists news list, several text blocks and else All worked... But after adding, for example news, it not publish on main page while apache restart(reload). This problem haven't regularity. model.py: class News(models.Model): title = models.CharField

Can't pickle error from development version (7825)

2008-07-02 Thread Tipan
Whilst setting up a new machine for development I took down the latest development version of Django (7825). I am now experiencing a Pickle error when running my existing application which has been working fine on our production servers for a few months. The error occurs when using the Cache.set f

Re: Can't pickle error from development version (7825)

2008-07-02 Thread Malcolm Tredinnick
On Wed, 2008-07-02 at 04:47 -0700, Tipan wrote: > Whilst setting up a new machine for development I took down the latest > development version of Django (7825). I am now experiencing a Pickle > error when running my existing application which has been working fine > on our production servers for

Re: django+mod_python, caching or something else?

2008-07-02 Thread Alex Koshelev
Client-side caching. Use the `never_cache` decorator On Jul 2, 3:43 pm, Mario <[EMAIL PROTECTED]> wrote: > Hi, all! > I have a some little project that consists news list, several text > blocks and else > All worked... But after adding, for example news, it not publish on > main page while apache

Using SQLite in production

2008-07-02 Thread David Marko
I'm just considering using SQLite in small Django project(in production environment). I have no fear about performance but what troubles me is whether SQLite can be used in environment like Apache +mod_wsgi ? As SQLite is file based database, isn't there concurrency problem? Can someone explain?

Re: django+mod_python, caching or something else?

2008-07-02 Thread James Bennett
On Wed, Jul 2, 2008 at 7:09 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Client-side caching. Use the `never_cache` decorator No, that's not it at all. > On Jul 2, 3:43 pm, Mario <[EMAIL PROTECTED]> wrote: >> I look at sql log - django didn't query that, but always query lists, >> for example:

http://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser

2008-07-02 Thread chefsmart
With new commits, I guess this has become a little outdated. Or am I wrong? Is there some new code required to achieve this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Make changes to model...

2008-07-02 Thread mccomas . chris
Hello all, I'm using MySQL with Django, I setup my models and installed everything, got into the admin panel and realized I left a field out. I went back into my models file, added it, and it gives me an error because while I guess the code realized it's there, that field wasn't created in MySQL.

Re: Make changes to model...

2008-07-02 Thread Oscar Carlsson
Unless you use django-evolution (http://code.google.com/p/django-evolution/, which I don't know much about) you have to make these changes yourself, but usually it isn't that hard. There is information on how to make these changes in the django book, chapter 5: http://djangobook.com/en/1.0/chapter

Re: Can't pickle error from development version (7825)

2008-07-02 Thread Tipan
Hi Malcolm, I've been back through as you suggested and can trace the problem to revision 7477 which is merging of the Queryset refactor branch into the trunk. Version 7476 works fine with our application. I'll have a play with my view code to see if I can see exactly what is causing the problem

Re: django+mod_python, caching or something else?

2008-07-02 Thread Alex Koshelev
Of course. But author don't write where he create context in some view function or in module scope. On Jul 2, 4:42 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 2, 2008 at 7:09 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > Client-side caching. Use the `never_cache` decorator > >

Re: Tutorial method was_published_today() - problem

2008-07-02 Thread bruno desthuilliers
On 2 juil, 09:48, Collin Grady <[EMAIL PROTECTED]> wrote: > You can use tabs, You can, but *don't*. Use spaces. 4 spaces. Always. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: django+mod_python, caching or something else?

2008-07-02 Thread Mario
I understand. Global context = {} was bad solution... views,py: context = { 'hot_news': News.objects.filter(hot=True).order_by('-created')[0], 'last_radio_message': VisualRadio.objects.all().order_by('- created')[0], 'last_totals': Totals.objects.all().order_by('-created')[0], 'las

Re: django+mod_python, caching or something else?

2008-07-02 Thread Alex Koshelev
Brrr... Try to use context processors http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext On Jul 2, 5:43 pm, Mario <[EMAIL PROTECTED]> wrote: > I understand. Global context = {} was bad solution... > views,py: > context = { >     'hot_news': News.object

Re: django+mod_python, caching or something else?

2008-07-02 Thread Alex Koshelev
Or may be a custom template tag for common stuff. On Jul 2, 5:59 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Brrr... Try to use context > processorshttp://www.djangoproject.com/documentation/templates_python/#subclass... > > On Jul 2, 5:43 pm, Mario <[EMAIL PROTECTED]> wrote: > > > I understa

Re: django+mod_python, caching or something else?

2008-07-02 Thread Norman Harman
Alex Koshelev wrote: > Or may be a custom template tag for common stuff. Or like any code anywhere just extract the common parts to a helper function and call that. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: testing login problem

2008-07-02 Thread Norman Harman
laspal wrote: > Hi, > I have created initial_data.xml using dumpdata and > """manage.py loaddata initial_data.xml""" gives me no error. > but still I am not able to login using setUp().. and this is > essential as all my views functions required login.. > > here is my test file: > > import un

Re: Make changes to model...

2008-07-02 Thread TiNo
You can use the output of "python manage.py sql myapp" to see what the sql ought to be and compare it with the curent state. On 7/2/08, Oscar Carlsson <[EMAIL PROTECTED]> wrote: > > Unless you use django-evolution ( > http://code.google.com/p/django-evolution/ , which I don't know much > about) yo

Re: Free Comments problem...

2008-07-02 Thread Karen Tracey
On Wed, Jul 2, 2008 at 3:33 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > I'm trying to use Free Comments, but coming up against a problem > displaying the form. I've followed the tutorial at djangoproject.com > (http://code.djangoproject.com/wiki/UsingFreeComment) > > So I've done these t

Re: Admin functionality: someadmin.articles.models.article_genre'> instance needs to have a primary key value before a many-to-many relationship can be used.

2008-07-02 Thread Karen Tracey
On Wed, Jul 2, 2008 at 4:01 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all, > I am using django admin to show my tables. > I used ManyToMany field, and facing this error. > > instance needs to > have a primary key value before a many-to-many relationship can be > used. > >

Re: CharField as text?

2008-07-02 Thread Stuart Grimshaw
On Jul 1, 9:41 pm, Brian Luft <[EMAIL PROTECTED]> wrote: > What is your purpose in defining a form field if it won't be used for > user input? I wanted to try and kee things simple (and look where that got me). I have a list of players, and want to display them, with checkboxes next to the names

Form serialization

2008-07-02 Thread Alexander Pugachev
Hi. Is there way to store bounded form for later use? For example to put into session, then show it at another way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send em

Multiple instances of same form: how to only saved the filled in ones?

2008-07-02 Thread Berco Beute
I have multiple instances of same the form (of which all fields are optional), but I only want to save the form in case something is filled in. How can I test that in my view? 2B --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Multiple instances of same form: how to only saved the filled in ones?

2008-07-02 Thread Malcolm Tredinnick
On Wed, 2008-07-02 at 07:58 -0700, Berco Beute wrote: > I have multiple instances of same the form (of which all fields are > optional), but I only want to save the form in case something is > filled in. How can I test that in my view? After checking that the form is valid (which means each fiel

Re: Using SQLite in production

2008-07-02 Thread Brian Luft
I don't have any firsthand experience to share with running sqlite in a production setting. I did choose to spend about 30 seconds scanning the sqlite FAQ: http://www.sqlite.org/faq.html#q5 http://www.sqlite.org/faq.html#q6 If what sqlite is saying on their FAQ is true, it sounds you can get aw

URL pre-processing middleware

2008-07-02 Thread David Christiansen
Hi everyone, I'm in the process of using Django to develop a CMS for our Web site, and one thing that I'd like to do is to find a way to maintain compatibility with the old URLs on the site. These old URLs are, however, somewhat crufty. In particular, I'd like to be able to do the following to UR

Re: Free Comments problem...

2008-07-02 Thread [EMAIL PROTECTED]
Yeah, so in the parent template (base.html) I've specified the usual {% block content %} and in the child template, the call to the form is well within the corresponding block tags. I've checked syntax about a million times too, to make sure there's no syntax error - it's a pretty simple project,

How do I get the value of a disabled Select widget?

2008-07-02 Thread Huuuze
I use the following code to disable a ModelForm field in a custom __init__: self.fields['state'] = USStateField(widget=widgets.Select({'class':'disabled', 'disabled':'', 'tabindex':'-1',}, choices=STATE_CHOICES), required=False) Unfortunately, this presents a problem. When I post the form with

Re: Free Comments problem...

2008-07-02 Thread Karen Tracey
On Wed, Jul 2, 2008 at 11:14 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > Yeah, so in the parent template (base.html) I've specified the usual > {% block content %} and in the child template, the call to the form is > well within the corresponding block tags. I've checked syntax about a >

Re: How do I get the value of a disabled Select widget?

2008-07-02 Thread Huuuze
I figured out the puzzle: self.fields['state'] = forms.CharField(required=False, widget=forms.HiddenInput(), initial=self.instance.state) Still open to feedback since I'm new to Django. On Jul 2, 11:19 am, Huuuze <[EMAIL PROTECTED]> wrote: > I use the following code to disable a ModelForm fiel

Re: Overriding the JOIN type in contrib.admin's search forms?

2008-07-02 Thread Paul Winkler
Followup: This bug is fully fixed on the newforms_admin branch. Thanks for the help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegro

Re: Multiple instances of same form: how to only saved the filled in ones?

2008-07-02 Thread Berco Beute
is_empty() was indeed what I was looking for. :) For the time being I got it working using any(form.cleaned_data.values()) Thanks for your great help! 2B On Jul 2, 5:02 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-07-02 at 07:58 -0700, Berco Beute wrote: > > I have multiple i

Greater than Less than

2008-07-02 Thread mike171562
hello, I am working on a web app that pulls call logs from a database and displays them. I am working with the greater than and less than functions to filter out phone numbers less than 7 digits long i.e. internal extensions. When I use something like call.filter(number__gte=7) however, i

Re: Greater than Less than

2008-07-02 Thread Scott Moonen
Mike, you might try this: call.filter(number__regex = r'^.{7,}') That uses a regular expression that matches strings of length 7 characters or more. -- Scott On Wed, Jul 2, 2008 at 11:59 AM, mike171562 <[EMAIL PROTECTED]> wrote: > > hello, >I am working on a web app that pulls call l

Re: Free Comments problem...

2008-07-02 Thread [EMAIL PROTECTED]
: ) absolutely! It's in an entry template. I've tried the same thing in other templates as well (a gallery page, a photo page...) and the same. I don't get any error messages at all. The page loads fine. If I change the syntax of the {% free_comment_form ... %}, for example by introducing a spell

Re: Greater than Less than

2008-07-02 Thread mike171562
Scott, Thanks, I'm already using long_distance = call.exclude(number__iregex=r'^1?(281|832|713|800)') to filter long distance numbers so, the new regex would be something like iregex=r'^1?(281|832|713|800)^.{7,}') does that look right? On Jul 2, 11:04 am, "Scott Moonen" <[EMAIL PROTECTED]> wr

Re: Greater than Less than

2008-07-02 Thread mike171562
hey Scott, that worked perfectly thanks On Jul 2, 11:16 am, mike171562 <[EMAIL PROTECTED]> wrote: > Scott, > > Thanks, I'm already using long_distance = > call.exclude(number__iregex=r'^1?(281|832|713|800)') > to filter long distance numbers so, the new regex would be > > something like iregex=r'

Re: Greater than Less than

2008-07-02 Thread Scott Moonen
Aah, ok. I think this might work: exclude(number_iregex = r'^(1?(281|832|713|800).*|.{,6})$') That excludes anything that matches your existing pattern or which is exactly six characters or less. Please be sure to test it though as this is off the cuff. :) -- Scott On Wed, Jul 2, 2008 at 12

Using WingIDE's shell instead of manage.py shell

2008-07-02 Thread Fernando Rodríguez
Hi, I'd like to use WingIDE's own python shell with django, instead of the terminal you get with manage.py shell. However, if I try to eval a file form within Wing, I get this error: Traceback (most recent call last): File "/home/fernando/", line 1, in File "/var/lib/python-support/python2

Trouble activating the admin interface

2008-07-02 Thread Fernando Rodríguez
Hi, I'm learning django with "the definitve guide to django". On chapter 6, I tried to activate the admin interface fro the "books" app, by adding django.contrib.admin to the INSTALLED_APPS and then calling manage.py syncdb. It failed with the following error: --

ImageField error

2008-07-02 Thread Molly
I added ImageField to my models like this: photo = models.ImageField("Photograph", upload_to='media/images', blank=True,null=True) I "import Image" in my impo

Accessing URL Parameters in Django Templates

2008-07-02 Thread Sameer Maggon
Hi All, Is there a standard way to access the URL parameters in the Django templates? I can write a template tag to do that, but I was hoping I could avoid it. Thanks, Sameer. -- http://www.maggon.com --~--~-~--~~~---~--~~ You received this message because you ar

Re: Accessing URL Parameters in Django Templates

2008-07-02 Thread Scott Moonen
Sameer, if you are using the RequestContext object to produce the template context, then you should be able to access the URL parameters in your template as request.GET.*parametername*. In this case, request.GET is a QueryDict object (see http://www.djangoproject.com/documentation/request_response

Re: Trouble activating the admin interface

2008-07-02 Thread Brian Luft
Do you have 'django.contrib.auth' and 'django.contrib.contenttypes' in your INSTALLED_APPS setting? On Jul 2, 10:20 am, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > Hi, > > I'm learning django with "the definitve guide to django". On chapter 6, > I tried to activate the admin interface fro the

Re: Trouble activating the admin interface

2008-07-02 Thread Richard Dahl
Also ensure that you have imported those models into your apps models.py from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType os some such import statement should be at the top of your models.py -richard On 7/2/08, Brian Luft <[EMAIL PROTECTED]>

deleting a session

2008-07-02 Thread Bobby Roberts
i can't find a way to delete session data (other than user removing their cookie perhaps?) in the django docs. Is there an easy way to do this like in ASP? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread John Boxall
Hey everyone - I'm running into a bit of a problem with NFA. I would like to override the save method of an inline model. For example - I have a Poll which many Options. In the admin panel I would be able to edit the Options while editing the Poll so I declare the Poll to have the Options as an

Re: Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread Brian Rosner
On Jul 2, 2008, at 12:22 PM, John Boxall wrote: > class OptionModelForm(forms.ModelForm): > > class Meta: > model = Option > > def save(self, commit=True): > # Will -NEVER- run > assert False > > def clean(self): > # Will

Re: Make changes to model...

2008-07-02 Thread mccomas . chris
Thanks guys. I know how to do it via the admin, wasn't sure if I was "missing" something within Django to handle it :) Kind of off topic, but say myapp is named myapp, then in the heading the admin will be displayed Myapp with the model items below it. Other than customizing the admin template is

Re: deleting a session

2008-07-02 Thread Juanjo Conti
You mean in the views? del request.session['somedata'] 2008/7/2 Bobby Roberts <[EMAIL PROTECTED]>: > > i can't find a way to delete session data (other than user removing > their cookie perhaps?) in the django docs. Is there an easy way to do > this like in ASP? > > > -- Juanjo Conti --~--

Re: deleting a session

2008-07-02 Thread Bobby Roberts
> On Jul 2, 2:50 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: > You mean in the views? > > del request.session['somedata'] Well If i have 15 session variables I don't want to have to do it for each variable. Is there something like del request.session.sessionid or something that will kill all s

Re: Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread Richard Dahl
You may be able to do what you want to by overriding the save() function within the model. If you need any information from the form or related object you could pass them as kwargs to save. http://www.djangoproject.com/documentation/model-api/ -richard On 7/2/08, Brian Rosner <[EMAIL PROTECTED]>

Re: deleting a session

2008-07-02 Thread Juanjo Conti
I am just guessing, but try: request.session.clear() 2008/7/2 Bobby Roberts <[EMAIL PROTECTED]>: > >> On Jul 2, 2:50 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: >> You mean in the views? >> >> del request.session['somedata'] > > Well If i have 15 session variables I don't want to have to do it

Adding groups to groups

2008-07-02 Thread Dan Lazewatsky
Is there any way to add a group to another group, similarly to how you would add a user to a group. For example, let's say I have four groups: Undergraduates, Grad Students, Faculty and Staff, and there are a bunch of permissions that will always be the same for Undergraduates and Grad Student

Re: Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread John Boxall
Hey Brian - I wasn't sure that the fact that it was inline would have an effect - I see now that it does - sorry for the incomplete first post. I just found it odd that what I was doing worked for ``clean`` but not ``save``. I'll look into Formsets. Richard - I'm sure I could do it that way - but

Flatpages and base template translations

2008-07-02 Thread shadfc
Let me preface that this is not a question about translating flatpage content. I have a project created in english and I've had someone create Romanian translations for the necessary strings. Most of these are just menu text, titles, etc -- all of the actual content on the site will be created b

Re: Accessing URL Parameters in Django Templates

2008-07-02 Thread Sameer Maggon
That worked! Thanks, Sameer On Jul 2, 10:57 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Sameer, if you are using the RequestContext object to produce the template > context, then you should be able to access the URL parameters in your > template as request.GET.*parametername*.  In this case,

ManyToManyField in Admin list_display

2008-07-02 Thread urukay
Hi, right now I'm working on one model and it looks like this class Area(models.Model): region = models.CharField(max_length = 2, choices = SLOVAK_REGION_CHOICES, radio_admin = True, db_index = True, blank = True, null = True) city = models.CharField(max_length = 4, choi

Re: ManyToManyField in Admin list_display

2008-07-02 Thread urukay
solved urukay wrote: > > Hi, > > right now I'm working on one model and it looks like this > > class Area(models.Model): > > region = models.CharField(max_length = 2, choices = > SLOVAK_REGION_CHOICES, radio_admin = True, db_index = True, blank = True, > null = True) >

Re: Adding groups to groups

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 2:23 PM, Dan Lazewatsky <[EMAIL PROTECTED]> wrote: > > Is there any way to add a group to another group, similarly to how you > would add a user to a group. For example, let's say I have four groups: > Undergraduates, Grad Students, Faculty and Staff, and there are a bunch >

Re: testing login problem

2008-07-02 Thread [EMAIL PROTECTED]
You can check my dump of manage.py test (ran as root) here; http://dpaste.com/60433/ As you can see the fixture load runs OK... and I even got a couple of errors on the load process! That sure confirms the fixtures load ;-) Tests run fine though. On Jul 2, 4:14 pm, "Norman Harman" <[EMAIL PROTEC

choices

2008-07-02 Thread urukay
is there a way how to create choices in Models in specific way, that some choices are not selectable (they only group and describe choices below)? e.g.: CHOICES = ( ('0', 'Basic Colors'), ('1', 'Red'), ('2', 'Green'), ('3', 'Blue'), ('4', 'Other Colors'), ('5', 'Br

Re: ImageField error

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 12:21 PM, Molly <[EMAIL PROTECTED]> wrote: > > I added ImageField to my models like this: > > > photo = models.ImageField("Photograph", upload_to='media/images', > blank=True,null=True) > ==

Re: Using WingIDE's shell instead of manage.py shell

2008-07-02 Thread Milan Andric
On Wed, Jul 2, 2008 at 11:30 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > Hi, > > I'd like to use WingIDE's own python shell with django, instead of the > terminal you get with manage.py shell. > > However, if I try to eval a file form within Wing, I get this error: > > Traceback (most re

Re: deleting a session

2008-07-02 Thread J. Cliff Dyer
On Wed, 2008-07-02 at 11:52 -0700, Bobby Roberts wrote: > > On Jul 2, 2:50 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: > > You mean in the views? > > > > del request.session['somedata'] > > Well If i have 15 session variables I don't want to have to do it for > each variable. > for key in req

Fwd: Re: Inputting Date/Time in a Django Form

2008-07-02 Thread Tim Sawyer
Sorry, I don't understand where I have to put the attrs bit. Can you give me an example? delivery_datetime = forms.SplitDateTimeField(attrs={'class':'vDateField'}) doesn't work, is that what you meant? Thanks, Tim. On Sunday 29 Jun 2008, TiNo wrote: > add: > > > > > > type="text/javascript

Re: Re: Inputting Date/Time in a Django Form

2008-07-02 Thread TiNo
Sorry, I was a little too quick. I used it like this: date = forms.DateField(label=_("Date"),widget=forms.DateTimeInput(attrs={'class':'vDateField'})) I am not sure on how to do this on a SplitDateTimeField though. On Wed, Jul 2, 2008 at 10:52 PM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > Sorry,

Re: Inputting Date/Time in a Django Form

2008-07-02 Thread Tim Sawyer
Thanks. I've got the class in the html but not the buttons for the date or time popup. I also have two date popups and I think I should have one that has the class vTimeField not vDateField. collection_datetime = forms.SplitDateTimeField(widget=forms.SplitDateTimeWidget({'class':'vDateField

Re: Regex

2008-07-02 Thread Ross Dakin
> If you have the ability to change your Call model, you should consider > adding a new BooleanField called "is_long_distance" to Call. Then, you > only have to compute it (in Call.save()) when you save or change a > number. That will make your query very simple and efficient. > > -Rajesh D I wou

Re: Inputting Date/Time in a Django Form

2008-07-02 Thread TiNo
Have a look at the source (widgets.py in newforms): class SplitDateTimeWidget(MultiWidget): """ A Widget that splits datetime input into two boxes. """ def __init__(self, attrs=None): widgets = (TextInput(attrs=attrs), TextInput(attrs=attrs)) super(SplitDateTimeWidg

Re: Regex

2008-07-02 Thread Rajesh Dhawan
Hi Ross, > I would disagree here. The database should only be used to store raw > data; the database should not know anything about this data (the > database should not be "smart"). > > Determining whether or not a number qualifies as "long distance" is a > job for the domain / controller / view

filling in AutoField

2008-07-02 Thread Grzegorz Dostatni
I'm writing a django application (postgresql db) that needs to deal with input both from GUI (webserver) and commandline (parsing text input). I've got a model defined where I explicitly define the id field using: id = models.AutoField(primary_key = True) When I'm creating a new entry, is th

Re: Regex

2008-07-02 Thread Ross Dakin
Followup to clarify. If you DON'T use a is_longdistance flag in the model, then you use a set of rules to determine if a number is long distance when you get the number out of the db. You can avoid this by using a is_longdistance flag in the model, but you're going to have to do the same thing t

Re: Regex

2008-07-02 Thread Ross Dakin
Hi Rajesh, Certainly, best practices are subject to your goals: code maintainability, storage efficiency, execution efficiency, etc. I agree, there are times when it makes sense to store calculated values in a database. I would argue, however, that this inhibits scalability. As a system grows, t

Re: Inputting Date/Time in a Django Form

2008-07-02 Thread Tim Sawyer
Sorry, still not working. I get: __init__() got an unexpected keyword argument 'widgets' Is that because widgets isn't a parameter to __init__ ? (I'm still getting to grips with python, it's so much more expressive than the Java I'm used to!) My code is: collection_datetime = forms.SplitDat

Re: Regex

2008-07-02 Thread John Boxall
You might want to refer to this recent article at Coding Horror: http://www.codinghorror.com/blog/archives/001016.html I would stick to what you have. (and I would also only do the calculation once and store it as a boolean field in the database as suggested : ) John On Jun 30, 7:13 am, mike17

Re: Regex

2008-07-02 Thread Rajesh Dhawan
On Jul 2, 5:33 pm, Ross Dakin <[EMAIL PROTECTED]> wrote: > Followup to clarify. > > If you DON'T use a is_longdistance flag in the model, then you use a > set of rules to determine if a number is long distance when you get > the number out of the db. Sure. Now what if the set of rules you need

Re: Free Comments problem...

2008-07-02 Thread Milan Andric
Can you paste your template at http://dpaste.com so we can have a look? On Wed, Jul 2, 2008 at 11:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > : ) absolutely! It's in an entry template. I've tried the same thing > in other templates as well (a gallery page, a photo page...) and the > s

Re: streaming upload

2008-07-02 Thread umrzyk
On 29 Cze, 22:15, umrzyk <[EMAIL PROTECTED]> wrote: > hi there, > i would like to give my users ability to upload a huge (i.e. 10-20 MB) > files, mostly images. standard uploading using django newforms and > FileField is at the moment not an option. it kills my > server immediately. recently i rea

Re: GeoDjango/GoogleMaps: No support for points/markers

2008-07-02 Thread tlpinney
Hi Ludwig, Can you create a ticket on the trac and attach the patch? Thanks, Travis On Jul 1, 4:05 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I  noticed that the automatic Google Map creation in the Django GIS > branch does not support the display of point features, only polylines

Re: Using SQLite in production

2008-07-02 Thread phillc
are you forced to use sqlite? http://www.sqlite.org/limits.html On Jul 2, 11:09 am, Brian Luft <[EMAIL PROTECTED]> wrote: > I don't have any firsthand experience to share with running sqlite in > a production setting.  I did choose to spend about 30 seconds scanning > the sqlite FAQ: > > http:/

Re: filling in AutoField

2008-07-02 Thread Rajesh Dhawan
Hi Greg, On Jul 2, 5:29 pm, "Grzegorz Dostatni" <[EMAIL PROTECTED]> wrote: > I'm writing a django application (postgresql db) that needs to deal with > input both from GUI (webserver) and commandline (parsing text input). > > I've got a model defined where I explicitly define the id field using:

Re: django+mod_python, caching or something else?

2008-07-02 Thread phillc
i was going to say state a question, but found my answer... for anyone else: http://www.djangoproject.com/documentation/db-api/#querysets-are-lazy On Jul 2, 10:09 am, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Alex Koshelev wrote: > > Or may be a custom template tag for common stuff. > > Or l

Re: choices

2008-07-02 Thread Rajesh Dhawan
On Jul 2, 4:40 pm, urukay <[EMAIL PROTECTED]> wrote: > is there a way how to create choices in Models in specific way, that some > choices are not selectable (they only group and describe choices below)? > > e.g.: > > CHOICES = ( >      ('0', 'Basic Colors'), >      ('1', 'Red'), >      ('2', 'G

Re: forms + UI question

2008-07-02 Thread phillc
look up context processors On Jul 2, 4:31 am, pihentagy <[EMAIL PROTECTED]> wrote: > Hi! > > I have an auction site, the items appear in more views (and there are > more items in a view), and I would like to allow users to bid on every > view. > I have done it somehow, but I think that solution i

Re: URL pre-processing middleware

2008-07-02 Thread Rajesh Dhawan
Hi, > > Is there somewhere I should be looking where I'm not? Some kind of > built in rewriter? Have you considered using Apache mod_rewrite instead of trying to solve this at the application layer? http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html Lighttpd and nginx also have simila

Re: testing login problem

2008-07-02 Thread Russell Keith-Magee
On Wed, Jul 2, 2008 at 10:14 PM, Norman Harman <[EMAIL PROTECTED]> wrote: > > Test system creates a new test database from scratch every time it is > run. manage.py loaddata has NO effect on test. > > I could be wrong but I don't believe test runner automatically loads the > fixture initial_data.

Re: Stability of trunk and 1.0 target: experience, testimonials?

2008-07-02 Thread J Meier
Thank you, everyone. That was exactly what I needed. It looks like we'll be starting a prototype on Django trunk targeting 1.0 this week. Jim Meier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group

Re: choices

2008-07-02 Thread urukay
thanks, but i was wondering if it's possible to do that in MODEL? Rajesh Dhawan wrote: > > > > > On Jul 2, 4:40 pm, urukay <[EMAIL PROTECTED]> wrote: >> is there a way how to create choices in Models in specific way, that some >> choices are not selectable (they only group and describe choic

Re: Make changes to model...

2008-07-02 Thread Malcolm Tredinnick
On Wed, 2008-07-02 at 11:49 -0700, [EMAIL PROTECTED] wrote: > Thanks guys. I know how to do it via the admin, wasn't sure if I was > "missing" something within Django to handle it :) > > Kind of off topic, but say myapp is named myapp, then in the heading > the admin will be displayed Myapp with

  1   2   >