Re: Digest for django-users@googlegroups.com - 18 updates in 11 topics

2014-10-17 Thread 郁夫
急 On Oct 17, 2014 9:19 PM, wrote: > django-users@googlegroups.com > > Google > Groups >

Re: how to update data in FK fields another Model

2014-10-17 Thread carlos
+Collin Thank this is working perfects :) Cheers On Thu, Oct 16, 2014 at 3:31 PM, Collin Anderson wrote: > Hi, > > Would this work? > > ModelA.objects.filter(id=self.fk_name_id).update(field_count=F('field_count') > + 1) > > Collin > > -- > You received this message

Re: How to deny access to a logged user directly to a specific URL

2014-10-17 Thread Kelvin Wong
Have you reviewed this? https://docs.djangoproject.com/en/1.6/ref/contrib/formtools/form-wizard/ K On Friday, October 17, 2014 10:08:08 AM UTC-7, Martin Torre Castro wrote: > > Hello, > > at my project we need some sort of system for allowing/denying some access > to an URL. > > The example,

Re: File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Jon Dufresne
On Fri, Oct 17, 2014 at 4:45 PM, Russell Keith-Magee wrote: > Achievable? probably. Easy? No. You're going to be digging in the weeds on > this one. > > If I were trying to do this, I wouldn't try and get this to work with the > existing FileField - I'd be writing my own

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Ken Winter
Thanks again Carl (and others) ~ I agree wıth you that the "DB users" approach seems the most promısıng. It's the one I will pursue, and certainly glad to share the code when I have some worth sharing - and quite likely I'll have some more questions before that, as I try to implement this

Re: File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Russell Keith-Magee
On Sat, Oct 18, 2014 at 3:32 AM, Jon Dufresne wrote: > Hi, > > I'm trying to use the File Storage API to create a custom handler for > files. Here are my goals: > > Stored files are represented both in the database and on disk with the > following model: > > class

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Carl Meyer
Hi Ken, On 10/17/2014 05:16 PM, Ken Winter wrote: > Ken: My idea for doing this goes something like: > > 1. For every session, let's say that the Django app's database > connection is with a user I'll call "myapp" here. User "myapp" has > the CREATEUSER privilege. > 2. Someone

Re: #23646 Enhancement: Updating multiple values in a single sql update using Django ORM

2014-10-17 Thread Russell Keith-Magee
Hi Anshuman, Firstly, a question like this is probably better suited to django-developers - that's the list where we discuss proposed modifications to Django itself. You're more likely to get the attention you need on that list. That said - I'm not sure I see the benefit here. I've left a

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Ken Winter
To keep this conversation fairly modular, I'm responding to different possible solutions in different posts. This one is about Carl's comments on: > 2. Have Django create a new *database user *for each session login, > using the user id that Django knows and that I want to record in the

File Storage API: save file to DB model and disk: separate disk path from file name

2014-10-17 Thread Jon Dufresne
Hi, I'm trying to use the File Storage API to create a custom handler for files. Here are my goals: Stored files are represented both in the database and on disk with the following model: class StoredFile(models.Model): name = models.CharField(max_length=255) path =

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Carl Meyer
Hi Ken, On 10/17/2014 01:09 PM, Ken Winter wrote: > On Thursday, October 16, 2014 12:13:20 PM UTC-4, Carl Meyer wrote: > > I don't see any way this is feasible, if you want it to cover raw SQL > executed through ``cursor.execute``. Are you planning to parse the SQL > for every raw

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Ken Winter
To keep this conversation fairly modular, I'm responding to different possible solutions in different posts. This one is about Carl's comments on: > 1. Stick some code into the database connector, as I described in > possibility 1 of my original post. I guess the connector would be >

#23646 Enhancement: Updating multiple values in a single sql update using Django ORM

2014-10-17 Thread Anshuman Aggarwal
Posting this Django Project ticket that I opened to track the enhancement request to update multiple rows with different values for the same field for a particular Django queryset in a single SQL query without having to write raw SQL. https://code.djangoproject.com/ticket/23646 A possible

Re: How to deny access to a logged user directly to a specific URL

2014-10-17 Thread Carl Meyer
Hello Martin, On 10/17/2014 11:08 AM, Martin Torre Castro wrote: > at my project we need some sort of system for allowing/denying some > access to an URL. > > The example, we want to make some kind of wizard. > > 1. The user inputs the first object at the the first screen (A screen), >

How to deny access to a logged user directly to a specific URL

2014-10-17 Thread Martin Torre Castro
Hello, at my project we need some sort of system for allowing/denying some access to an URL. The example, we want to make some kind of wizard. 1. The user inputs the first object at the the first screen (A screen), and then he press "Continue". 2. Now we get the data and redirect

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Daniel Grace
I installed pytz and this problem went away. Cheers -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this

Re: how to use __init__ in a form (passing an extra variable to the form)

