Wiadomość napisana w dniu 2009-06-01, o godz. 18:50, przez Tim Sawyer:
>
> You need a RequestContext for the user object to be available in
> templates
>
> http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/
>
> I use a render_auth method instead of render_to_response
So that is what I have in os.environ with Apache :
LANG = en
TZ = France/Paris
DJANGO_SETTINGS_MODULE = setting.production
SHLVL = 1
APACHE_RUN_USER = www-data
APACHE_PID_FILE = /var/run/apache2.pid
PWD = /home/git/pyki/public
APACHE_RUN_GROUP = www-data
TMPDIR = /tmp/passenger.31221/var
HOME = /v
yes the problem using this method is that DRY principle is broken,
because you redefine the fields that are already defined
I was thinking of MixIn the 2 Forms to keep the whole thing reusable
but nevermind, if this is the only way, I'll do it like this.
thanks
On Tue, Jun 2, 2009 at 05:57, Risha
Hey,
I have some ajax running on my pages.
I want to have it pass back some objects. However, I am unsure if I
can pass a list of objects back. So far I have only ever passed back
raw xml or text. Can objects be passed and then iterated via the html
template?
Thanks
--~--~-~--~~
Hello Marc,
You can render a template into an string.
from django.template.loader import render_to_string
my_template = render_to_string('template.html',{'some':'data'})
If you want to send the list of objects to the browser you can use
serialization into json:
http://docs.djangoproject.com/en/d
Well i only say the e.save() line causes social mayhem as when doing a
line by line debug of that section, that's the command that causes all
the trouble. I suspected there's a problem with my dispatch.cgi
script, as if i were to manually add the table i get the same behavior
(though adding the r
On Jun 2, 6:03 pm, Damien MATHIEU <4...@dmathieu.com> wrote:
> So that is what I have in os.environ with Apache :
> LANG = en
> TZ = France/Paris
> DJANGO_SETTINGS_MODULE = setting.production
> SHLVL = 1
> APACHE_RUN_USER = www-data
> APACHE_PID_FILE = /var/run/apache2.pid
> PWD = /home/git/pyki
I know I'm in the minority, but I'm still having some trouble grokking
the details of generic views. I keep thinking I should be using them
but keep running into the same issue.
Here's my problem: I am building a mgmt site for schools in which
schools sign up for a monthly service fee. Most of my
http://groups.google.com/group/django-users/browse_thread/thread/bde817d4620fdfec
On Tue, Jun 2, 2009 at 7:33 AM, Keyton Weissinger wrote:
> I know I'm in the minority, but I'm still having some trouble grokking
> the details of generic views. I keep thinking I should be using them
> but keep ru
Thanks Jorge,
Dajax looks very useful. Ill do it with Json though until Dajax
becomes mainstream. Thanks.
On Jun 2, 10:47 am, Jorge Bastida wrote:
> Hello Marc,
>
> You can render a template into an string.
>
> from django.template.loader import render_to_string
> my_template = render_to_string
On Jun 1, 7:53 pm, "bax...@gretschpages.com"
wrote:
> I'm trying to write a template tag that accesses the user's
> request.session. My problem is, I don't know how to get the request.
>
> Googling around, I saw references to including
> TEMPLATE_CONTEXT_PROCESSORS in settings, but I'm still no
Hi,
you can use this:
http://docs.djangoproject.com/en/dev/topics/auth/#authentication-data-in-templates
to add the user to the template context.
Then you cold write template tags to actually get the data you need
using the user template variable.
http://docs.djangoproject.com/en/dev/how
I'm doing a demo of some of our Django work soon. Partly, it'll be a
showcase for Django. One thing I'd like to do is demonstrate Django's
template filters, to show how powerful it is and how it can make a a
contribution to the quality of web output.
So far I have:
* typogrify
* humanize
Are th
If you just need the request obj passed to all pages. I use this in my
URLs:
# Custom Direct to template - carrys the request object
def direct_to_template(request, template):
from django.shortcuts import render_to_response
from django.template import RequestContext
return render_to_r
On Jun 1, 7:11 pm, Karen Tracey wrote:
>
> That comment, specifically, includes the same exception and traceback as you
> are showing. I read subsequent discussion in the ticket to be saying that
> the problem here is the markdown version, it's some pre-Unicode support
> level that you likely d
Hi,
I have been a Django user for a long time now but only recently ran
into
a position where have needed to use Generic relationships, I need to
be
able to do something similar to filtering on a GenericForeignKey.
Essentially I have a media management app that looks something similar
to the foll
I have successfully created a little app and i would like to leverage
the already existing admin interface rather than reinvent the wheel
and create my own table listings I have managed to do this fine
for simple models but in this case i have a custom queryset that i
would like to use.
Essen
Had the same issue and the info below allowed me to resolve the issue,
i.e. is_valid() is now returning True on a valid username/password
combination. Seemed to me that the key was setting the test cookie and
assigning the POST data into the 'data' variable. The former makes
sense to me. The latte
Hi,
Here is what I want to do:
I have one table A with two columns: user_id, msg_id (ManyTOMany)
and other table B with two column: msg_id, msg_time
Now I want to search for msg_id's of a certain user_id in table A, and
display the msgs
ordered by the msg_time.
Could anyone tell me how to do t
When I edit a User in the admin, the sales_team and user_class
dropdowns are empty.
If anyone can point out my error or point me to the django core code
that ignores the choices, I would greatly appreciate it.
#models.py
SALES_TEAM_CHOICES = enumerate(('CLS','CCS','TPS'))
USER_CLASS_CHOICES = en
Yes. I completely missed that ticket, but I had switched to importing
markdown normally instead of through Django, and it solved my
problems.
But I noticed on Ubuntu that the repository version of python-markdown
is still 1.6. So I will switch to a newer version of Markdown. Thank
you both for yo
On Tue, Jun 2, 2009 at 10:59 AM, ryan wrote:
>
> When I edit a User in the admin, the sales_team and user_class
> dropdowns are empty.
>
> If anyone can point out my error or point me to the django core code
> that ignores the choices, I would greatly appreciate it.
>
> [snip code]
I cannot rec
On Tue, Jun 2, 2009 at 9:42 AM, gsnyder2007 wrote:
>
> Had the same issue and the info below allowed me to resolve the issue,
> i.e. is_valid() is now returning True on a valid username/password
> combination. Seemed to me that the key was setting the test cookie and
> assigning the POST data int
This additional model, which uses the same choices is emptying the
choices dropdown of both User with inline UserProfile and UserProfile
itself. Add it prior to UserProfile in models.py of your test app:
class Person(models.Model):
sales_team = models.IntegerField(choices=SALES_TEAM_CHOICES)
On Jun 2, 4:53 pm, ryan wrote:
> This additional model, which uses the same choices is emptying the
> choices dropdown of both User with inline UserProfile and UserProfile
> itself. Add it prior to UserProfile in models.py of your test app:
>
> class Person(models.Model):
> sales_team = mode
On Jun 2, 3:04 pm, Larry wrote:
> Hi,
>
> Here is what I want to do:
>
> I have one table A with two columns: user_id, msg_id (ManyTOMany)
> and other table B with two column: msg_id, msg_time
>
> Now I want to search for msg_id's of a certain user_id in table A, and
> display the msgs
> ordered
Hi all,
When creating a new django based website, my first step used to be to
invoke "python manage.py startproject". The files created would be the first
or second commit into version control for that project.
I found, however, that I would always make a similar set of changes right
after:
Thank you sir. I got this from "Python Web Dev. w/ Django".
An unforseen side effect.
ryan
On Jun 2, 12:05 pm, Daniel Roseman
wrote:
> On Jun 2, 4:53 pm, ryan wrote:
>
> > This additional model, which uses the same choices is emptying the
> > choices dropdown of both User with inline UserProf
We've got an application that is running behind apache, mod_wsgi and
front ending a postgres 8.3 db. We needed to upgrade our Satchmo to
the latest version which requires Django 1.1. After the upgrade the
system starts eventually running out of memory until it thrashes and
locks up the machine un
Hi.
I'm trying to override the defaults of an text field in an subclass. I
thought i could accomplish that by the following code, but
models.TextField(default = default('flags')... wouldn't find default
(). I cant reference it by self.__class__.default() as the is no self
at the field initializat
In an application I'm writing I have a model that stores admins by
location in a model called LocationAdmin. So in this model I have a
foreign key to User and a foreign key to a Location object.
I would like to override the save() method so that when an Admin is
created they are assigned to a sp
OK - newb here (in more ways than one). I'm trying to get going on an
Ubuntu VM (inside VirtualBox) and I installed Django via synaptic.
The problem comes when I try to start the tutorial:
mor...@morgan-laptop:~/www$ django-admin startproject mysite
Error: [Errno 13] Permission denied: '/home/m
On Tue, Jun 2, 2009 at 12:46 PM, Technicalbard wrote:
> The problem comes when I try to start the tutorial:
>
> mor...@morgan-laptop:~/www$ django-admin startproject mysite
> Error: [Errno 13] Permission denied: '/home/morgan/www/mysite'
Quoting the tutorial:
"you may see the message “permissio
django-admin is executable. The problem appears to be that django-
admin doesn't have rights to the target directory...
On Jun 2, 11:52 am, James Bennett wrote:
> On Tue, Jun 2, 2009 at 12:46 PM, Technicalbard wrote:
> > The problem comes when I try to start the tutorial:
>
> > mor...@morgan-l
Technicalbard wrote:
> OK - newb here (in more ways than one). I'm trying to get going on an
> Ubuntu VM (inside VirtualBox) and I installed Django via synaptic.
>
> The problem comes when I try to start the tutorial:
>
> mor...@morgan-laptop:~/www$ django-admin startproject mysite
> Error: [Er
On 1 kesä, 22:38, Rami wrote:
> I'm trying to access Session's (logged in) user id info from a py
> function that does not have 'request' object.
You could write up something similar to get_language() in
utils.translation or use threadlocals. I don't know if this is
actually a good idea.
--~--
2009/6/2 eric.frederich :
>
> In an application I'm writing I have a model that stores admins by
> location in a model called LocationAdmin. So in this model I have a
> foreign key to User and a foreign key to a Location object.
>
> I would like to override the save() method so that when an Admin
Yes, this exactly what I want.
Thanks a lot!
-Larry
On Jun 2, 12:11 pm, Daniel Roseman
wrote:
> On Jun 2, 3:04 pm, Larry wrote:
>
>
>
>
>
> > Hi,
>
> > Here is what I want to do:
>
> > I have one table A with two columns: user_id, msg_id (ManyTOMany)
> > and other table B with two column: msg_i
Hi,
I'm using django svn 10784, and I've just added django-reversion, latest svn
version from trunk (198). I'm using the middleware option for django-
reversion.
It's not working, and I'm getting the following error. I've tried with the
same django version and the tagged 1.1.1 release of dja
Fixed it.
I was assigning a string to a date field. Django is ok with this, django-
reversion isn't.
Changed:
lDate = '%s-%s-%s' % (lYear, lMonth, lDay)
lContestEvent.date_of_event = lDate
to:
lContestEvent.date_of_event = date(int(lYear), int(lMonth), int(lDay))
and all appears fine.
Tim.
I am very new to this field..got a job as python programmer and was
asked to use django for web developmentHow do u think I should
start learning...I dont have much time left before they kick me
out!!
--~--~-~--~~~---~--~~
You received this message because
Hi!
Im trying to test my app with django test Client.
When I try to do 'get' to the '/accounts/' which in my urls.py is
equiv to generic login view I get DoesNotExists exception and a
traceback. check it here http://dpaste.com/50688/ .
Can You tell me what am I doing wrong ?
PS. when Im 'get'ing
Hi all,
is there any possibility to inform user in a Django admin about
anything from field class?
Let's have some custom field on a model. And I would like to inform
user about anything after he pushes save button in Django admin form.
class SomeField(models.FileField):
.
.
need to know the standard way that Django offers access to devices
such as printers and scanners on the client side
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send em
On Tue, Jun 2, 2009 at 4:46 PM, educonstantin wrote:
>
> need to know the standard way that Django offers access to devices
> such as printers and scanners on the client side
>
> >
>
Django doesn't. It's a server side web framework. It neither a) knows
about the client side, nor b) handles print
2009/6/2 virgo :
>
> I am very new to this field..got a job as python programmer and was
> asked to use django for web developmentHow do u think I should
> start learning...I dont have much time left before they kick me
> out!!
You must follow the tutorial, and the django book, first.
It
Hello,
I added a "telephone_number = models.CharField(max_length=15)" in the
"User" class in Django-1.0.2-final/django/contrib/auth/models.py. Now
I need to add/update telephone numbers on admin page. Which file
should I configure so that I can see this "telephone_number" on the
admin page?
Ca
On Tue, Jun 2, 2009 at 4:56 PM, David wrote:
>
> Hello,
>
> I added a "telephone_number = models.CharField(max_length=15)" in the
> "User" class in Django-1.0.2-final/django/contrib/auth/models.py. Now
> I need to add/update telephone numbers on admin page. Which file
> should I configure so th
On Tue, Jun 2, 2009 at 4:30 PM, SlafS wrote:
>
> Hi!
>
> Im trying to test my app with django test Client.
> When I try to do 'get' to the '/accounts/' which in my urls.py is
> equiv to generic login view I get DoesNotExists exception and a
> traceback. check it here http://dpaste.com/50688/ .
>
any hint on this issue?
Thanks, Sergio
On May 29, 12:51 am, "Sergio A." wrote:
> Dear all,
>
> Is it possible to select the template to be applied to an admin form
> based on the logged user?
> In particular, I've two cases:
>
> - if super user, a certain template should be used
> - if not a su
Thanks Alex
David
On Jun 2, 3:00 pm, Alex Gaynor wrote:
> On Tue, Jun 2, 2009 at 4:56 PM, David wrote:
>
> > Hello,
>
> > I added a "telephone_number = models.CharField(max_length=15)" in the
> > "User" class in Django-1.0.2-final/django/contrib/auth/models.py. Now
> > I need to add/update te
Thanks a lot!
That was it!
Regards
On 3 Cze, 00:21, Karen Tracey wrote:
> On Tue, Jun 2, 2009 at 4:30 PM, SlafS wrote:
>
> > Hi!
>
> > Im trying to test my app with django test Client.
> > When I try to do 'get' to the '/accounts/' which in my urls.py is
> > equiv to generic login view I get D
I'm pretty new to Django still and I know much is still escaping me.
In particular I'm having trouble still with how to query subsets of
related objects.
In this case I have two Models.
class Project(models.Model):
title = models.CharField(max_length=141)
...
class Release(models.Model)
On Tuesday 02 June 2009 22:09:03 Aaron Maxwell wrote:
> Over time, I'll discover something new I'll want to add to all my django
> sites. So I just make that change to django-skel and forget about it.
>
> Does anyone else follow this technique?
yes - I have only used the startproject startapp th
I know but, then again the set value for the language is only
retrievable from a request obj.
Thanks.
On Jun 2, 1:03 pm, akaariai wrote:
> On 1 kesä, 22:38, Rami wrote:
>
> > I'm trying to access Session's (logged in) user id info from a py
> > function that does not have 'request' object.
>
>
This is a weird one. It's so weird, I'm positive I'm making a very
dumb mistake somewhere. This is my MO.
Anyway, I am trying to use django-registration to do some very basic
login, logout stuff. I'm using RequestContext to make usernames
available to all of my templates, like so:
//views.py
fro
I have a small problem, fairly new to django:
I currently am building a small CMS application, and its all handled
by a Page model.
The url for this is:
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On Tuesday 02 June 2009 10:46:03 am Technicalbard wrote:
> OK - newb here (in more ways than one). I'm trying to get going on an
> Ubuntu VM (inside VirtualBox) and I installed Django via synaptic.
>
> The problem comes when I try to start the tutorial:
>
> mor...@morgan-laptop:~/www$ django-admi
Hello! I have hit a small road block in designing a fairly simple CMS
application:
My url pattern is:
url(r'^(?P[A-Za-z-_//]+)/$', page_handler, name='page_handler')
I'm capturing whatever URL handing it off to a page handler view
function that matches up a Page by slug and returns it .. this w
Just for everyone information, I believe Guido just said that Django
1.1 will be in future Google App Engine release once it (Django 1.1)
is out of beta.
Looking forward to this Django 1.1 final!
Link here:
http://code.google.com/p/googleappengine/issues/detail?id=872&colspec=ID%20Type%20Status
Hi,
About Django database migration. I know there's a couple of tools
available (South, evolution, dmigration, etc), but I am pondering an
alternative here. Hope good discussion entails.
This is what I am doing manually now for my database migration needs.
1. Use Django's management command "du
I am a newbie with Django and web stuff, but have long experience with
desktop databases.
In Django my user runs through a series of template.htmls choosing a
particular great great grandchild object, a house.
Then she must select a sales agent object. Just in general, how do I
arrange for the
On Wed, Jun 3, 2009 at 12:06 PM, Kegan wrote:
>
> Hi,
>
> About Django database migration. I know there's a couple of tools
> available (South, evolution, dmigration, etc), but I am pondering an
> alternative here. Hope good discussion entails.
>
> This is what I am doing manually now for my data
63 matches
Mail list logo