Re: Form Validation

2008-06-10 Thread [EMAIL PROTECTED]
on a modelform you can do: form.save(commit=False), which will return an instance of the model, but doesn't save it to the db, so you can just assign request.user to owner and than save it. On Jun 11, 12:07 am, Adi <[EMAIL PROTECTED]> wrote: > I guess... the more deeper question is.. how can I

Re: Form Validation

2008-06-10 Thread Adi
I guess... the more deeper question is.. how can I pass a related model object and potentiall an unrelated model object into the form's validations methods? On Jun 10, 10:42 pm, Adi <[EMAIL PROTECTED]> wrote: > Hi, > I have a model  Owner and a model Relation. > > class  Relation(models.Model):

Re: Problem with login()

2008-06-10 Thread bcrem
Baxter - do you mean browser caching, or Django caching? Don't know how to do the latter (yet), so whatever the default is for this - that's what I've got. Thanks for all the replies, people. Still working on the user authentication aspect; seems like I'm zeroing in on the right functionality,

Form Validation

2008-06-10 Thread Adi
Hi, I have a model Owner and a model Relation. class Relation(models.Model): pet=models.CharField(max_length=2) owner = models.ForeignKey (Owner) then I have a ModelForm class RelationForm(ModelForm): class Meta: fields = ('pet') The application flow works like this: You

Re: Help for strategy to load dynamic content by domain (not subdomains)

2008-06-10 Thread Ronny Haryanto
On Wed, Jun 11, 2008 at 10:00 AM, ge <[EMAIL PROTECTED]> wrote: > I have what I hope is a simple question here. I do have a working > solution, but I'd like to know if anyone has any thoughts on cleaner > or perhaps more proper way to do this. > > For simplicities sake, lets assume I am trying

Help for strategy to load dynamic content by domain (not subdomains)

2008-06-10 Thread ge
I have what I hope is a simple question here. I do have a working solution, but I'd like to know if anyone has any thoughts on cleaner or perhaps more proper way to do this. For simplicities sake, lets assume I am trying to make a blogging service that allows users to create their own blogging

Re: sending email without "from" specified