2014-10-17 Thread Carl Meyer
On 10/17/2014 01:36 AM, dk wrote: > took me a little bit to get the self.fields, since I was trying to > override directly as ratiooo.choices. Yeah, metaclasses are confusing :-) > and I move the django.setup() to the top of the file after the imports > (meantime). not sure what it does, I

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Tom Evans
On Fri, Oct 17, 2014 at 4:14 PM, Daniel Grace wrote: > Hi, > I have the time zone set as follows: > TIME_ZONE='Europe/London' > USE_TZ = True > > This is the same as GMT. But what I want is BST (British Summer Time) for > display purposes, which is UTC + 1 for the "summer"

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Daniel Grace
The date function can only display the offset, it does not actually add the offset to the date time. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Carl Meyer
Hi Daniel, On 10/17/2014 09:14 AM, Daniel Grace wrote: > I have the time zone set as follows: > TIME_ZONE='Europe/London' > USE_TZ = True > > This is the same as GMT. But what I want is BST (British Summer Time) > for display purposes, which is UTC + 1 for the "summer" and UTC for the > rest of

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Kelvin Wong
https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#date K On Friday, October 17, 2014 8:14:12 AM UTC-7, Daniel Grace wrote: > > Hi, > I have the time zone set as follows: > TIME_ZONE='Europe/London' > USE_TZ = True > > This is the same as GMT. But what I want is BST (British Summer

How to display BST (British Summer Time)?

2014-10-17 Thread Daniel Grace
Hi, I have the time zone set as follows: TIME_ZONE='Europe/London' USE_TZ = True This is the same as GMT. But what I want is BST (British Summer Time) for display purposes, which is UTC + 1 for the "summer" and UTC for the rest of the year. How do I convert to this the value in my templates?

Re: making an http request internally

2014-10-17 Thread Collin Anderson
> > 1) If I simply call the view function obtained from resolve(), it will be > executed without middleware. I still want all the usual middleware > processing to occur though. > Undocumented, unsupported, but this might work: from myproject import wsgi response =

Re: django.views.decorators.http.condition decorator

2014-10-17 Thread Collin Anderson
I'm not an http caching expert, but what you say seems right. Want to open a ticket? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Solved: save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-17 Thread Mike Dewhirst
I discovered a unicode problem related to the degree symbol (°) when running under Python 2.7 and dealt with that. It somehow fixed the IntegrityError. One of those things I guess AWTEW Mike On 15/10/2014 9:40 AM, Mike Dewhirst wrote: Using Django 1.6.7, in the Admin if I change the name

OSQA multi language tutorial

2014-10-17 Thread Pavel Vanchugov
Helloevryone. Is there more detailed documentation for achieving multi language site on django? I don't even know what this is https://docs.djangoproject.com/en/1.4/topics/i18n/ All i can see is that django can "multi language" and that's it. -- You received this message because you are

Re: making an http request internally

2014-10-17 Thread Erik Cederstrand
> Den 17/10/2014 kl. 06.02 skrev jus...@fanout.io: > > I am writing a middleware class that needs to be able to make HTTP requests > to the application as part of it's processing. I'd like to be able to do this > internal to the Django app if possible, rather than having to make external >

Re: Django 1.7, KeyError: u'manager' error

2014-10-17 Thread Sanjay Bhangar
On Fri, Oct 17, 2014 at 2:53 PM, Taenyon Kim wrote: > Example > > class ModelA(models.Model): > fielda = models.CharField(max_length=10) > > class ModelB(models.Model): > modela = models.ForeignKey(ModelA) > fieldb = models.CharField(max_length=10) > > > When I

Django 1.7, KeyError: u'manager' error

2014-10-17 Thread Taenyon Kim
Example class ModelA(models.Model): fielda = models.CharField(max_length=10) class ModelB(models.Model): modela = models.ForeignKey(ModelA) fieldb = models.CharField(max_length=10) When I query like "modela_instance.modelb_set()", then I will get KeyError: u'manager' as shown

django.views.decorators.http.condition decorator

2014-10-17 Thread Anton Novosyolov
I have a question about this part: elif (not if_none_match and request.method == "GET" and res_last_modified > and if_modified_since and res_last_modified <= if_modified_since): > response = HttpResponseNotModified() If I don't use etag, and request method is HEAD then 200 is returned.

making an http request internally

2014-10-17 Thread justin
Hey list, I am writing a middleware class that needs to be able to make HTTP requests to the application as part of it's processing. I'd like to be able to do this internal to the Django app if possible, rather than having to make external requests to the webserver hosting the Django app.

Re: Upgrading Django (to 1.7)

2014-10-17 Thread Fred Stluka
Sounds good! Thanks! --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristle Software, Inc -- http://bristle.com -- Glad to be of service! Open Source: Without walls and fences, we need no

Re: how to use __init__ in a form (passing an extra variable to the form)

2014-10-17 Thread dk
thanks Carl, that was extremely clear, step by step. took me a little bit to get the self.fields, since I was trying to override directly as ratiooo.choices. and I move the django.setup() to the top of the file after the imports (meantime). not sure what it does, I know that just need to be