Re: inlineformset_factory. how to get pk of parent model without saving.

2009-03-26 Thread igor.potapenko
btw, if I leave instance = None, I got an list index out of range here: http://dpaste.com/hold/19039/ full example. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: submit logins over SSL

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 17:54 +1100, Ryan Kelly wrote: > Hi All, > > > I'm trying to set things up so that my login form uses SSL to protect > the user's password in transit. Basically, the behaviour I'm after is > as follows: > >1) Unauthenticated user requests http://site/private/ >2

Re: Django / Postrges problem

2009-03-26 Thread Szymon
On 25 Mar, 21:15, Antoni Aloy wrote: > The obvious one: check your cron job .. Log your queries in postgres > to see which querie consumes more time, it should be the cron job one. I did it some time ago, and there are such entries: Mar 20 18:12:20 ns204293 postgres[27213]: [3-1] [27213]LOG: p

Re: Django / Postrges problem

2009-03-26 Thread Szymon
On 26 Mar, 08:17, Szymon wrote: > Mar 20 18:12:20 ns204293 postgres[27213]: [3-1] [27213]LOG:  process > 27213 acquired ExclusiveLock on tuple (21,19) of relation 197227 of > database 98304 after 42887.468 ms Ah, and such entries too: Mar 20 14:33:49 ns204293 postgres[7044]: [3-1] [7044]LOG: p

Re: Django / Postrges problem

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 00:17 -0700, Szymon wrote: > On 25 Mar, 21:15, Antoni Aloy wrote: > > The obvious one: check your cron job .. Log your queries in postgres > > to see which querie consumes more time, it should be the cron job one. > > I did it some time ago, and there are such entries: > >

Re: submit logins over SSL

2009-03-26 Thread Ayaz Ahmed Khan
On 26-Mar-09, at 11:54 AM, Ryan Kelly wrote: > I'm trying to set things up so that my login form uses SSL to > protect the user's password in transit. Basically, the behaviour > I'm after is as follows: > > 1) Unauthenticated user requests http://site/private/ > 2) They're redirected to http:

model design issue

2009-03-26 Thread lify
Hi, I have a model called Job and a model called Parameter. A Job will have several parameters so I have a foreign key in the Parameter class. In my admin I have included Parameter as inline object of Job so when I create a job, I can automatically create parameters for the job. Now I wan

Re: ManyToMany

2009-03-26 Thread Bro
Thanks a lot for your answer Russ Magee %-) --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send

Re: Django / Postrges problem

2009-03-26 Thread Szymon
I've added some syslog stuff to determine when cron job is done... and, it's strange. It seems that cron job is done after 5 seconds, but commits are done 3 minutes later. Mar 26 10:10:01 ns204293 python: Job started Mar 26 10:10:05 ns204293 python: Job done And then Mar 26 10:13:08 ns204293 po

Re: Strip empty lines in rendered templates?

2009-03-26 Thread darryl.hebbes
Or simply remove the return after the forloop statement. Like so. {% for entry in entries %}{{ entry.title }} {% endfor %} should give you Title 1 Title 1 Title 1 On Mar 15, 9:13 pm, Benjamin Buch wrote: > Hi, > > is there a way to tighten up the output that Django renders? > Especial

Re: submit logins over SSL

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 13:17 +0500, Ayaz Ahmed Khan wrote: [...] > I have used, in a project before, a *third-party* SSL Middleware[0] to > effectively achieve what you are after. I won't comment further, apart > from saying that it has worked a treat for my requirements. You may > peruse the sourc

Controlling html display of Charfield length on forms...(newforms?)

2009-03-26 Thread NoviceSortOf
It would seem natural that there would be a length or size parameter on something in forms and/or models Charfield to control the html display of the field length. ie. firstname = forms.CharField(max_length=20, size = 4) I've found this hack discussed to the fields.py [link below] but it dates

Re: model design issue

2009-03-26 Thread Oli Warner
The true relational way would be to have another Model called JobRunParameter with an FK on Parameter. It's getting a bit silly though and all these look-ups are going to be a pain later on. If Parameter is just a string key/value style thing, I might have simplified things a little and instead of

