Hi All,
In my application I have a list of students. Each of those students has a
quite a few other models related to them via a foreign key. Eg:
> class Student(models.Model):
> name = models.CharField(max_length=64)
> surname = models.CharField(max_length=64)
> dob = models.DateFie
Alex Gaynor wrote:
> I guess technically you could just have 14 fields on the mode(open and
> close for each day of the week), which is fine since days of the week
> are a static number of things but that felt bulky to me(though it's
> probably more preformant).
The first issue that comes to mind
Hi Stephane,
I think it is a great idea. The lambda trick means I don't have to make
any changes at all to switch between my development environment and
production. A real life example from a current project:
-
from os.path import abspath, dirname, join
APP_PATH = lambda *x: abspath(join(dir
Cody Django wrote:
> ImageFields worked just fine until I moved to a new server. Now I get
> error messages "Upload a valid image". I know the images are fine,
> the media root and www_url are correct, so what else could this be?
> Ideas are greatly appreciated!
Do you have PIL installed on the
Catching up on my mailing list folders.
On 30/03/2009 10:10 AM, IanR wrote:
> So if I created my own I could just add it to this list and it would
> do what I need. Once my context_processor is made how would I add it
> to this list? Something like
> settings.TEMPLATE_CONTEXT_PROCESSORS.append(
rg/snippets/1350/
{% for video in video_list %}
{% if video.key in favorites.keys %}
... offer to remove
{% endif %}
{% endfor %}
Regards
Darryl
--
Darryl Ross
AFOYI, Information Technology Solutions
e: dar...@afoyi.com
p: +61 8 7127 1831
f: +61 8 8425 9607
--~--~-~--~~---
On 17/04/2009 11:26 PM, Christian Berg wrote:
> Sorry if this sounds harsh, but it is useless to learn how to drive a
> Truck, if you can't drive an car.
Slightly tangential, but not true! My Grandfather learned to drive a
truck in the army before learning to drive a car and failed his civilian
method of doing it for MySQL:
http://expressionengine.com/wiki/Sort_Entries_by_Title_Ignoring_The_A_An/
--
Darryl Ross, VK5LBJ
AFOYI, Information Technology Solutions
e: dar...@afoyi.com
p: +61 8 7127 1831
f: +61 8 8425 9607
--~--~-~--~~~---~--~~
You received th
Forgot one thing, this is on Django 1.0.2.
Regards
Darryl
On 22/05/2009 11:40 AM, Darryl Ross wrote:
> Hi All,
>
> I have searched around but not really found an answer to this. For a
> project I am working on the customer wants a list of publications to be
> sorted alph
On 22/05/2009 12:12 PM, Sam Chuparkoff wrote:
> On May 21, 10:10 pm, Darryl Ross wrote:
>> I have searched around but not really found an answer to this. For a
>> project I am working on the customer wants a list of publications to be
>> sorted alphabetically, but
On 06/09/10 19:09, kmpm wrote:
Regarding UUIDs, one of the business requirements (which I don't
control) is that the identifier that is to be used on barcodes and
what not is to be in the format "YYMMDD" where is the number
we are talking about. So UUID would be great and unique, as well
>> I was having problems with my text editor. For some reason Python
>> didn't like the way it handled tabs/spaces. I stopped using tabs and
>> started using spaces, and that seemed to fix the problem.
Your solution of using spaces instead of tabs to indent worked
perfectly!
The python inter
Hey All,
I'm using the generic views and trying to build a HTML table where both
the rows and columns are generated dynamically. Simplified example follows.
I am having a problem though in that I can't work out if it is possible
to reference an attribute of a model using a template variable.
Just to follow up for the archives.
What I was after is a getattr filter for the templates. Searching
djangosnippets.org has found a couple. This one seems to do what I need:
http://www.djangosnippets.org/snippets/411/
Regards
Darryl
Darryl Ross wrote:
Hey All,
I'm using the ge
NOT NULL PRIMARY KEY,
"code" varchar(32) NOT NULL UNIQUE,
"product_line_id" integer NOT NULL,
"name" varchar(128) NOT NULL,
"charging_cycle" varchar(16) NOT NULL,
"price" decimal NOT NULL,
"active" bool NOT NU
least point me in the
right direction.
http://www.google.com.au/search?q=django+render_to_string
--
Darryl Ross
Director
AFOYI, "Information Technology Solutions"
p 08 7127 1831
m 0400 206 443
f 08 8425 9607
e [EMAIL PROTECTED]
signature.asc
Description: OpenPGP digital signature
Duke wrote:
They are looping over a list
I am looking for
for (i = 0; i < 10; i++) {
printf("Hello, World!);
}
link for looping statement
I am not aware of any tag that will allow you to do that, out of the
box. You have two options, the first is to create a custom template tag
that d
Szaijan wrote:
Thanks Justin. Yes, I'm certain. And my previous install was also
some variety of 0.96, though I downloaded that one manually.
What was the complete SVN URL you used? You can get it with 'svn info'
in the directory you checked out the Django code to.
Regards
Darryl
signat
I believe you need to go to the 'settings' page and enter a name and
email address first.
Cheers
-D
Tyler Erickson wrote:
What do I need to do to edit the following page?
http://code.djangoproject.com/wiki/GeoDjango
It lets me enter edit mode and preview the changes, but when I try to
submit
Rodney Topor wrote:
Is there something strange about using CSS with Django? When I make
my templates refer to external CSS files, the appearance of the
template changes, but not the way the CSS file says it should? Is
there something special I need to know about this?
Nothing that I am aware
or is
pretty much self-container, then I will put them into the application
directory. If they are specific to the website, or someone else is
maintaining the HTML (I'm a programmer, not a artist!) then I'll put
them in a top level templates folder.
Regards
Darryl
--
Darryl Ross
b root, it needs to point at the admin media directory in your django
source. I have:
Alias /admin-media/ /opt/django-trunk/django/contrib/admin/media/
SetHandler none
Regards
Darryl
--
Darryl Ross
Director
AFOYI, "Information Technology Solutions"
p 08 7127 1831
m
Richard Atkinson wrote:
Hello all! Been lurking for a while, this is my first post.
Welcome!
I understand that RequestContext is required in order to access
{{ MEDIA_URL }} in templates. I have two questions related to this.
1. Please could somebody give an example of how to pass RequestCo
Hi All,
I'm using the templating system to send emails, but the templates are
being autoescaped. Now, I know I can use {% autoescape off %} in my
template files, but the logic I use to build the email body is similar to:
template_name = 'emails/generic.txt'
if condition1:
template_nam
James Bennett wrote:
On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote:
So my question is, is there an argument which will disable auto-escaping?
If not, would there be some merit to adding some functionality that allows
this, either as an argument or perhaps to ma
On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote:
So my question is, is there an argument which will disable auto-escaping?
Nevermind me, the version of code I was reading on my dev machine
through was older than I thought, pre-autoescaping. I did an update and
陈亮 wrote:
Hi there,
I've googled a lot on how to get the sum of a integer field for all
the objects of a model. There are some solutions. But none of them looks
like a standard way to do so. Does django have this feature?
I use:
total = sum([obj.amount for obj in Model.objects.all()])
o restart
your Django instance. If you wait for a few days I'll be making an
announcement in that regards.
Cheers
Darryl
--
Darryl Ross
Director
AFOYI, "Information Technology Solutions"
p +61 8 7127 1831
f +61 8 8425 9607
e [EMAIL PROTECTED]
signature.asc
Description: OpenPGP digital signature
Ryan Vanasse wrote:
Trying to get the outer for loop working is something that I don't
really understand. I think that what I have now isn't going to work
because I'm using a dictionary reference on what was transmuted into
the Context, so that "eventsByMonth" doesn't exist...
I've been trying
Hi Bret,
Can't see that anyone else has responded to this.
Bret W wrote:
There are many times when I can enter a username and password, click
the "login" button, and get the username/password don't match error.
The error page (/accounts/login, using example template from docs)
automatically fi
Lee Hinde wrote:
After the line item is saved, I want to call the Work Order to have it
update a Total Due column. Assuming I have the code in the Work Order
model to get all the related line items and sum the extended price,
what I would do is call the Work Order save() method from the Line
Item
Szaijan wrote:
Is there a way to access the URL values assigned to the view names
within a view? Perhaps something less inelegant than importing
urls.py and searching for the view name in the tuple? Otherwise I've
traded hardcoding URLs into one template for hard coding them into 5+
views.
Do
Darryl Ross wrote:
Szaijan wrote:
Is there a way to access the URL values assigned to the view names
within a view? Perhaps something less inelegant than importing
urls.py and searching for the view name in the tuple? Otherwise I've
traded hardcoding URLs into one template for hard c
roperty
def month_is_even(self):
return self.start_DateTime.month % 2 and False or True
That code is of course making the assumption that start_DateTime can
never be Null, or you're likely to end up with an exception: "NullType
has no property month"
Cheers
Darryl
--
Julien wrote:
I'm using EmailMessage to send a newsletter. It works fine except that
some characters are escaped in the plain text version. For exemple,
"é" becomes "é".
If you are using the django template engine to build the body of your
emails, you can either use the 'safe' template variabl
Kevin wrote:
> models.TestLine.objects.filter(dimm__size=1024).filter(dimm__size=2048)
>
> This returns an empty set, but I know there is a test with multiple
> dimm objects and meets this criteria. Is there a limitation that I'm
> missing here? Is there an alternative method to accomplish the in
Hey All,
I'm after a way of limiting what choices are populated into a drop-down
box from a foreign key field when I'm using the generic create/update views:
What I am trying to achieve is to be able to limit the list of domains
that a reseller can apply to their customer objects to domains that
Note: Resending as this hasn't shown up on the list after 3 hours.
Appologies if it does decide to make an appearance.
Hey All,
I have an app that has quite a few models in it, so I am trying to split
it out into a package, but when I do the models do not show up in the
admin interface and
Hi Daniel,
> class Foo(models.Model)
> some_field = models.CharField(max_length=200)
> class Meta:
> app_label = 'app'
Thanks for that, as soon as I added the app_label to the Meta class it
started working.
Regards
-D
signature.asc
Description: OpenPGP digital signature
Hey All,
I have an app that has quite a few models in it, so I am trying to split
it out into a package, but when I do the models do not show up in the
admin interface and running 'manage.py sqlall app' does not show any SQL
statements for creating the tables.
Is there a trick to doing this?
The
Melech Ric wrote:
> Actually, I've tried that and the web i/f doesn't think I'm subscribed.
> It's rather odd. I subscribed through the form on the django site and
> didn't realize it was a google group until the mail started showing up.
> I'd have rather done it through google's web i/f had I know
Patrick Ohearn wrote:
> I have tried adding the following lines to by models.py.
>
> author = models.ForeignKey(User)
> author = models.ForeignKey(django.contrib.auth.models.User)
>
> Both to no avail, thank you for your help so far :)
Perhaps a more complete example might help you:
{{{
Tane Piper wrote:
> As you can see in the Branch model, there is a field called num_leafs
> - I've been reading the signals documentation and had a look on the
> web, but I'm still having difficulty getting my head around it. What
> I want to do is when a leaf is saved, on the post_save signal I w
AmanKow wrote:
> I am curious as to whether the django community cannot comfortably do
> away with support for python 2.3 in the effort towards django 1.0.
RHEL4 (and hence CentOS 4) still uses 2.3.4.
I do not know what the other commercially supported distros are running,
but I would imagine the
msoulier wrote:
> I want to split this javascript out. Has anyone tried templating
> javascript like any other file? I'm going to try it out, but I thought
> I'd ask if anyone knew of any problems, or any better way to do this.
I've done this is CSS files before, so it should work just fine. Just
dave's not here wrote:
> I'm trying to help out a friend in a bind whose programmer is no
> longer reachable, and have a few newbie questions. I've just started
> working with both python and django, and am working my way thru the
> python and django tutorials; my background is with perl and php.
Kenneth Gonsalves wrote:
>
> On 03-Dec-07, at 10:38 AM, dave's not here wrote:
>> Thanks for the quick reply. The problem is I don't currently have
>> shell access to the server, only ftp. Is there anything I can put into
>> one of the .py or template files?
Create a view that imports django and
Hi Tane,
[untested with Many2Many, but should work, it works for ForeignKeys]
In your Entry save() method call the save method of each of your related
categories after you do your super().save()
{{{
class Entry(models.Model):
...
def save(self):
if not self.slug:
self
Hey All,
One of the websites I run has started getting spam via the contact form.
What is the recommended way of dealing with this? Do I need to go the
route of using something like django-captcha?
Thanks for any insight.
Regards
Darryl
signature.asc
Description: OpenPGP digital signature
John Lenton wrote:
> recaptcha:
> http://recaptcha.net/
Looks like an interesting project, I will check it out. Thanks.
Regards
Darryl
signature.asc
Description: OpenPGP digital signature
50 matches
Mail list logo