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
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):
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,
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
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
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
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?
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
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
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
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
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',
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,
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
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
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
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
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 %}
{%
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
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
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,
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
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
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
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
>
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')
...
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
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 =
>
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".
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
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
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,
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,
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 =
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.
>
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 =
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
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
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
> 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
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
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
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
>
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
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
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
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
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
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 =
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
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
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,
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 =
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.
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
55 matches
Mail list logo