Re: Django / Postrges problem

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 02:17 -0700, Szymon wrote: > I've added some syslog stuff to determine when cron job is done... > and, it's strange. It seems that cron job is done after 5 seconds, but > commits are done 3 minutes later. > > Mar 26 10:10:01 ns204293 python: Job started > Mar 26 10:10:05 ns2

Re: Controlling html display of Charfield length on forms...(newforms?)

2009-03-26 Thread Ayaz Ahmed Khan
On 26-Mar-09, at 2:26 PM, NoviceSortOf wrote: > It would seem natural that there would be a length or size parameter > on something in forms and/or models Charfield to control the html > display of the field length. How a field in a form in Django is rendered is determined by the corresponding

IndexError (list index out of range) in admin when updating a regex char primary key

2009-03-26 Thread TeenSpirit83
I can't find nothing similar on this group! Can you please help me? I get this error trace in the django 1.0.2 admin when updating a char primary key in a regex field. Thank you in advance! Environment: Request Method: POST Request URL: http://localhost/admin/webamf/azienda/04573030659/ Django V

Re: Split Database Model for Replication: RW/RO

2009-03-26 Thread Brett Parker
On 24 Mar 12:21, Malcolm Tredinnick wrote: > > On Mon, 2009-03-23 at 12:05 -0700, seblb wrote: > > Hi - is it possible to configure Django so that the admin section > > pulls details for a read/write db account/server and the main sites > > access the db via read only details? > > This particula

Re: Split Database Model for Replication: RW/RO

2009-03-26 Thread Russell Keith-Magee
On Thu, Mar 26, 2009 at 8:08 PM, Brett Parker wrote: > Doesn't that mean sessions would be broken, though? Public website > without write access to the database -> no session data... Only if you are using the database to store session data. Django provides several session backends as alternative

Django installation

2009-03-26 Thread Phonethics
Coming from a PHP background, I am starting to dive into Django. Im using Ubuntu 8.10 and I didnt install Django via apt-get. I downloaded Django-1.1-beta-1.tar.gz Unzipped to /home/username/code/django sudo python setup.py install It has created /usr/lib/python2.5/site-packages/django 1. When

how to show the links to tell website visitor which location he is at in django?

2009-03-26 Thread xiaojay
sorry to the English I speak. I am not an native English speaker. suppose my sitemap is something like below; /home /home/products/ /home/products/1 /home/products/2 . . . /home/news/ /home/ne

Re: Django installation

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 3:56 AM, Phonethics wrote: > > Coming from a PHP background, I am starting to dive into Django. > Im using Ubuntu 8.10 and I didnt install Django via apt-get. > > I downloaded Django-1.1-beta-1.tar.gz > Unzipped to /home/username/code/django > sudo python setup.py install

Django and IIS 7

2009-03-26 Thread Sergey Petrov
I've blown my brains away, trying to make django work under IIS7 on Windows Server 2008. I've tried PyISAPIe. I've tried fastcgi module. I'm no guru of windows, not even a expirienced user, though. Google tells nothing about django on IIS7. So, I'm begging you — please, anyone, give me a hint

Template - Deleting last character in loop

2009-03-26 Thread Kless
I'm building a dinamic list of links, and I want that been separated by '|' character. Note that 'foo' is a list --- {% for i in foo %} {{ i }}| {% endfor %} --- The problem is that I wantn't that last separator (because there isn't another field). I tried the nex

Re: how to show the links to tell website visitor which location he is at in django?

2009-03-26 Thread Briel
What you are asking for is called breadcrumbs. You can search google for django + breadcrumbs to find stuff about it and what others have done. One way of doing it, is explained in this blog post, it's both simple and well explained. If this is the best way, i do not know, but at least it'll get y

Re: Django and IIS 7

2009-03-26 Thread Adi Sieker
Hi, On 26.03.2009, at 14:21, Sergey Petrov wrote: > > I've blown my brains away, trying to make django work under IIS7 on > Windows Server 2008. > > I've tried PyISAPIe. I've tried fastcgi module. > > I'm no guru of windows, not even a expirienced user, though. > > Google tells nothing about dja

Re: Template - Deleting last character in loop [Solved]

2009-03-26 Thread Kless
I just to solve it :) --- {% ifnotequal i foo|last %}|{% endifnotequal %} --- On 26 mar, 13:46, Kless wrote: > I'm building a dinamic list of links, and I want that been separated > by '|' character. > > Note that 'foo' is a list > --- > {% for i in foo %} >         {

