return render_to_response(...)
On Apr 18, 7:52 am, David Lindquist wrote:
> Thanks Georg. I will give that a try.
>
> On Apr 18, 7:45 am, "ge...@aquarianhouse.com"
>
>
>
>
>
> wrote:
> > ok now i got it :)
>
> > i would do this:
&
=False)
> m.user = request.user
> m.save()
>
> something like this :)
>
> On Apr 18, 4:32 pm, David Lindquist wrote:
>
>
>
>
>
> > Thanks for the reply.
>
> > The problem I have with that solution is that it occurs after form
> > validation take
another way to accomplish this?
On Apr 18, 3:14 am, "ge...@aquarianhouse.com"
wrote:
> use commit=False
>
> m = form.save(commit=False)
> m.user = request.user
> m.save()
>
> On Apr 18, 6:06 am, David Lindquist wrote:
>
>
>
>
>
> > Greetings,
>
&
Greetings,
I am trying to solve what seems like an easy problem, but the solution
eludes me even after many Google searches.
I have a simple model:
class Site(models.Model):
user = models.ForeignKey(User)
url = models.URLField()
class Meta:
unique_together = (('user', 'url')
D'oh! OK, I am an idiot. I did not create the app with `manage.py
startapp`. I simply created the directory on the command line. Django
does in fact complain.
Guess I got what I deserved ;)
On Jul 13, 4:01 pm, David Lindquist wrote:
> Hi Everyone,
>
> I discovered by accident th
Hi Everyone,
I discovered by accident that if you have an app with the same name as
the project, then `python manage.py shell` (and similar commands)
cannot import the settings file. I assume this is due to how Django
updates sys.path.
I would expect Django update sys.path to look in the project
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 f
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
On Mar 25, 2009, at 4:54 PM, Russell Keith-Magee wrote:
>
> On Thu, Mar 26, 2009 at 8:42 AM, Joshua Partogi
> wrote:
>>
>> Is there any chance dmigrations
>> (http://code.google.com/p/dmigrations/) will be merged into django
>> codebase? Because it removes the pain for db migrations :-D
>
> d
On Mar 24, 2009, at 10:09 AM, Alan wrote:
> Hi there,
>
> It's a bit off topic but I guess appropriate anyway.
>
> So I want to use '$Id$' in my *.py files where '$Id$' got replaced
> when I commit my files via svn.
>
> But I googled and I still couldn't make it work. Can somebody tell
> to m
On Mar 24, 2009, at 10:09 AM, Alan wrote:
> Hi there,
>
> It's a bit off topic but I guess appropriate anyway.
>
> So I want to use '$Id$' in my *.py files where '$Id$' got replaced
> when I commit my files via svn.
>
> But I googled and I still couldn't make it work. Can somebody tell
> to m
I have a client that maintains several hundred small web sites
running on dozens of different machines all over the world. These
sites have common data (footers, privacy policy pages, etc.) he would
like to manage through a single CMS. Currently, he uploads all the
changes manually using F
Is there an easy way to see a list of all the context variables and
their values available in a given template?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send emai
n who
> influences what gets used in various situations. It's in those
> situations that you'll get to grab your favorite tool: Django.
>
> Jon Loyens
> Thinktiv, Inc.
>
> On Jan 11, 1:14 am, Malcolm Tredinnick
> wrote:
>> On Sat, 2009-01-10 at 15:38 -0700, D
First, I understand that the world economy is in a slump, and that
the job market as a whole has not fared well of late. But even before
the recent downturn, I noticed that there are precious few jobs in
Django development (yes, I know about DjangoGigs.com). A simple
keyword search on popu
On Jan 7, 2009, at 4:15 PM, bruno desthuilliers wrote:
>
> On 7 jan, 23:37, David Lindquist wrote:
>> I would like to return a binary file from a view, and so far I have
>> something like this:
>>
>> def my_file(request):
>> file_data = open("/pat
I would like to return a binary file from a view, and so far I have
something like this:
def my_file(request):
file_data = open("/path/to/file", "rb").read()
response = HttpResponse(file_data, mimetype="application/
whatever")
response['Content-Disposition'] = 'attachment; file
Perfect. Exactly what I needed.
Thank you Russ
On Dec 16, 5:22 pm, "Russell Keith-Magee"
wrote:
> On Wed, Dec 17, 2008 at 9:04 AM, David Lindquist
>
> wrote:
>
> > I encountered a scenario where I need to query the database for a
> > list of names sor
I encountered a scenario where I need to query the database for a
list of names sorted by length. In SQL this is easy:
SELECT name from distributors_distributor ORDER BY LENGTH(name)
Instead of writing raw SQL in my view, I am doing this:
names = [x['name'] for x in Distributor.objects.values
On Dec 12, 2008, at 5:05 PM, waltbrad wrote:
>
> I'm using 1.0 -- I keep reading that there is supposed to be one in
> the upper right hand corner. I finally had to use Google images to
> find an illustration.
>
> But I don't have that link displayed. I do have the "change
> password / logout"
Perfect! I can't believe I overlooked that in the documentation.
Thanks Brian
On Dec 10, 2:15 pm, Brian Neal <[EMAIL PROTECTED]> wrote:
> On Dec 10, 2:31 pm, David Lindquist <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
> > I am building a simple news
Hello,
I am building a simple news app for my employer's website. I am using
Django's date-based generic views for the various pages. I want to
have a sidebar listing the archive by year and month like this:
2008
- November
- December
2009
- January
with each item linking to its view (year, m
22 matches
Mail list logo