Malcolm,
On Dec 23, 2:00 am, Malcolm Tredinnick
wrote:
> You can do it this way:
>
> from django.utils import translation
>
> translation.activate(locale)
>
> where "locale" is a variable containing the name of the locale you wish
> to activate. You should call that as early as p
I got another idea for it now.
Thank for your reminder. :-)
On Dec 15, 2:00 pm, Malcolm Tredinnick
wrote:
> On Sun, 2008-12-14 at 21:32 -0800, lee wrote:
>
> [...]
>
> > It seems that official docs hasn't give a reference to howto define
> > 'ON DELETE CASCADE ON UPDATE CASCADE' in models,
> >
On Mon, 2008-12-22 at 22:17 -0800, George Sakkis wrote:
[...]
> 1. With explicit concrete inline admin classes, the interface shows
> one section per class ("Book reviews", "Movie reviews", etc.). This
> might be a feature under some circumstances (you get a "group by
> review type" for free), bu
OK, that makes sense then. Thank you!
On Mon, Dec 22, 2008 at 5:11 PM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
>
> On Mon, 2008-12-22 at 15:32 -0700, Greg Schwimer wrote:
> [...]
>
> >
> > I suspect I've now moved on to a problem in a new area. The thing I
> > don't quite get is wh
On Dec 22, 7:04 pm, Malcolm Tredinnick
wrote:
> On Mon, 2008-12-22 at 09:42 -0800, George Sakkis wrote:
>
> [...]
>
>
>
> > Unfortunately it doesn't work for what I tried. What I am trying to do
> > is have the Child classes as InlineModelAdmin in some other class that
> > references them. Here'
On Mon, 2008-12-22 at 21:01 -0800, jai_python wrote:
> No one here to solve my problem :(
Please show some simple patience. It's been less than 24 hours since you
originally posted a question that has zero Django content in it to a
Django-specific mailing list. You *might* get lucky and find
No one here to solve my problem :(
--~--~-~--~~~---~--~~
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 emai
I am always amazed by the support here, thank you.
After seeing Brian's code I switched resize_image() to be a model
method and then I switched from saving the form to saving the profile
profile = request.user.get_profile()
profile.save_picture(pform.cleaned_data['picture'].read())
instead of
Anyone can help on this? I get stuck with image file upload.
On Dec 21, 11:33 pm, Chuck22 wrote:
> I have three ImageField in my form and model, I want to know how to
> upload the three image files in the form processing code. I found
> Django Admin page handles the image file upload nicely. And
On Mon, 2008-12-22 at 19:03 -0800, DragonSlayre wrote:
> I've created my own form:
>
>
> Login:
> Username:
>
> Password:
>
>
>
>
> I am mappying /accounts/login/ to a view of mine, which is then
> calling:
>
> if request.method == 'POST':
> username = request.POST['lo
I've created my own form:
Login:
Username:
Password:
I am mappying /accounts/login/ to a view of mine, which is then
calling:
if request.method == 'POST':
username = request.POST['login_username']
I have no idea why I'm getting the error - "Key 'login_username' not
fo
Have some further questions about what you want to do.
Do you want a separate daemon process for each distinct Django site,
or are you happy with one really fat process which contains each
Django site in a separate sub interpreter of that process?
How much memory does each Django site instance t
On Tuesday 11 December 2007 12:33:23 pm Greg wrote:
> Hello,
> I'm trying to get my RSS feed items to link to the right url, however
> I'm having trouble. I was orginally having my blogs appear in my RSS
> feed. When I clicked on one of them I would get the error:
>
> ' Invalid feed parameters.
I've looked into this further, and it looks like it's actually an issue with
PostgreSQL, not django. The field I'm querying is of type inet, and I'm
inputting an IPv6 address. However, it appears that in PostgreSQL (running
version 8.3.5) IPv6 addresses only match a query when the string being
qu
Paul,
Thanks for the help. I switched to the get method, and the data
prints correctly now. Thanks!
-Mike
On Dec 22, 5:44 pm, "Wayper, Paul"
wrote:
> > .filter returns a list of the items that match the query. So
> > you're trying to stringify a list. That's where the '[' and
> > ']' are c
Hi,
I'm running django-1.0 in a multi-threaded application (PostgreSQL backend),
and I'm getting an IntegrityError occasionally when I run a
model.objects.get_or_create(). I can see in the get_or_create() method of
db/models/query.py that it excepts an Integrity error, and then rolls back
the tra
Hi.
I'm interested if there is some 3rd party ACL(http://en.wikipedia.org/
wiki/Access_control_list) module for django. If there is can u advice
me some of them or give some useful links?
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subs
On Mon, 2008-12-22 at 15:32 -0700, Greg Schwimer wrote:
[...]
>
> I suspect I've now moved on to a problem in a new area. The thing I
> don't quite get is why adding auto_now_add to the pub_date field in
> the model broke this. Any ideas?
Because auto_now_add fields are not editable. They ar
On Mon, 2008-12-22 at 17:20 -0600, GaRaGeD Style wrote:
> > That particular value comes from one of three sources. In order of
> > highest priority to lowest, they are:
> >
> >(1) Data submitted to the form (for redisplaying submitted data
> >for errors).
> >(2) Initial dat
On Mon, 2008-12-22 at 09:42 -0800, George Sakkis wrote:
[...]
> Unfortunately it doesn't work for what I tried. What I am trying to do
> is have the Child classes as InlineModelAdmin in some other class that
> references them. Here's a sample:
>
> # === models.py ===
> class R
On Mon, 2008-12-22 at 05:06 -0800, Iwan wrote:
> Hi there,
>
> We're using Django templates on their own. Usually invoked like this
> (eg):
>
> -
> t = django.template.Template(templateSource)
> c = django.template.Context({})
>
> print t.ren
> That particular value comes from one of three sources. In order of
> highest priority to lowest, they are:
>
>(1) Data submitted to the form (for redisplaying submitted data
>for errors).
>(2) Initial data provided to the form class
>(3) Initial data provided to t
Alright thanks a lot.
On Dec 22, 3:06 pm, bruno desthuilliers
wrote:
> On 22 déc, 17:10, kev wrote:
>
>
>
> > Hello,
> > Im reading a django book and it adds friends to user authentication
> > system by making:
>
> > (was .96)
>
> > class Friendship(models.Model):
> > from_friend = models.For
> .filter returns a list of the items that match the query. So
> you're trying to stringify a list. That's where the '[' and
> ']' are coming from.
I should have mentioned that the get method (e.g. Post.objects.get(id =
1)) will return a single object, or raise a DoesNotExist error. You may
OK, that definitely fixed it, but it created another problem. Here's how it
looks now:
*pub_date = models.DateTimeField('date published', auto_now_add=True)*
Exactly as you'd suggested. However, I'm now getting the following error on
all pages I hit:
*ImproperlyConfigured at /polls/new/
'PollA
> From: Mike Albert
> Subject: Newbie Help with Models and Views
>
> I have a couple test rows of data in my database. From the
> interactive shell (manage.py shell), I can return data correctly with
> Post.objects.filter(id=1).
You'll notice that that data is coming back as ['row 1']. It's i
On Dec 22, 9:44 pm, Ben Eliott wrote:
> Hi Graham,
> I've finally managed to get back to the wildcard subdomains & mod_wsgi
> today. Unfortunately the discussion thread you mentioned has
> disappeared and after a few hours i still seem to be doing a good job
> of getting nowhere.
I can s
On Dec 22, 9:14 pm, Ana wrote:
> Hello,
>
> I migrated my MySQL tables to Postgres. Generally, the migration was
> fine with one exception. I have a table researchproj that included
> two foreign keys (institution_id and contact_id). I received the
> following error:
>
> Caught an exception wh
Hello,
Just getting started learning django, and I'm having trouble with a
view. Here is the model I've created:
from django.db import models
class Post (models.Model):
text = models.CharField(max_length=30)
def __str__(self):
return self.text
I have a couple test rows of
Hello,
I migrated my MySQL tables to Postgres. Generally, the migration was
fine with one exception. I have a table researchproj that included
two foreign keys (institution_id and contact_id). I received the
following error:
Caught an exception while rendering: ('ascii', u'Jorge Gir\xf3n', 9,
With my code, what are you using as "content"?
I'm using: form.cleaned_data['source'].read()
So my code looks something like this:
PHOTO_MEDIUM_SIZE = 400,400
source_image = form.cleaned_data['source'].read()
resized_image = resize_photo(source_image,PHOTO_MEDIUM_SIZE))
photos.save(image_name,re
On Dec 22, 12:30 pm, Aldo wrote:
> Hi folks,
>
> Simple enough problem but cant find the functionality - if it exists.
>
> this_week = datetime.date.today() - timedelta(7)
> Cars.objects.filter(created_date>this_week)
>
> I basically want to find all cars that were created in the last 7
> days. I
On 22 déc, 17:10, kev wrote:
> Hello,
> Im reading a django book and it adds friends to user authentication
> system by making:
>
> (was .96)
>
> class Friendship(models.Model):
> from_friend = models.ForeignKey(
> User, related_name='friend_set'
> )
> to_friend = models.ForeignKey(
>
class MyForm(...):
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
self.fields['myfield'].choices =
City.objects.values_list('id', name_field)
--~--~-~--~~~---~--~~
You received this message because you are subscr
On 22 déc, 13:34, Kura wrote:
> Hey guys, I'm currently working on a content management system built
> on the Django framework, currently the whole cms works on a section->page(s)
> basis which is working well, we've run in to some issues with
>
> our designs in that the blocks for content on so
On Dec 22, 4:43 pm, nbv4 wrote:
> I have a model which is defines kind of like this:
>
> MyModel(models.Model)
> field1 = models.BooleanField()
> field2 = models.BooleanField()
> field_num = "1"
>
> And then I have a form thats pretty much this:
>
> MyModelForm(models.ModelForm)
>
I'm writing custom session based wizard (data between step is stored
in sessions).
One of the steps is uploading files (not the last).
The problem is that i save models only after last step.
So the question is how to deal with files?
As i understand there is no way to store files in session
--~-
I got the same result with brianmac44's code. I also verified that the
my resize_image() works when opening the file from the local
filesystem - so I am somehow not passing the file in a manner that
Image.open likes.
On Dec 22, 4:45 am, brianmac44 wrote:
> I had the same problem two weeks ago. T
Hello,
You can add a hidden input named "next" where you put the value of next in
the GET variable.
Like this
Or you can change the action variable of the form to include the current GET
variables. like this
If your view that handles GET and POST aren't the same you must add
>
> Your analysis is correct. It's the self.extra_context.update(*) call
> in the FormWizard that simply updates the class level copy of that
> variable.
>
> If you instead override "parse_params" as suggested by the comments in
> FormWizard, you won't have this problem.
To be clearer, in additio
Thanks a lot Malcolm for your explanatory information. I think I get
the concept now :)
On Dec 20, 9:36 pm, Malcolm Tredinnick
wrote:
> On Fri, 2008-12-19 at 11:10 -0800, Fereshteh wrote:
> > Hi,
> > I am trying to add a filtering functionality to my web application. I
> > create a WHERE clouse
On Dec 19, 2:27 pm, 朱穆穆 wrote:
> self.extra_context is a reference of FormWizard.extra_context.
> It was empty when the class define, but may not empty when
> instantiate.
>
> class TestWizard(forms.FormWizard):
> pass
>
> tw1 = TestWizard()
> tw1(request, extra_context={'test1': 1})
> # tw
I see what you are saying but there are few drawbacks:
1) 2 queries instead of one.
2) When you combine into friends_all or something, you need to keep
track of which was friend vs which is user.
I was thinking more on the lines of this:
Each User has a UserProfile which i defined. In UserProfile
I suspect that bots aren't going to follow form submits like this so
it doesn't matter.
But if you have these GET queries coded into any html elements,
thereby becoming part of the sitemap, then it probably will matter.
This is a bit of a common sense punt, i'm not an SEO expert, so
standi
Hey there,
I've been searching this group for a working example of a complex
form using a ManyToMany relationship with an intermediary model.
I've read this documentation to know a bit more about the ManyToMany
relationship:
http://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-m
On Dec 21, 10:02 pm, Malcolm Tredinnick
wrote:
> On Sun, 2008-12-21 at 18:50 -0800, George Sakkis wrote:
> > Hi all,
>
> > I have a situation which I think would best be modeled as (single)
> > inheritance, involving product reviews for various kinds of products.
> > Naturally, there are some fi
The way I was thinking of doing it was to have two foreignkeys named
friend1 and friend2 then when you do your list you could run
(something like)
friends = Friendship.objects.get(friend1__exact=user)
and
friends2 = Friendship.objects.get(friend2__exact=user)
Then you have a complete instance of
I have a model which is defines kind of like this:
MyModel(models.Model)
field1 = models.BooleanField()
field2 = models.BooleanField()
field_num = "1"
And then I have a form thats pretty much this:
MyModelForm(models.ModelForm)
class meta
model = MyModel
I want to be ab
Hello,
Im reading a django book and it adds friends to user authentication
system by making:
(was .96)
class Friendship(models.Model):
from_friend = models.ForeignKey(
User, related_name='friend_set'
)
to_friend = models.ForeignKey(
User, related_name='to_friend_set'
)
def __st
This is really boring :(
I've restarted the server, and it doens't work again :/
also I've noticed that no urls in reparations.urls can't be called
with the template tag url...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Checked two more things:
- to mke sure that mod_python could compile anything it wanted to I
chown'd the python distribution to apache (the user). This had and
effect - various pyc files created - however, the admin app still
doesn't run.
- put in a symbolic link so the django distribution is v
On 17 Dec 2008, at 23:00, felix wrote:
> and thanks to whoever made this ! very useful.
The maintainer is PBX / Paul Bissex
--
David Reynolds
da...@reynoldsfamily.org.uk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
I'm seeing strange behaviour of login_required decorator: any view
decorated with it first sends to login page, then to url defined in
LOGIN_REDIRECT_URL. The url to decorated view is supplied in next
parameter (/login/?next=/path/to/view/) but is never executed.
Looking at login view code I see
On Mon, Dec 22, 2008 at 3:43 AM, todd wrote:
> I'm using the latest django release 1.0.2 and following the tutorial.
> I noticed I do not have 'Sites' in my admin site. Am I missing
> something to get the 'Sites' appear?
>
Probably you do not have 'django.contrib.sites' listed in your
INSTALLE
makka...@gmail.com wrote:
>> I'm working on a big project at my work myself.
>> We came to this problem last week (we did something to check it, but it
>> was unmanagable).
>> We wanted to move the check to the models. This is a little bit
>> difficult because you basicly doesn't have the user obj
Hello,
I have a ModelChoiceField getting filled up by a database queryset.
Works fine this far.
In my template the entries of the select-field look all like this:
Afghanistan
I know that that the value between the two option tags (Afghanistan)
can be set by changing the model's __str()__-method.
Hey guys, I'm currently working on a content management system built
on the Django framework, currently the whole cms works on a section-
>page(s) basis which is working well, we've run in to some issues with
our designs in that the blocks for content on some pages are in
different locations and t
You're 14. You recognize that you're having a problem and you post to
the Django group for help. You're not stupid at all. I would say
you're very intelligent!
On Dec 21, 2:43 pm, Chris wrote:
> Oh shit, that's awesome! Thanks! I thought it had already created the
> DB and wanted me to fill i
Hi there,
We're using Django templates on their own. Usually invoked like this
(eg):
-
t = django.template.Template(templateSource)
c = django.template.Context({})
print t.render(c)
-
When
On Monday 22 December 2008 12:18:13 pm Paul van der Linden wrote:
> Hi,
Hi thanks for the reply
> I'm working on a big project at my work myself.
> We came to this problem last week (we did something to check it, but it
> was unmanagable).
> We wanted to move the check to the models. This is a lit
I had the same problem two weeks ago. This is what I wrote:
def resize_photo(self,content,size):
img = Image.open(ContentFile(content))
img.thumbnail(size, Image.ANTIALIAS)
io = StringIO.StringIO()
img.save(io, 'PNG')
return ContentFile(io.getvalue())
Hope this helps.
-Brian
I have a form with a SplitDateTimeField and cannot figure out how to
access the individual date and time elements in it from my template:
class Dummy1(models.Model):
name = models.CharField(max_length = 100)
created = models.DateTimeField(default = datetime.datetime.now())
class Dummy
Hi folks,
Simple enough problem but cant find the functionality - if it exists.
this_week = datetime.date.today() - timedelta(7)
Cars.objects.filter(created_date>this_week)
I basically want to find all cars that were created in the last 7
days. I have seen there are things for the month and yea
Dear all,
I am using POD APPY framework (http://appyframework.org/) for
generating reports in pdf and odt files. i am able to get reports in
odt file using development server. when i tried with pdf reports, i
got an error
ERROR
-
Hello,
I have started using python recently and would like to call a short
python script via
browser using a CGI script, but initially I am trying to call the same
python script directly through python command line. The script intends
to
perform a few command line in a pipe and I have written the
Hi Graham,
I've finally managed to get back to the wildcard subdomains & mod_wsgi
today. Unfortunately the discussion thread you mentioned has
disappeared and after a few hours i still seem to be doing a good job
of getting nowhere.
Although you mentioned using mod_rewrite to get hold of th
Hi,
I'm working on a big project at my work myself.
We came to this problem last week (we did something to check it, but it
was unmanagable).
We wanted to move the check to the models. This is a little bit
difficult because you basicly doesn't have the user object at in the
__init__ function of yo
What a strangeness!
I edit the template removing the extend tag, and it worked, next I
readded the extend and it still worked :O
this is really strange :/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users
I'm working with a model using a CharField primary key, and want to
ask whether it is appropriate to use force_update=True in a save()
override on the model. I need to prevent other objects from being
created/updated if save() is called with a changed pk value.
class Widget(models.Model):
ide
Thank you I tried that and I still get the same error.
I spent a little more time looking at PIL / Image.py and cleaning up
the code. From what I can tell the Image.open method is having trouble
with what I am passing to it.
def resize_image(file, size=(50, 50)):
from PIL import Image
fr
On 22 Dic, 09:24, Malcolm Tredinnick wrote:
> Okay, nothing unexpected there. If I use the same lines with a dummy
> view file, things certainly seem to work.
>
> The confusing thing here is that the url template tag is a relatively
> simple wrapper around reverse(), so there aren't many places f
Hi,
I'm using the latest django release 1.0.2 and following the tutorial.
I noticed I do not have 'Sites' in my admin site. Am I missing
something to get the 'Sites' appear?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
Check this:
http://code.activestate.com/recipes/511465/
http://pybrary.net/pyPdf/
Best regards,
2008/12/21 Harish :
>
> Hi Friends...
>
> I know this is a not a right place to ask this question.
> but it is related to Python. I thought it to ask.
>
> Is there any python library is available to
Hi,
We are developing an Intranet product hosted on Django. It is a product
which is currently installed at couple of clients and goes through monthy
updates. We are developing a user manual which will be in revision almost
every week. We might have a few more installations this year for the same
On Sun, 2008-12-21 at 23:58 -0800, patrick91 wrote:
> On 22 Dic, 02:17, Malcolm Tredinnick wrote:
> > Certainly a bit unexpected. Can you paste the relevant lines from your
> > URL Conf file, please?
> >
> > Regards,
> > Malcolm
>
> Sure :)
> here it is:
> url(r'foglio/(?P[0-9]+)/$', views.show_
75 matches
Mail list logo