Re: Template - Deleting last character in loop

2009-03-26 Thread Briel
You can add an if statement and check if {{ foo|lenght }} and {{ forloop.counter }} matches to find out when you have reached the end of the loop. ~Jakob On 26 Mar., 14:46, Kless wrote: > I'm building a dinamic list of links, and I want that been separated > by '|' character. > > Note that 'f

Testcase for model with FileField?

2009-03-26 Thread ejot
My model declaration is: class Media(models.Model): binary = models.FileField(upload_to=resolve_file_path) mimetype = models.CharField(max_length=64, editable=False) media_for = models.ForeignKey(Entry) Now if I in my testcase create an instance of Media, how/what do I assign to the '

Foreign keys in admin

2009-03-26 Thread Leonel Nunez
Hello : I have this model : class Rel(models.Model): n = models.ForeignKey(MASTER) r = models.ForeignKey(MASTER,null=True,related_name='child_set', blank=True) But in the admin gets too slow since this model tries to fill the SELECTs with all the posible values and the MASTE

Re: Template - Deleting last character in loop

2009-03-26 Thread Tim Chase
Kless wrote: > I'm building a dinamic list of links, and I want that been separated > by '|' character. > > Note that 'foo' is a list > --- > {% for i in foo %} > {{ i }}| > {% endfor %} > --- > The problem is that I wantn't that last separator (because there isn't >

Re: Foreign keys in admin

2009-03-26 Thread Thomas Guettler
Hi, google for raw_id_fields Leonel Nunez schrieb: > Hello : > > I have this model : > > class Rel(models.Model): > n = models.ForeignKey(MASTER) > r = models.ForeignKey(MASTER,null=True,related_name='child_set', > blank=True) > > > But in the admin gets too slow since this mod

Re: Foreign keys in admin

2009-03-26 Thread Leonel Nunez
> Hi, > > google for raw_id_fields > > That was faster !! Thank you very much Leonel --~--~-~--~~~---~--~~ 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@googl

Django Admin Question

2009-03-26 Thread Wiiboy
Hi, I've got a database of newsletter submissions from my users. Before using Django, I designed an Admin interface that listed the past 10 or so submissions that were still pending review by me, and asked for the ID of the one or ones that I wanted to accept or not accept. Is there a way to make

Re: Django Admin Question

2009-03-26 Thread Wiiboy
Sorry, I wasn't very clear. The Administration's purpose is to let me decide, from the submissions that are pending review, which ones I want to accept (change the value for the column 'status' to 'accepted' for that row) and which ones I want to not accept (change the value for the column 'statu

Re: Django and IIS 7

2009-03-26 Thread P M
IronPython is not CPython , i will be amazed if these two works identically ... On Thu, Mar 26, 2009 at 2:54 PM, Adi Sieker wrote: > > Hi, > > On 26.03.2009, at 14:21, Sergey Petrov wrote: > > > > > I've blown my brains away, trying to make django work under IIS7 on > > Windows Server 2008. > >

Re: Django Admin Question

2009-03-26 Thread Briel
You can use 'list_filter' in admin.py to add which filters you want to set. so if you have a status reviewed/await review you can use that. You can also use 'search_fields' if you want to do some searching. Lastly you can use 'ordering' as well if you prefer. I would sugest you try to play around

Re: Django and IIS 7

2009-03-26 Thread Lakshman Prasad
django working on Jython was a Google Summer of Code project. I am not aware of any project of porting django to work on IronPython. On Thu, Mar 26, 2009 at 8:02 PM, P M wrote: > IronPython is not CPython , i will be amazed if these two works > identically ... > > On Thu, Mar 26, 2009 at 2:54

dynamic url pattern

2009-03-26 Thread Alessandro Ronchi
I want to make a regxep in my urls.py that takes the name of the view from the url. Something like: (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), is it possible? I've a lot of views with the same rule and I want to make them be available without duplicate names 3 or 4 times. Thank

Re: need a multiselect list box for a static list of options

2009-03-26 Thread Adam Fraser
hrm, I think I'm _finally_ starting to understand how django is meant to be used. Question: Why can't I just specify the widget used by a particular field from my model in the admin interface. stains = models.CommaSeparatedIntegerField(widget=SelectMultiple (choices=STAIN_CHOICES)) ...or can I?

Re: Django and IIS 7

2009-03-26 Thread Alex Gaynor
On Thu, Mar 26, 2009 at 10:51 AM, Lakshman Prasad wrote: > django working on Jython was a Google Summer of Code project. > > I am not aware of any project of porting django to work on IronPython. > > On Thu, Mar 26, 2009 at 8:02 PM, P M wrote: > >> IronPython is not CPython , i will be amazed if

Issue with test cookies

2009-03-26 Thread Vokial
Hello I need to test if the user's browser accepts cookies or not.. and i realized i can't use set_test_cookie() : That problem happens in a site which has a poll, included as a little block, in the homepage. The user is able to vote directly from the homepage just by clicking on the "vote" button

Re: template tag for nested tables

2009-03-26 Thread Jesse
I was not aware of the __in option! However, I think the best option now that I've rethought this problem is to change my models. Thanks! On Mar 25, 6:21 pm, Malcolm Tredinnick wrote: > On Wed, 2009-03-25 at 09:46 -0700, Jesse wrote: > > One research project can have many publications.  One mo

Re: dynamic url pattern

2009-03-26 Thread Thomas Guettler
Alessandro Ronchi schrieb: > I want to make a regxep in my urls.py that takes the name of the view from > the url. > Something like: > > > (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), > > is it possible? I've a lot of views with the same rule and I want to make > them be availabl

Conditional Inline in admin interface

2009-03-26 Thread Marcos Marin
I have an app with three different kinds of users (staff, students and professors) and each of these have a unique profile model. I was recommended to use a proxy class to override get_profile() so that it will return the correct profile depending on the user's group and this seems to work. My

Django Cached Sessions Logout Login

2009-03-26 Thread Dave Fowler
I'm using memcached sessions and having an issue. When I log out of my site with one user it will not let me log in with another. I have to delete my cookies before I can log into the site with a different user. Anyone run into this? Ideas on fixing? Thanks. --~--~-~--~~--

DJango, threads and serial port

2009-03-26 Thread Filip Gruszczyński
I am trying to use connection to a serial device in my DJango app. It's a GSM modem I want to use to send sms's. If I just import my sms module, everything works fine. Module connects to modem, sets it to text format and then just allows me to send some sms's. But when I add to DJango, the initi

Re: need a multiselect list box for a static list of options

2009-03-26 Thread Brian Neal
On Mar 26, 9:59 am, Adam Fraser wrote: > hrm, I think I'm _finally_ starting to understand how django is meant > to be used. > > Question: Why can't I just specify the widget used by a particular > field from my model in the admin interface. > > stains = models.CommaSeparatedIntegerField(widget=S

Re: Conditional Inline in admin interface

2009-03-26 Thread Alex Gaynor
On Thu, Mar 26, 2009 at 11:11 AM, Marcos Marin wrote: > I have an app with three different kinds of users (staff, students > and professors) and each of these have a unique profile model. I was > recommended to use a proxy class to override get_profile() so that it will > return the correct profi

Re: dynamic url pattern

2009-03-26 Thread Alessandro
On Thu, Mar 26, 2009 at 4:21 PM, Thomas Guettler wrote: > # views.py (untested) > def wrapper(request, name): >module=__import__("myproject.database.reports.%s" % name, globals(), > locals(), [name]) >method=getattr(module, name) >return method(request) > this works: def wrapper(req

Re: DJango, threads and serial port

2009-03-26 Thread Baurzhan Ismagulov
Hello Filip, On Thu, Mar 26, 2009 at 04:35:19PM +0100, Filip Gruszczyński wrote: > If I just import my sms module, everything works fine. ... > But when I add to DJango, the initialisation fails. ... > for dirname in sys.path: > TypeError: 'NoneType' object is not iterable Hmm, sys.path is N

Re: DJango, threads and serial port

2009-03-26 Thread Filip Gruszczyński
> Hmm, sys.path is None? I'd use a debugger to see the difference between > the working and not working case. I don't exactly know, how to achieve this. Our server is run through a bash script with runfcgi command. Should I put somwhere pdb import and try to start inside the code? Strangely, whe

Re: Having trouble authenticating/validating

2009-03-26 Thread Adam Yee
On Mar 25, 6:27 pm, Karen Tracey wrote: > On Tue, Mar 24, 2009 at 2:11 PM, Adam Yee wrote: > > So, I now pass the bound form, but still no validation error messages > > show up.  More importantly, is_valid is still returning false even > > when I try logging in as a super user.  I also removed c

Re: dynamic url pattern

2009-03-26 Thread Tim Chase
Alessandro Ronchi wrote: > I want to make a regxep in my urls.py that takes the name of the view from > the url. > Something like: > > > (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), > > is it possible? I've a lot of views with the same rule and I want to make > them be available

get function list inside module was: Re: dynamic url pattern

2009-03-26 Thread Alessandro
On Thu, Mar 26, 2009 at 4:44 PM, Alessandro wrote: > > Is it possible to get a list of function names inside a module? I need to know the names of the functions in a module. is it possible ? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net SOASI Soc.Coop. - www.soasi.com S

Re: Having trouble authenticating/validating

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 12:26 PM, Adam Yee wrote: > > {{ error }} > > {{ form.as_p }} > > > form.as_p ought to be showing the errors on the form. So I'm puzzled by how is_valid could be returning False but no errors are being displayed. > Guessing is sometimes all one can do after analyzin

Re: DJango, threads and serial port

2009-03-26 Thread Filip Gruszczyński
I tried using import pdb right before the exception and runing set_trace, but it just displayed next command and finished. This code is executed in separate thread (ususally operations on serial port take a while, so I have to do it on seperate thread). 2009/3/26 Filip Gruszczyński : >> Hmm, sys.

Re: DJango, threads and serial port

2009-03-26 Thread Baurzhan Ismagulov
On Thu, Mar 26, 2009 at 05:15:32PM +0100, Filip Gruszczyński wrote: > I don't exactly know, how to achieve this. Our server is run through a > bash script with runfcgi command. Should I put somwhere pdb import and > try to start inside the code? AFAIK, you should be able to debug your scripts if

Re: DJango, threads and serial port

2009-03-26 Thread Baurzhan Ismagulov
On Thu, Mar 26, 2009 at 05:45:49PM +0100, Filip Gruszczyński wrote: > I tried using import pdb right before the exception and runing > set_trace, but it just displayed next command and finished. This code > is executed in separate thread (ususally operations on serial port > take a while, so I hav

Odd ORM behavior

2009-03-26 Thread David Lindquist
I am noticing some odd SQL being generated for certain queries. For example, if I type the following in the shell: >>> TroubleCode.objects.all()[:5] and then I look at the db queries: >>> from django.db import connection >>> connection.queries I get the desired query, plus 5 extra queries

Re: get function list inside module was: Re: dynamic url pattern

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 12:33 PM, Alessandro wrote: > On Thu, Mar 26, 2009 at 4:44 PM, Alessandro > wrote: > >> >> Is it possible to get a list of function names inside a module? > > > I need to know the names of the functions in a module. is it possible ? > That's pretty much a pure python ques

Converting DateTime to UTC

2009-03-26 Thread Oli Warner
I'm collecting DateTimes in local format. In Hindsight, this probably wasn't the best idea but it's what I have now. I need to output to UTC so people in multiple timezones can make sense of the data. Is there a nice template tag that will automagically convert my locally-collected date into UTC?

Re: DJango, threads and serial port

2009-03-26 Thread Filip Gruszczyński
> If the problem is reproducible with one thread, I'd use it for > debugging. > > Although I've never thought about using threads from Django; what will > your "main" thread answer to the browser? Main thread is not dependant of the other threads it calls. It just tells them to do something and t

Re: Odd ORM behavior

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 12:53 PM, David Lindquist wrote: > > I am noticing some odd SQL being generated for certain queries. For > example, if I type the following in the shell: > > >>> TroubleCode.objects.all()[:5] > > and then I look at the db queries: > > >>> from django.db import connection

Re: Odd ORM behavior

2009-03-26 Thread David Lindquist
Thanks Karen! I knew it had to be something newb-ish I was doing. :) On Mar 26, 2009, at 10:04 AM, Karen Tracey wrote: > On Thu, Mar 26, 2009 at 12:53 PM, David Lindquist > wrote: > > I am noticing some odd SQL being generated for certain queries. For > example, if I type the following in the

filestorages, overwritestorage, and sorl.thumbnail

2009-03-26 Thread AshB
i am trying to accomplish the following on image/file fields in a model in my app: 1. allow a filefield (managed through admin) to save its content to my remote CDN (cachefly). 2. upon saving the file to my remote CDN, i want django to simply overwrite any already existing file in the remote loc

Re: Converting DateTime to UTC

2009-03-26 Thread Oli Warner
Just found http://code.google.com/p/django-timezones/ On Thu, Mar 26, 2009 at 4:56 PM, Oli Warner wrote: > I'm collecting DateTimes in local format. In Hindsight, this probably > wasn't the best idea but it's what I have now. > > I need to output to UTC so people in multiple timezones can make s

Re: need a multiselect list box for a static list of options

2009-03-26 Thread Adam Fraser
First, I want to thank you for sticking with me and helping me through this. I've learned a lot, but unfortunately made no progress yet. I read the links you sent and ended up trying this in forms.py: from django.contrib import admin class ProjectAdmin(admin.ModelAdmin): formfield_overrides

request.user in forms.py

2009-03-26 Thread Konstantin S
Hello! I know this a very stupid question but nevertheless how can I get request.user object in forms.py file ? I am trying to do something like: class ItemGetForm(forms.Form): box = forms.ModelMultipleChoiceField( queryset=Box.objects.filter(owner=request.user), widget=form

Re: IndexError (list index out of range) in admin when updating a regex char primary key

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 7:06 AM, TeenSpirit83 wrote: > > I can't find nothing similar on this group! Can you please help me? > I get this error trace in the django 1.0.2 admin when updating a char > primary key in a regex field. > Thank you in advance! > I think there's a bit more going on here t

Re: Conditional Inline in admin interface

2009-03-26 Thread Marcos Marin
Hi Alex, thanks for your help. I'm trying to do what you say in the following way: class UserAdmin(_UserAdmin): def get_formsets(self, request, obj=None): try: student = Group.objects.get(name='student') except DoesNotExist: raise DoesNotExist, "The gro

Including username in FileField upload_to path

2009-03-26 Thread IanSR
I've spent the last few hours trying variations on upload_to for my FileField path generator get_file_path(instance,filename) that will allow me to include the username from the POST HttpRequest object. No luck. Does anyone have any suggestions on how to do this? My instance does have a "user"

Re: Snap and SCT - any reviews?

2009-03-26 Thread herbert
hi, i can only comment on my own forum - SCT http://sct.sphene.net unfortunately it does not have a big developer community behind it (yet? :) ) just the occasional contribution from various users (at least there are quite a few users already - public forums like http://www.thedjangoforum.com or

Mysterious "=32" for all strings extracted from list showing up via send_mail

2009-03-26 Thread NoviceSortOf
My objective is to send a clean list of field names and values via email after the completion of a form in Django. When formating an email message after extracting a list of field names and values from a list i get a string that prints something like this. $print(message_str): ... name="Bill Jo

Enter a valid date in YYYY-MM-DD format.

2009-03-26 Thread Timothy
Hi Folks, My model: birthdate = models.DateField(blank=True, null=True) Than bdate = request.POST['bdate'] provides an empty string "" because no value was inserted in the form. How can I insert an empty value for birthdate in my database (Postgresql)? bdate = "" p =

Unit tests with live data from database.

2009-03-26 Thread MikeL
I've noticed that the "/manage.py test" script creates a temporary database and requires fixtures to populate data for testing. But what about when tests involving large amounts of data that can be changed and we need to test our views by using that data? If someone accidentally breaks a view by j

Re:(solved) Enter a valid date in YYYY-MM-DD format.

2009-03-26 Thread Timothy
I have to set bdate = None and it works. Timothy --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubsc

Re: Unit tests with live data from database.

2009-03-26 Thread Briel
Hi. Fixtures doesn't need to be 'fixed'. You can create some fresh fixtures with a db dump. However, your code shouldn't break by changing an entry, changing tables ect, might give problems, but that shouldn't be something you do everyday on a production site anyways. That said, some problems wil

Re: Including username in FileField upload_to path

2009-03-26 Thread Rajesh D
On Mar 26, 3:21 pm, IanSR wrote: > I've spent the last few hours trying variations on upload_to for my > FileField path generator get_file_path(instance,filename) that will > allow me to include the username from the POST HttpRequest object. No > luck. Does anyone have any suggestions on how

Re: request.user in forms.py

2009-03-26 Thread Briel
Hi. You are on the wrong track trying to do it with request.user. The problem is that when you create the form, there is no request object with associated user. You need to do your stuff in the __init__.py instead, where you can create a custom, using the user object as an extra variable. I got a

Re: Port in use Error

2009-03-26 Thread pcastellazzi
The python uuid library use libuuid from e2fsprogs (at least in ubuntu). This particular uuid library spanws a daemon called uuidd to help with concurrent uuid generation. As far as i know the only way to disable this behaviour is to compile libuuid with --disable-uuidd option. When you run ./man

Fulltext searching

2009-03-26 Thread TheIvIaxx
So i have been trying to get a solid search going in django. I have seen things liek Whoosh and Solr or Lucene(sp?) which all add fulltext searching to your models. Are these better than the mysql fulltext searches? Is there a major benefit to go with one of these other packages or write someth

Re: Fulltext searching

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 14:37 -0700, TheIvIaxx wrote: > So i have been trying to get a solid search going in django. I have > seen things liek Whoosh and Solr or Lucene(sp?) which all add fulltext > searching to your models. Are these better than the mysql fulltext > searches? MySQL fulltext sea

Re: Django-Logging Problem..

2009-03-26 Thread caliman
do you have INTERNAL_IPS set in yout settings file? if your on localhost you probably need: INTERNAL_IPS = ('127.0.0.1',) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

persistent get url question

2009-03-26 Thread Timboy
I've created a calendar view and users can select multiple calendars with checkboxes. It passes this: ? calendars=CALNAME&calendars=CALNAME2&calendars=CALNAME2 to the url and returns the proper events but when I change months it goes back to the default calendar... how can I make the selected cal

Re: exclude fields from a query

2009-03-26 Thread dj
Hello All, I would like to know if there is a way to exclude fields from an object query. For example: Suppose I have this model. class Person(Model.model): name = Charfield() address = Charfield() state = Charfield() etc I do realize my syntax is probab

Re: exclude fields from a query

2009-03-26 Thread dj
Here is a link to a django ticket which addressed the issue. http://code.djangoproject.com/ticket/5420 DJ On Mar 26, 7:02 pm, dj wrote: > Hello All, > > I would like to know if there is a way to exclude fields from an > object query. > > For example: > > Suppose I have this model. > > class Pe

Re: Including username in FileField upload_to path

2009-03-26 Thread Brian Neal
On Mar 26, 3:56 pm, Rajesh D wrote: > On Mar 26, 3:21 pm, IanSR wrote: > > > I've spent the last few hours trying variations on upload_to for my > > FileField path generator get_file_path(instance,filename) that will > > allow me to include the username from the POST HttpRequest object.  No > >

Re: persistent get url question

2009-03-26 Thread Timboy
I figured it out. I passed the requested calendars to my template and used a forloop to pass them as a get request to the URL. On Mar 26, 4:23 pm, Timboy wrote: > I've created a calendar view and users can select multiple calendars > with checkboxes. It passes this: ? > calendars=CALNAME&calenda

Re: exclude fields from a query

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 17:02 -0700, dj wrote: > Hello All, > > I would like to know if there is a way to exclude fields from an > object query. > > For example: > > Suppose I have this model. > > class Person(Model.model): > name = Charfield() > address = Charfield() >

Custom get_object_or_xxx?

2009-03-26 Thread Thomas Hill
Hey all, I'm trying to implement a function similar to get_object_or_404. I'm trying to check permissions for a user, and if those permissions are met, then I want them to be sent to a page explaining what's going on. I found the exception PermissionDenied, but I can't find a way to do a custom per

Re: Custom get_object_or_xxx?

2009-03-26 Thread Malcolm Tredinnick
On Thu, 2009-03-26 at 20:35 -0700, Thomas Hill wrote: > Hey all, > > > I'm trying to implement a function similar to get_object_or_404. I'm > trying to check permissions for a user, and if those permissions are > met, then I want them to be sent to a page explaining what's going on. > I found th