2008-06-10 Thread MrJogo
Never mind, it was an EMAIL_HOST problem. On Jun 10, 7:25 pm, MrJogo <[EMAIL PROTECTED]> wrote: > I use a university webservice, and they do not allow scripts to set > the "from" address when sending mail (for example, php's mail function > works fine). How should I send mail from Django?

Django and Fliqz

2008-06-10 Thread AestheticMindStudios
I am building an application and am curious if anyone has done an interface with Fliqz using Web Services Description Language - or if this is automatically built in as an add-on to Django? Anybody out there that can help answer my question - looking to migrate to Django if it's been done and

sending email without "from" specified

2008-06-10 Thread MrJogo
I use a university webservice, and they do not allow scripts to set the "from" address when sending mail (for example, php's mail function works fine). How should I send mail from Django? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: ifequal tag in template with hard coded string confusion

2008-06-10 Thread Karen Tracey
On Tue, Jun 10, 2008 at 5:33 PM, John Teague <[EMAIL PROTECTED]> wrote: > > First the particulars: > Django svn rev 7610, > Apache 2.2.8, > mod_python 3.3.1, > Python/2.5.2 > > I have a template that uses django_template_utils (http:// > code.google.com/p/django-template-utils/) to retrieve

Re: Trouble Running Tutorial when running syncdb first time on Mac OS X

2008-06-10 Thread Juan Hernandez
sqlite3.OperationalError: unable to open database file <<-- here is the problem, check permissions On Wed, Jun 11, 2008 at 6:00 PM, jeff <[EMAIL PROTECTED]> wrote: > > I have been trying to get Django up and running on Mac OS X (10.5.3). > I did everything in the tutorial and successfully got

Trouble Running Tutorial when running syncdb first time on Mac OS X

2008-06-10 Thread jeff
I have been trying to get Django up and running on Mac OS X (10.5.3). I did everything in the tutorial and successfully got the server up and running. I made changes to the settings.py file, which were: DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql',

Re: Middleware problem

2008-06-10 Thread Josh
Turns out the problem was my own fault. My process_response() wasn't handling exceptions properly. I changed it from this: def process_response(self, request, response): self.activity.set_request_time() return response to this: def process_response(self, request,

Customizing newforms-admin

2008-06-10 Thread Josh
With newforms-admin, is there currently anyway of duplicating the functionality of 'manage.py adminindex '? It appears that currently this still is looking for the old admin stuff as the result I get is this: {% if perms.myapp %} Myapp {% endif %} I'm guessing that this is basically something

Re: Can't convert UTC time :(

2008-06-10 Thread Horst Gutmann
You mean like the difference in seconds between 2 timezones? Then perhaps the tzinfo class itself might be of some help here. It has a utcoffset(self, datetime) method that returns a datetime.timedelta instance: http://docs.python.org/lib/datetime-tzinfo.html - Horst On Tue, Jun 10, 2008 at

Re: Importing data from 'MS Access' .mdb files

2008-06-10 Thread M.Ganesh
Peter Herndon wrote: > Two possibilities come to mind. First, is the Python ADODBAPI module: > http://sourceforge.net/projects/adodbapi > > Second, as an *extremely* useful tool for this sort of thing, may I > suggest Navicat for MySQL on Windows? The Windows version allows you > to import

Overiding model's save() while saving models of the same types

2008-06-10 Thread Mihai Damian
I need to modify models of the same type as the model I'm saving. I tried overriding the save method but I get a concurency error (I think) when I save the other model objects of same type. Can this be done or should I consider a (long) workaround? Thanks

ifequal tag in template with hard coded string confusion

2008-06-10 Thread John Teague
First the particulars: Django svn rev 7610, Apache 2.2.8, mod_python 3.3.1, Python/2.5.2 I have a template that uses django_template_utils (http:// code.google.com/p/django-template-utils/) to retrieve objects. The following is the relevant markup/code: -- {% load generic_content %} {%

Re: serving root from static

2008-06-10 Thread Colin Bean
On Mon, Jun 9, 2008 at 10:58 PM, Andre Meyer <[EMAIL PROTECTED]> wrote: > thanks a lot, Colin, i will contact the WebFaction guys for the apache > setup. they are always very helpful ;-) > > HOWEVER: for testing purposes only, using only runserver and sqlite, how to > preceed for making this

Re: deleting an uploaded file after a positive virus check

2008-06-10 Thread tejas
Thanks for replying Karen That's quite nice, in that I don't need to worry about deleting any infected files,and uploaded files are quite small. cheers Tejas On Jun 8, 12:55 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Jun 7, 2008 at 4:35 PM, tejas <[EMAIL PROTECTED]> wrote: > > Hi

Re: FileField not working, however ImageField is.

2008-06-10 Thread diggs
Did you ever figure out what the problem was? I'm having the exact same issue. Using the RequiredIfOtherFieldEquals validator with an ImageField. On May 19, 10:16 am, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > I commented out the validator_list = [is_archivo] , and it'sworking > now,

Can't convert UTC time :(

2008-06-10 Thread Darthmahon
Hi Guys, I want to convert a UTC timestamp so I can use it to figure out what offset a certain user has based on their selected timezone. I'm using the Python pytz module by the way. Here is the code so far: == # get users time timezone = timezone('America/New_York') # get UTC time

Re: Total newbie question

2008-06-10 Thread cjl
Pedro: If you have about 40 minutes to kill, you can check out my tutorial: http://www.instantdjango.com It is written for absolute beginners, and even includes a portable Django development environment for Windows, so you don't have to fool around with installing Django. The tutorial covers

Re: Models and DB api

2008-06-10 Thread Juan Hernandez
oohh, now I get it Thank you very much Daniel On Wed, Jun 11, 2008 at 2:28 PM, Daniel Roseman < [EMAIL PROTECTED]> wrote: > > On Jun 10, 5:14 pm, "Juan Hernandez" <[EMAIL PROTECTED]> wrote: > > Now, my question is: How do I treat all these values into a string > without > > slicing it?? I'm

Re: Models and DB api

2008-06-10 Thread Daniel Roseman
On Jun 10, 5:14 pm, "Juan Hernandez" <[EMAIL PROTECTED]> wrote: > Now, my question is: How do I treat all these values into a string without > slicing it?? I'm trying to get a value from a table and as soon as I convert > the QuerySet to a __str__() it brings everything and I have to slice it >

Validation error message shows up twice in admin

2008-06-10 Thread Cave, Phillip
I've added an additional validator to a model field and while it works as expected, the actual error message is being displayed twice above the form field in the admin site. Anyone experience this before? large_image_validator = validators.RequiredIfOtherFieldEquals('show', 'on') ...

Re: clean_ question

2008-06-10 Thread Juanjo Conti
When you need to use data from more than one form field, THAT validations should be done in a method called 'clean', becasue when clean is execute you are sure that all the fields were c cleaned. -- Juanjo Conti & Ceci --~--~-~--~~~---~--~~ You received this

Re: clean_ question

2008-06-10 Thread Karen Tracey
On Tue, Jun 10, 2008 at 1:13 PM, Adi <[EMAIL PROTECTED]> wrote: > > I have a form with two fields > > class TestForm (forms.Form): >EVENT_TYPE_CHOICES = ( ( "", "---Please Select---"), > ("01","Individual"), ("02","Team") ) >eventtype = >

Django-tagging: Tagfield + counts-functionality problem

2008-06-10 Thread mwebs
Hello, I have a model that looks like this class Picture(models.Model): tags = Tagfield(maxlength=255) In my view I want to display how many pictures have been tagged with a specific tag. In the docs of django-tagging I read about an additional attribute calles "counts = True".

Re: Question about the encoding of filename

2008-06-10 Thread Karen Tracey
2008/6/10 PENPEN <[EMAIL PROTECTED]>: > > Hi there > I met a problem when I use django to handle a file upload request > while that file's name is in Chinese. The chinese part of the filename > is truncated, e.g. I could only get ".txt" while the input filename is > "汉.txt" I suspect the

Re: Problem with login()

2008-06-10 Thread Adi
I would check a couple of things. 1. Your session middleware is installed and configured. 2. 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', are in your installed apps 3. if your session mgr implementation is database

clean_ question

2008-06-10 Thread Adi
I have a form with two fields class TestForm (forms.Form): EVENT_TYPE_CHOICES = ( ( "", "---Please Select---"), ("01","Individual"), ("02","Team") ) eventtype = forms.CharField(max_length=2,choices=EVENT_TYPE_CHOICES) participants = forms.IntegerField(required=False,

i18n with exactly 3 languages

2008-06-10 Thread pihentagy
Hi all! I should create an app with exactly 3 languages. So, I have a model with name_en name_de and name_hu fields. I would like to have a name method, which returns the name in the currently selected language. I need a solution, which can also work with generic views (object_list,

Generic foreign keys and double underscore relation spanning

2008-06-10 Thread David Zhou
Hi all, Does Django currently support spanning generic foreign keys with double underscores? For example, if I have: class Bucket(models.Model): item = generic.GenericForeignKey() class Sock(models.Model): attribute1 = ... class Shirt(models.Model): attribute1 =

Re: Total newbie question

2008-06-10 Thread Juan Hernandez
djangobook.com is a great place to start On Wed, Jun 11, 2008 at 11:33 AM, Gonzalo Delgado < [EMAIL PROTECTED]> wrote: > El Tue, 10 Jun 2008 08:46:14 -0700 (PDT) > Pedro Cora <[EMAIL PROTECTED]> escribió: > > > > > First of all, sorry if i'm making a question that should appear a lot > > here. >

Models and DB api

2008-06-10 Thread Juan Hernandez
Hi there... I'm a long time python programer new to django. I've been playing with the DB api for a while and I have some questions: I have this model, for example: --- # Users class class Users(models.Model): name = models.CharField(maxlength=30) lastname =

Re: Django graphic designers

2008-06-10 Thread David Reynolds
On 9 Jun 2008, at 11:37 pm, Juanjo Conti wrote: > > I'd like to know if there is a community of graphic designers working > with django. Maybe a website with resources (css, html tamplates...)? > > I am writing a little personal app and it looks really ugly :) > > One of my options is to hire a

Re: Total newbie question

2008-06-10 Thread Gonzalo Delgado
El Tue, 10 Jun 2008 08:46:14 -0700 (PDT) Pedro Cora <[EMAIL PROTECTED]> escribió: > > First of all, sorry if i'm making a question that should appear a lot > here. > > I'm a webdesigner that knows xhml and css.. and I can READ (but not > write) in PHP. My question is. Is it possible to learn

Re: Total newbie question

2008-06-10 Thread Richard Dahl
I would start with 'Dive into Python' or 'How to think like a computer scientist in python' to gain familiarity with basic python concepts. -richard On 6/10/08, Pedro Cora <[EMAIL PROTECTED]> wrote: > > > First of all, sorry if i'm making a question that should appear a lot > here. > > I'm a

Re: Total newbie question

2008-06-10 Thread Hernan Olivera
> My question is. Is it possible to learn how to work > with django? READ and WRITE code? How should I start? Python lessons? Maybe you can start with the Django tutorial ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Total newbie question

2008-06-10 Thread Pedro Cora
First of all, sorry if i'm making a question that should appear a lot here. I'm a webdesigner that knows xhml and css.. and I can READ (but not write) in PHP. My question is. Is it possible to learn how to work with django? READ and WRITE code? How should I start? Python lessons? Regards and

Re: Problem with login()

2008-06-10 Thread erincarter
I'm curious about this as well. I've been using the Django Registration App (http://code.google.com/p/ django-registration/) and experiencing a similar issue. I have an almost identical method of "Hello, {{ user.username }}" in my base template. When a user has logged in and on any of the

Re: Django and mysql SET datatype?

2008-06-10 Thread Karen Tracey
On Mon, Jun 9, 2008 at 10:42 PM, Silfheed <[EMAIL PROTECTED]> wrote: > > Heyas > > So we have a table which makes use of mysql's SET datatype to store > the status of a page ('active','inappropriate','optout') with the > status being any combination of the three. This helps us keep the >

Question about the encoding of filename

2008-06-10 Thread PENPEN
Hi there I met a problem when I use django to handle a file upload request while that file's name is in Chinese. The chinese part of the filename is truncated, e.g. I could only get ".txt" while the input filename is "汉.txt" I use the following clean function def clean_file(self): if

Re: Problem with login()

2008-06-10 Thread erincarter
I am curious about this as well. I've been using the Django Registration App (http://code.google.com/p/ django-registration/). I have an almost identical "Hello, {{ user.username }}" in the base template. Once logged in, user.is_authenticated() works fine (shows the user name) on all the

Re: Importing data from 'MS Access' .mdb files

2008-06-10 Thread Peter Herndon
Two possibilities come to mind. First, is the Python ADODBAPI module: http://sourceforge.net/projects/adodbapi Second, as an *extremely* useful tool for this sort of thing, may I suggest Navicat for MySQL on Windows? The Windows version allows you to import .mdb files and do data transfers

Re: Testing framework or model save behaves differently after qsrf merge?

2008-06-10 Thread Russell Keith-Magee
On Tue, Jun 10, 2008 at 6:53 AM, peschler <[EMAIL PROTECTED]> wrote: > > I'm currently facing a weird problem with the testing framework after > updating to the latest trunk version of the newforms-admin branch. I > have written a small example and a unittest to explain the issue and > to show

Re: Can I loop over attributes in model.attribute?

2008-06-10 Thread Russell Keith-Magee
On Tue, Jun 10, 2008 at 9:25 PM, Wim Feijen <[EMAIL PROTECTED]> wrote: > > Coding happily away... > > And wondering, can I write better code, using a loop, perhaps? In > other words: can I set settings.groupon while using a variable in > stead of groupon? > > Thanks for any recommendations you

Can I loop over attributes in model.attribute?

2008-06-10 Thread Wim Feijen
Coding happily away... And wondering, can I write better code, using a loop, perhaps? In other words: can I set settings.groupon while using a variable in stead of groupon? Thanks for any recommendations you are willing to make! Wim Feijen --- My not-too-pretty code: settings =

Re: Painfully slow... why?

2008-06-10 Thread James Bennett
On Tue, Jun 10, 2008 at 7:42 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > At the risk of talking to myself, I may have found the cause of my > slowdowns: KeepAlive. Setting it OFF has -- so far -- made a HUGE > performance improvement. More than I saw from memcached, or anything > I've done

Re: Painfully slow... why?

2008-06-10 Thread [EMAIL PROTECTED]
At the risk of talking to myself, I may have found the cause of my slowdowns: KeepAlive. Setting it OFF has -- so far -- made a HUGE performance improvement. More than I saw from memcached, or anything I've done with the queries. --~--~-~--~~~---~--~~ You received

Re: Problems with generic view

2008-06-10 Thread Matic Žgur
Ok, I solved it. Wrong TIME_ZONE in settings.py. :) On Tue, Jun 10, 2008 at 12:27 PM, Matic Žgur <[EMAIL PROTECTED]> wrote: > Hi, > > I have some problems with the date based generic view. I'll just paste > the code bellow: > > views.py > > def post_detail(request, year, month, day,

Problems with generic view

2008-06-10 Thread Matic Žgur
Hi, I have some problems with the date based generic view. I'll just paste the code bellow: views.py def post_detail(request, year, month, day, slug): return date_based.object_detail( request, year = year, month = month, day =

Re: ModelChoiceField option values

2008-06-10 Thread Mihai Damian
10x, I eventualy solved the problem. I think I was doing some caching and so the values didn't resemble the id's I was reading from the database --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Newform and validating of date literals

2008-06-10 Thread n00m
Yes. Thanks, Adi. This works puffikly: class valForm(forms.Form): ... ... dt = forms.DateField(input_formats=('%d.%m.%Y',)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups