Adrian Holovaty wrote:
> I think we ought
> to bite the bullet and add request.method, which would be a shortcut
> to a normalized (all caps?) version of request.META['REQUEST_METHOD'],
> which is cumbersome to type and might not (?) always be upper case.
>
Per HTTP all request methods are defi
wow! will have a go right away thanks. :)
--~--~-~--~~~---~--~~
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, sen
on each poll add something like
user = models.ForeignKey(User, null=True, blank=True)
in the update/create views add something like
if request.user.is_anonymous():
return redirect_to_login(request.path)
try:
poll = Poll.objects.get( id= id )
except Compa
Hi, wishing to confirm if anyone has managed to do something similar.
Using terms from the tutorial at www.djangoproject.com, i wish to
- allow users (possibly upto 70 users) to create their own
Polls/choices
- but not (at least not easily) alter the Polls/choices that other
users have created
On 6/16/06, Dan M <[EMAIL PROTECTED]> wrote:
> http://django.pastebin.com/713980 contains my models.py and the
> traceback when my Python script dies. It parses the data file fine, and
> it does the first 2 get_or_creates just fine, but dies on the 3rd one.
> The last line of the traceback says:
>
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote:
> I'm not convinced that it'd be a good thing to have request.POST
> evaluate to True in these cases, but the reasoning is somewhat
> pedantic.
>
> First and foremost, there's a logical difference between the request
> method and the request par
I'm a strong believer is good documentation and there's a lot of
places Django could use better documentation. I encourage everyone to
add documentation to the wiki for things that aren't documented or
have sparse documentation.
I started with Django's free comments. Check it out and help p
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote:
> I'm not convinced that it'd be a good thing to have request.POST
> evaluate to True in these cases, but the reasoning is somewhat
> pedantic.
I put the comment on the ticket.
The use of request.POST seems overloaded to mean both "is it a pos
On Sat, 2006-06-17 at 17:59 -0700, [EMAIL PROTECTED] wrote:
> I'd like to have a non-admin interface for adding objects, but would
> like to use the form that the admin interface generates. Where do I
> snag it from?
django/contrib/admin/templates/admin/*
Start with change_form.html in that dire
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> There is already a way to test for posts via the request object:
> request.META['REQUEST_METHOD']. But your suggestion is not unreasonable,
> so best to file a ticket so that it can be considered without being
> forgotten.
I'm not convin
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> There is already a way to test for posts via the request object:
> request.META['REQUEST_METHOD']. But your suggestion is not unreasonable,
> so best to file a ticket so that it can be considered without being
> forgotten.
Filed:
http://
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> The implementation side is easy, if we decided to go this route: make
> sure that __nonzero__() on the MultiValueDict class returns the right
> thing in these cases.
Sorry, I dug around in python introspection docs a bit trying to find
w
Jeremy Dunck wrote:
> On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote:
>> Long version:
>> request.POST is (essentially) a dictionary of post variables. As such,
>> if it is empty, it evaluates to False, even if the request method is
>> 'POST'. In your form, you don't have a single 'successful'
I'd like to have a non-admin interface for adding objects, but would
like to use the form that the admin interface generates. Where do I
snag it from?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
On Sat, 2006-06-17 at 19:44 -0500, Jeremy Dunck wrote:
> On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> > Long version:
> > request.POST is (essentially) a dictionary of post variables. As such,
> > if it is empty, it evaluates to False, even if the request method is
> > 'POST'. In your for
On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote:
> Long version:
> request.POST is (essentially) a dictionary of post variables. As such,
> if it is empty, it evaluates to False, even if the request method is
> 'POST'. In your form, you don't have a single 'successful' field --
> the only field
On Sunday 18 June 2006 00:37, jacob wrote:
> I have an inbox template that generates a list of links to messages
> with the necessary trailing slash like this:
>
> blah blah
>
> That link takes you to the message view which has a form that looks
> like this:
>
>
>
>
Short version:
Yes, I've read http://code.djangoproject.com/wiki/NewbieMistakes
This is my URL list:
urlpatterns = patterns('',
(r'^admin/', include('django.contrib.admin.urls')),
(r'^settings/$','file.app.views.settings'),
(r'^inbox/$','file.app.views.inbox'),
(r'^sent/$','file
Yes, I was in debug. Both calling db.reset_queries() and setting debug
= False fixed the issue.
Thanks everyone!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
And as a side note, if I switch it to a DateTimeField, then everything
works perfectly.
Jay P.
--~--~-~--~~~---~--~~
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@
My current model looks like this:
class Article(models.Model):
title = models.CharField(maxlength=64)
slug = models.SlugField(prepopulate_from=("title",))
author = models.ForeignKey(User)
text = models.TextField()
pub_date = models.DateField()
public = models.BooleanField(
Not that way anymore. I will just check (in the middleware) if the
requested entry's author is the logged in user (for edit action) if not
throw exception.
--
Adam Hoscilo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Just curious -- so now you're going to tie your middleware to the
model? ;-)
The MV(C|T) police will come after you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
You're right - my fault.
It just isn't the way I would like to handle this problem.
But I've forgotten about middleware and I think this will be the best
way to solve this _issue_ without breaking MVC(MVT) schema (just check
if the requested object was created by user).
--~--~-~--~~-
But Luke *is* proposing to do this in a manager. The middleware just
makes the current user available in the model/manager. (if you want it
to be)
Rather than a hack, the functionality that his middleware module
provides seems to me a missing part in a mostly very pragmatic
codebase, but I digres
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> > def get_absolute_url(self):
> > return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug
> >
> > But it seems like there'd be a cleaner way (ie. not having to call
> >
On 6/17/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> def get_absolute_url(self):
> return "/articles/" + self.pub_date.replace("-","/") + "/" + self.slug
>
> But it seems like there'd be a cleaner way (ie. not having to call 'replace')
def get_absolute_url(self):
return "/articles/%s/%s" %
Maybe it's too hot, and my mind isn't working straight, but I can't
figure out the best way to write my 'get_absolute_url' for objects
that will live in date based URLs, ie.
class Article(models.Model):
title = models.CharField(...)
slug = models.SlugField(...)
pub_date = models.DateF
[EMAIL PROTECTED] wrote:
> Hi all,
> I'm trying to run a project hosted in Bluehost, it only supports fcgi.
> I'm an apache guy.
> Anyone have a project maded with Django hosted in Bluehost?
I don't use Bluehost, but I think the setup will be similar to Django on
DreamHost, which supports Fast
Hi!
I'm glad to announce the french translation of Django tutorials.
http://www.biologeek.com/journal/index.php/traduction-francaise-de-la-documentation-de-django-le-framework-web-python
I hope it's just the beginning, feel free to add corrections and/or to
participate.
Cheers,
David Larlet
--~
But it's some kind of a hack that I don't want to have in my app.
It's easy to achieve this by get/filter in views - but manager would be
more secure(error-proof).
--
Adam Hoscilo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
I don't know of a way to do this by a calculated fraction of the total
items in the list, but you can use the slice filter to break it up
into groups of a set number:
{% for object in object_list|slice:":5" %}
{% for object in object_list|slice:"5:10" %}
etc.
There's also a handy trick if you
On 6/16/06, mamcxyz <[EMAIL PROTECTED]> wrote:
>
> Sorry, when I say easy_setup I mean easy_install ;)
>
> (I run it easy_install-2.4 mysql-python)
>
You need to have the develpment support files (headers, libraries)
of the zlib package installed (zlib-devel package in RHL/FC/CentOS?)
Anyway, th
On Saturday 17 June 2006 10:50, Adam Hoscilo wrote:
> I would like to filter entries from a logged in user and give him/her
> the ability to edit them - it would be nice to ensure that scope by
> manager.
> As far as I know Models don't have access to request and session data
> (and I realize it'
I would like to filter entries from a logged in user and give him/her
the ability to edit them - it would be nice to ensure that scope by
manager.
As far as I know Models don't have access to request and session data
(and I realize it's a MVC/MVT schema violation). Is there any way to
manage that
Hi,
Is there a way to split a list using the built-in tags and filters?
What I want is to take an object list from a generic view and iterate
over the first and second halfs separetely. e.g.
{% for object in object_list|firsthalf %}
...
{% endfor %}
{% for object in object_list|secondhalf %}
..
Hi all,
I'm trying to run a project hosted in Bluehost, it only supports fcgi.
I'm an apache guy.
Anyone have a project maded with Django hosted in Bluehost?
Thanks,
Nuno
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
oggie rob wrote:
> > I've thought about an url like "/company1/admin" that will display me only
> > the "periodical" and "article" that belongs to company1.
>
> Just be sure this is what you want. There may be times where you wish
> to completely separate each company's data - in which case, you
38 matches
Mail list logo