If what you mean is just to hide it from the user, try adding a hidden
input to the form and set its value as number. Now there is no need of
that number argument in the count's signature. Instead get number as
number = request.POST['number'].
--~--~-~--~~~---~--~~
Sorry for not including the code before. I've dpasted it now:
http://dpaste.com/123850/ .
Problem can be summarized as this: I've a model M with certain fields
and some foreign keys. I don't want the user to add/edit the FK
directly from M's ModelForm. Instead we'll do that in code from
certain
I'm working with a table of objects where all the objects have a
unique rank value. When I add an object I need to query the table to
get the last object in the rank index, then apply an incremented value
to the new object to effectively put it last in the rank order. I
need to eliminate the p
> There's a ticket open in Trac (my internet connection is terrible at the
> moment, so I'm not going to hunt it out) that is to add an option to the
> Meta class saying "this model is not to be managed by Django".
Thanks Malcolm, I'll definitely take a look and see if I can help out on
the ticket
On Mon, 2009-02-23 at 17:11 +1100, Malcolm Tredinnick wrote:
[...]
> There's a ticket open in Trac (my internet connection is terrible at the
> moment, so I'm not going to hunt it out) that is to add an option to the
> Meta class saying "this model is not to be managed by Django".
> Primarily, tha
On Mon, 2009-02-23 at 16:54 +1100, Ryan Kelly wrote:
> Hi All,
>
>
> I'm currently working on an authentication backend that adds some
> functionality to the standard one, and as part of this I want to modify
> the behaviour of the User class. I've been subclassing auth.models.User
> using st
Hi All,
I'm currently working on an authentication backend that adds some
functionality to the standard one, and as part of this I want to modify
the behaviour of the User class. I've been subclassing auth.models.User
using standard model inheritance and it seems to be working fine.
Howeve
You are awesome, Alex. That was exactly it. Many thanks!
Margie
On Feb 22, 9:08 pm, Alex Gaynor wrote:
> On Mon, Feb 23, 2009 at 12:05 AM, Margie wrote:
>
> > Anyone know what might be causing this error? It occurs when I fill
> > in one of my forms (ie, from the use interface). I seem to
On Mon, Feb 23, 2009 at 12:05 AM, Margie wrote:
>
> Anyone know what might be causing this error? It occurs when I fill
> in one of my forms (ie, from the use interface). I seem to never even
> get to the view.py function that processes the POST.
>
> Traceback (most recent call last):
> File "
Anyone know what might be causing this error? It occurs when I fill
in one of my forms (ie, from the use interface). I seem to never even
get to the view.py function that processes the POST.
Traceback (most recent call last):
File "/tools/aticad/1.0/external/python-2.5.1/lib/python2.5/site-
p
My experience is that using the the various conditional templatetags
is painful. I can never seem to do what I want, either because I'm
too much of a newbie or there is some gotcha such as "filters don't
work inside if" (I seem to remember something like that, but again, it
might just be my own p
On Sun, 2009-02-22 at 19:54 -0800, Chris wrote:
> Sorry, not sure how that happened. My browser wasn't even opened when
> those were sent.
>
> Anyways, thanks for the suggestion. However, nested if statements (why
> doesn't Django support elif?!)
Using "elif" wouldn't make things much simpler.
Sorry, not sure how that happened. My browser wasn't even opened when
those were sent.
Anyways, thanks for the suggestion. However, nested if statements (why
doesn't Django support elif?!) and multiple includes still seems very
awkward. I think I'll try using simple_tag to encapsulate my
permissi
No! It was the fact that you really need all the stuff that's on the
sample template
On Feb 22, 2:29 pm, Donn wrote:
> On Sunday, 22 February 2009 21:00:24 Theme Park Photo, LLC wrote:
> > {% block content %}
> > Hello
> > {% end block %}
>
> It's not this extra space between end and block i
On Sun, Feb 22, 2009 at 10:27 PM, Chris wrote:
>
> I'm displaying a list of records in a template. I want to
> conditionally display controls for each record if the current user is
> admin, or the user owns the given record (indicated by record.user ==
> request.user).
>
> What's the best way to
I'm displaying a list of records in a template. I want to
conditionally display controls for each record if the current user is
admin, or the user owns the given record (indicated by record.user ==
request.user).
What's the best way to do this? Logically, all I want to do is {% if
request.user.is
On Sun, Feb 22, 2009 at 10:13 PM, Chris wrote:
>
> I'm displaying a list of records in a template. I want to
> conditionally display controls for each record if the current user is
> admin, or the user owns the given record (indicated by record.user ==
> request.user).
>
> What's the best way to
I'm displaying a list of records in a template. I want to
conditionally display controls for each record if the current user is
admin, or the user owns the given record (indicated by record.user ==
request.user).
What's the best way to do this? Logically, all I want to do is {% if
request.user.is
I'm displaying a list of records in a template. I want to
conditionally display controls for each record if the current user is
admin, or the user owns the given record (indicated by record.user ==
request.user).
What's the best way to do this? Logically, all I want to do is {% if
request.user.is
On Sun, 2009-02-22 at 18:54 -0800, ajt111 wrote:
> In my above example
> It returns a dict with the key as "search[{{result.NAME}}] and the
> value as "{{result.CODE}}". This does not allow me to refer the the
> data that I want as "search".
Does "it" here mean the template that is rendered? Or
In my above example
It returns a dict with the key as "search[{{result.NAME}}] and the
value as "{{result.CODE}}". This does not allow me to refer the the
data that I want as "search".
What I want to end with is a form element that when submitted, will
produce a two dimentional dictionary object
Malcolm,
Thanks. Will give it a shot.
On Feb 22, 7:05 pm, Malcolm Tredinnick
wrote:
> On Sun, 2009-02-22 at 15:18 -0800, nixon66 wrote:
> > not sure I'm understanding how get_absolute_url to work.
>
> > in my model I created this
>
> > class State(models.Model):
> > name = models.CharField
On Sun, 2009-02-22 at 16:23 -0800, David MacDougall wrote:
> Hi Malcolm
> You are right about the essence of the problem.
> The value of photoobj is
> "'homepage.get_piece_dict.lead_story.get_lead_photo" and I am trying
> to get it to be an integer, the id of the photo I am trying to
> measure.
Hi Malcolm
You are right about the essence of the problem.
The value of photoobj is
"'homepage.get_piece_dict.lead_story.get_lead_photo" and I am trying
to get it to be an integer, the id of the photo I am trying to
measure.
I am wondering if I am losing the "homepage" dict by the time I get
t
On Sun, Feb 22, 2009 at 7:07 PM, CALdan wrote:
>
> Hi!
>
> I want to pass data from Django to populate javascript variables
> dynamically after page load. I'm using ajax.updater to call url's
> from Django to update div's within my pages but in some instances it
> would be of great use to pass j
Hi!
I want to pass data from Django to populate javascript variables
dynamically after page load. I'm using ajax.updater to call url's
from Django to update div's within my pages but in some instances it
would be of great use to pass just a variable instead of HTML code.
Is there a way of doing
On Sun, 2009-02-22 at 15:18 -0800, nixon66 wrote:
> not sure I'm understanding how get_absolute_url to work.
>
> in my model I created this
>
>
> class State(models.Model):
> name = models.CharField(max_length=80)
> slug = models.CharField(max_length=80)
>
> def __unicode__(self):
On Sun, 2009-02-22 at 22:56 +0700, Reza Muhammad wrote:
[...]
> > Doesn't work either. This one returns no results, just like chaining
> > filters.
> >
> I think the above was just a clue, if you need "OR" condition instead
> of "AND", you need to use "|" not "&" so:
>
> Project.objects.filter
I am glad to announce the first release of django-modeltranslation, a
Django app which can be used to translate dynamic content of existing
models to an arbitrary number of languages without having to change
the original model classes.
It uses a registration approach (comparable to Django’s admin
On Sat, 2009-02-21 at 21:58 -0800, ajt111 wrote:
> I want to create a multi-dimentional arry in a form element and
> convert that to a list of dicts.
>
> My form element looks like this:
>
>
If this as part of a loop? What is result? Does it have CODE and NAME
attributes or methods or keys?
>
On Sat, 2009-02-21 at 20:38 -0800, rajeesh wrote:
>
> Well, Let me re-phrase that question: I'm currently using the
> following line of code to populate text_input fields in the custom
> form:
> form.base_fields['r_date'].widget.attrs['value'] =
> obj.transaction.trans_date
> But is this acceptab
On Sat, 2009-02-21 at 15:37 -0800, Guri wrote:
> Hi,
> I need help in solving two small problems.
>
> 1. A form submitted, after validation calls HttpResponseRedirect
> (reverse('view.get_links',args=(request.POST['data'])))
>
> In url pattern
> (r'^links/(?P.*)/',get_links),
>
> I a
not sure I'm understanding how get_absolute_url to work.
in my model I created this
class State(models.Model):
name = models.CharField(max_length=80)
slug = models.CharField(max_length=80)
def __unicode__(self):
return self.name
def get_absolute_url(self):
ret
On Fri, 2009-02-20 at 22:03 -0800, David MacDougall wrote:
> Hi Malcolm,
> Thanks for your patient guidance. I took your advice on a better name
> for the variable. Now it should return true if the image_is_vertical.
> I am getting a lot closer, but I think I am losing the photo's ID
> when I get
On Sunday, 22 February 2009 21:00:24 Theme Park Photo, LLC wrote:
> {% block content %}
> Hello
> {% end block %}
It's not this extra space between end and block is it?
\d
--
Where I web: http://otherwise.relics.co.za/
Comics, tutorials, software and sundry
--~--~-~--~~
On Feb 23, 1:29 am, stevedegrace wrote:
> I don't think I'm understanding this very well. By doing some
> inspection, I see that Apache is running under two PIDs, which makes
> sense because ServerLimit right now is set to 2. What I'm wondering
> is, does each of those processes have a persiste
> Based on my experiments, it does seem like each Apache process
> maintains a live Django object which it reuses request after request
> and which maintains state such as global variables in modules between
> requests. Does that mean that a Django instance has some kind of loop
> in it that waits
On Feb 22, 4:53 pm, Brian wrote:
> My experience level: basic. I'm not a developer by trade and do it as
> a hobby. I'm pretty familiar with basic web development--HTML, CSS and
> js. I have explored PHP and other technologies to improve my
> development. Now I've started developing using Django+
Based on my experiments, it does seem like each Apache process maintains a
live Django object which it reuses request after request and which maintains
state such as global variables in modules between requests. Does that mean
that a Django instance has some kind of loop in it that waits for reques
I can't seem to get django-cms to work with template tags
If I specify as my default template something like (stripped to bare
essentials here)
FOO
{% block content %}
{% endblock %}
and enter in the body of my content for a page to be rendered with
this template (in the admin tool)
{% block
This only happens when you're logged in.
The comments app adds the e-mail of the currently logged in user if no
other e-mail is given.
Even if your site does not allow users to login, you might be logged
into the admin which is the same. Logout from the admin, try the
comment form again and the
My experience level: basic. I'm not a developer by trade and do it as
a hobby. I'm pretty familiar with basic web development--HTML, CSS and
js. I have explored PHP and other technologies to improve my
development. Now I've started developing using Django+App Engine
Datastore. I've got an applicat
On Feb 22, 2009, at 5:44 PM, 3xM <3...@detfalskested.dk> wrote:
>
>
>
> On Feb 21, 10:33 pm, Daniel Roseman
> wrote:
>
>> No need for custom SQL here. This might work:
>> Project.objects.filter(persons=person_a, persons=person_b)
>
> Nope. It just returns projects including person_b.
>
>
>>
Ok, I finally achieved this by overriding the inline formset, here is
all the code that I needed (in admin.py):
class WorkSeriesImagesFormset(BaseInlineFormSet):
def get_queryset(self):
return super(WorkSeriesImagesFormset,
self).get_queryset().order_by
('series_order')
I think you right iv got a config problem, but i don't know what it
is ?
ANother probleme. I used an FIleBrowserField on my model
image= FileBrowseField(max_length=200, initial_directory="/
photo_du_jour/", extensions_allowed=['.jpg', '.jpeg',
'.gif','.png','.tif','.tiff'], blank=False, null=Fal
On Feb 21, 2009, at 12:03 AM, Karen Tracey wrote:
> ...
> And you don't specify anything like secure sockets or STARTTLS
> required for the mail client?
>
> Lacking source to the mail client (which I'm assuming you don't
> have?) to compare what it does with what Django does, I'd
> probably t
I don't think I'm understanding this very well. By doing some
inspection, I see that Apache is running under two PIDs, which makes
sense because ServerLimit right now is set to 2. What I'm wondering
is, does each of those processes have a persistent instance of Django
in its own python process wai
Thanks Daniel, your guess was correct Id left out the handle stuff
competely. It appears to be working perfectly now!
Phil
On 22 Feb, 13:21, Daniel Roseman
wrote:
> On Feb 22, 1:00 pm, "phyl.jack...@gmail.com"
> wrote:
>
>
>
> > I have a little custom script that changes some database stuff and
On Feb 22, 1:00 pm, "phyl.jack...@gmail.com"
wrote:
> I have a little custom script that changes some database stuff and
> sends an email - I want to set it to run on a cron job.
>
> So Ive been trying to set it up as a custom django-admin command, Ive
> been trying to use this little bit of info
I have a little custom script that changes some database stuff and
sends an email - I want to set it to run on a cron job.
So Ive been trying to set it up as a custom django-admin command, Ive
been trying to use this little bit of info-
http://docs.djangoproject.com/en/dev/howto/custom-managemen
Ok thx
My browser project is on my_project_directory
my_project_directory/filebrowser/local
my_project_directory/filebrowser/templates
my media uploads are :
my_project_directory/media/uploads
here my config file :
my fb_settings.py :http://www.friendpaste.com/475iqfK57DsDWTYklXTlTs
my proje
Answering my own question: yes, it appears that it works, as long as
each view function that uses the client variable says "global client".
This brings up another question, concerning concurrency. I haven't yet
decided on whether the app will use processes or threads (probably
have to test both a
Hello,
sorry if I missed the obvious answer - however I haven't found one in
the last hour.
I have an image model that has both series and year models as foreign
keys - i.e. it belongs to both a series and a year and can be sorted
differently within either. For ease of use in the admin I would l
On Feb 21, 10:33 pm, Daniel Roseman
wrote:
> No need for custom SQL here. This might work:
> Project.objects.filter(persons=person_a, persons=person_b)
Nope. It just returns projects including person_b.
> Or you could probably do it with Q objects:
> Project.objects.filter(Q(persons=person_
Regarding compiling URLconf regexps in the documentation: "This is
blazingly fast, because the regular expressions are compiled at load
time."
If I'm reading that correctly, that means that the compiled regexps
are available to all requests, without recompilation, for the lifetime
of that particu
> "Malcolm" == Malcolm Tredinnick writes:
Malcolm> Atom sydnication and Atom publishing are standardised protocols
Malcolm> that have gone through the IETF process and are used in lots of
Malcolm> situations, weblogging being only one example.
Right.
Malcolm> The Metaweblog API has not had
thanks for the answer, it works and you are right: the
render_to_response line contains a typo.
Is there also another way to collect the number, so it isn't shown to
the user? I was trying to use a QueryDict, something like :
nb = request.GET.__getitem__('number')
but number is a string and not
There is a hacky way, which is not good practice and can probably mess
with your 3rd party photologue stuff:
from myproject1.photologue.models import PhotoSize
PhotoSize._meta.abstract = True
BR
Chee Ming
On Feb 22, 12:35 am, TiNo wrote:
> On Sat, Feb 21, 2009 at 16:04, Alex Gaynor wrote:
>
On Feb 20, 5:12 pm, Jacob Kaplan-Moss
wrote:
> On Fri, Feb 20, 2009 at 9:25 AM, ondrey wrote:
> > In my view I need to save locally a file (image) from a different
> > server so I can further process it. But I can't figure out how to do
> > it. Can someone help me with that?
>
> http://docs.pyth
there has never an issue/ticket posted about this (on the google-code
page of the filebrowser), so I guess there´s something wrong with your
configuration/setup ... you could try to debug by using print-
statements within the image-generator function.
On Feb 22, 8:02 am, leau2001 wrote:
> Patr
60 matches
Mail list logo