Re: How many Django web pages does it take . . .

2012-01-08 Thread Lachlan Musicman
On Sat, Jan 7, 2012 at 16:10, Alec Taylor  wrote:
> What you are talking about is a form.
>
> Form: https://docs.djangoproject.com/en/dev/topics/forms/
> Autocomplete: https://code.djangoproject.com/wiki/AutoCompleteSolutions
> Unique fields: https://docs.djangoproject.com/en/1.3/ref/forms/validation/

This last page has what I consider an error/bug but I'm not sure how
to judge that, nor what to report against.

At the top of the page, under the heading, it states:

"Changed in Django 1.2: Please, see the release notes"

because it's the docs for django1.3.

As a native English speaker, I consider the comma incorrectly used - I
felt *compelled* ("Please, see...") to visit the documentation from
1.2 rather than merely advised ("Please see...").

The page in question in svn is here
https://code.djangoproject.com/browser/django/trunk/docs/ref/forms/validation.txt
which refers to the function versionchanged which happens to be search
for since it's on a lot of doc pages...

Anyway, FYI

cheers
L.



>
> On Sat, Jan 7, 2012 at 11:56 AM, Bill Beal  wrote:
>> Hi all,
>>
>> I've been doing Django and mostly backend Python for a few months, and
>> I don't really know the limits of what can be done without resorting
>> to JavaScript and Ajax. Here's what I need to do: the user wants to
>> pick an individual from one of a number of lists and have the detailed
>> information come up editable for the one picked. My top-level list is
>> [Lions, Tigers, Bears, All]. The user picks Tigers, and then I present
>> the second-level Tigers list: [Tony, Hobbes, Tigger, Rajah]. The user
>> picks Hobbes, and then I present the detailed information for Hobbes
>> in an editable form: name, address etc. How clunky does this have to
>> be, in terms of mouse clicks and pages downloaded? I've read in more
>> than one place that if you use JavaScript you'd better have a version
>> of your page that works OK without it.
>>
>> For extra credit, what high-powered tools would be needed to do
>> autocompletion, for example the user starts typing "Hobbes" into the
>> Name field and as soon as I find a unique match I present the details?
>> Or, show a list of possible matches when the partial field is not
>> unique?
>>
>> I've been reading books, but most of them just show me how to build a
>> particular kind of website using Django.
>>
>> Thanks for any help you can lend!
>>
>> Bill Beal
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: localization in python code (views, models etc)

2011-07-11 Thread Lachlan Musicman
On Mon, Jul 11, 2011 at 21:02, stan  wrote:
>>
>> > class Book(models.Model):
>> >    title = models.CharField(max_length=120)
>> >    date_published = models.DateField()
>>
>> Big tip - if you *actually* need a date_published field, use a string :)
>
> Sorry, but I don't get it.
>
> You mean a CharField, right ?

Yah, sorry. I actually needed to write a "Books" app for some
translation data entry that needed doing at my local Uni - and Char
was plain easier for search and sort than Date - and very few books
have the month/day details - think about what you actually need the
date_published field for: search and sort and that's about it. You do
not need to do any maths with it. Use the Char.

cheers
L.


-- 
Schweigt stille, plaudert nicht (Be still, stop chattering) (aka The
Coffee Cantata) (BWV 211) is a secular cantatawritten by Johann
Sebastian Bach between 1732 and 1734. In a satirical commentary, the
cantata tells of an addiction to coffee, a pressing social problem in
eighteenth century Leipzig, where this work was premiered. (via
http://bestofwikipedia.tumblr.com/ )

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: localization in python code (views, models etc)

2011-07-11 Thread Lachlan Musicman
On Mon, Jul 11, 2011 at 18:58, stan  wrote:
> Hi,
>
> Maybe I missed something, but I didn't found any explanation in the
> doc about how to localize a date or a number in the python code side.
> Maybe I am totally wrong about wanting to do that but I can't see a
> solution to resolve the following problem in the template (where
> localization should be processed, I agree).
>
> The typical use case is in the admin_list when you have a method in
> list_display or MyModel.__unicode__() that return a string with a date
> or a number. For example :
>
> from django.utils.formats import localize
>
> class Book(models.Model):
>    title = models.CharField(max_length=120)
>    date_published = models.DateField()

Big tip - if you *actually* need a date_published field, use a string :)

I know I'm not answering the question, apols, but the kids are
screaming for dinner etc.

L.


>    price = models.DecimalField(max_digits=8, decimal_places=2)
>
>    def __unicode__(self):
>        return u"%s - %s $" % (localize(self.date_published),
> localize(self.price))
>
>
> Is that usage discouraged and the reason for not being documented ?
>
> If not, do I have to open a ticket with a path for this page :
> https://docs.djangoproject.com/en/dev/topics/i18n/localization/ ?
>
> Best regards.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
>
>



-- 
Schweigt stille, plaudert nicht (Be still, stop chattering) (aka The
Coffee Cantata) (BWV 211) is a secular cantatawritten by Johann
Sebastian Bach between 1732 and 1734. In a satirical commentary, the
cantata tells of an addiction to coffee, a pressing social problem in
eighteenth century Leipzig, where this work was premiered. (via
http://bestofwikipedia.tumblr.com/ )

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Hello Django developers

2011-02-06 Thread Lachlan Musicman
On Mon, Feb 7, 2011 at 11:40, Russell Keith-Magee
 wrote:
> On Mon, Feb 7, 2011 at 6:24 AM, Juan Antonio Infantes  
> wrote:
>> Hi,
>>
>> My name is Juan Antonio (aka ersame) from Spain and I am a computer science
>> student . I have been enrolled in some Django projects since September 2010.
>>
> Your patch addresses the problem in a reasonable way, there's a test
> to validate the edge case in question. There's no docs required
> because it's just a bug. That's all we need, so I've just marked the
> ticket Ready For Checkin.

Juan, Congrats!
L.

-- 
Crunchiness is the gustatory sensation of muffled grinding of a
foodstuff. Crunchiness differs from crispiness in that a crispy item
is quickly atomized, while a crunchy one offers sustained, granular
resistance to jaw action. While crispiness is difficult to maintain,
crunchiness is difficult to overcome.
from The Best of Wikipedia http://bestofwikipedia.tumblr.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Localisation

2011-01-20 Thread Lachlan Musicman
Hola,

on the users list, David Walker bought up a discussion on Localisation
that I was able to help him with. His follow up was detailed (settings
precedence and en_GB date formats) and well beyond my ability to
answer correctly.

The thread is here:

http://groups.google.com/group/django-users/browse_thread/thread/ad2feacf8b0eb402?hl=en&tvc=2&q=Localisation

The response I mention is here:

http://groups.google.com/group/django-users/msg/fb9460d714c5ce50?hl=en

Since I'm not exactly clear about these issues, I can't really even
know what to list as being the problem, whether it's a bug in the
core, an error in docs or clarification of docs required...etc, sorry.

Cheers
L.

-- 
"There are all kinds of pedants around with more time to read and
imitate Lynne Truss and John Humphrys than to write poems,
love-letters, novels and stories it seems. They whip out their
Sharpies and take away and add apostrophes from public signs, shake
their heads at prepositions which end sentences and mutter at split
infinitives and misspellings, but do they bubble and froth and slobber
and cream with joy at language? Do they ever let the tripping of the
tips of their tongues against the tops of their teeth transport them
to giddy euphoric bliss? Do they ever yoke impossible words together
for the sound-sex of it? Do they use language to seduce, charm,
excite, please, affirm and tickle those they talk to? Do they? I doubt
it. They’re too farting busy sneering at a greengrocer’s less than
perfect use of the apostrophe. Well sod them to Hades. They think
they’re guardians of language. They’re no more guardians of language
than the Kennel Club is the guardian of dogkind."
Stephen Fry

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Issue 14878 And Changeset 15133

2011-01-07 Thread Lachlan Musicman
On Fri, Jan 7, 2011 at 18:05, Gert Van Gool  wrote:
> Not really related to #5373, since it's related to the new generic views code.

I thought it might be a stretch, not knowing enough of the underlying
code, but the phrase "the verbose name of a model
includes a translation string" reminded me...

cheers
L.


>
> -- Gert
>
> Mobile: +32 498725202
> Twitter: @gvangool
> Web: http://gert.selentic.net
>
>
> On Fri, Jan 7, 2011 at 00:26, Lachlan Musicman  wrote:
>>
>> 2011/1/7 Diego Andrés Sanabria Martín :
>> > A few weeks ago i report this issue, 14878[1], and Rusell fix it, but
>> > i think still there is a possible bug, if the verbose name of a model
>> > includes a translation string.
>>
>> Is this related to http://code.djangoproject.com/ticket/5373 ?
>>
>> cheers
>> L.
>>
>>
>> --
>> "... imagine a puddle waking up one morning and thinking, 'This is an
>> interesting world I find myself in - an interesting hole I find myself
>> in - fits me rather neatly, doesn't it? In fact it fits me
>> staggeringly well, must have been made to have me in it!' This is such
>> a powerful idea that as the sun rises in the sky and the air heats up
>> and as, gradually, the puddle gets smaller and smaller, it's still
>> frantically hanging on to the notion that everything's going to be
>> alright, because this world was meant to have him in it, was built to
>> have him in it; so the moment he disappears catches him rather by
>> surprise."
>> Douglas Adams
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers" group.
>> To post to this group, send email to django-develop...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-developers+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-developers?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
>
>



-- 
"... imagine a puddle waking up one morning and thinking, 'This is an
interesting world I find myself in - an interesting hole I find myself
in - fits me rather neatly, doesn't it? In fact it fits me
staggeringly well, must have been made to have me in it!' This is such
a powerful idea that as the sun rises in the sky and the air heats up
and as, gradually, the puddle gets smaller and smaller, it's still
frantically hanging on to the notion that everything's going to be
alright, because this world was meant to have him in it, was built to
have him in it; so the moment he disappears catches him rather by
surprise."
Douglas Adams

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Issue 14878 And Changeset 15133

2011-01-06 Thread Lachlan Musicman
2011/1/7 Diego Andrés Sanabria Martín :
> A few weeks ago i report this issue, 14878[1], and Rusell fix it, but
> i think still there is a possible bug, if the verbose name of a model
> includes a translation string.

Is this related to http://code.djangoproject.com/ticket/5373 ?

cheers
L.


-- 
"... imagine a puddle waking up one morning and thinking, 'This is an
interesting world I find myself in - an interesting hole I find myself
in - fits me rather neatly, doesn't it? In fact it fits me
staggeringly well, must have been made to have me in it!' This is such
a powerful idea that as the sun rises in the sky and the air heats up
and as, gradually, the puddle gets smaller and smaller, it's still
frantically hanging on to the notion that everything's going to be
alright, because this world was meant to have him in it, was built to
have him in it; so the moment he disappears catches him rather by
surprise."
Douglas Adams

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Ticket #5373

2010-07-18 Thread Lachlan Musicman
On Fri, Jul 9, 2010 at 00:00, Russell Keith-Magee
 wrote:
> On Thu, Jul 8, 2010 at 3:55 PM, Lachlan Musicman  wrote:
>> Hola,
>>
>> I'm new to this dev thing, but I've done some work on ticket #5373

Another couple of hours of pdb'ing my way into this problem...

> So - the next step is to make the tests more robust; you'll either
> prove that this isn't a problem, or you'll find the edge case that
> needs to be fixed.

> As for the tests themselves; a general rule for testing is to test as
> close to the source of the problem as possible. While I'm sure you
> *can* observe this problem in the admin, the fact that the fix doesn't
> involve any admin-specific code leads me to suspect that a better test
> would be at a lower level -- in this case, testing that foreign key
> fields return an appropriate verbose_name, and/or that ModelForms pick
> up a translated verbose name.

If you go to the ticket, you will see that I've added a new patch for
django/db/models/fields/related.py

This shows that the original change made in ticket 8011 (revision
8132) was not refactored properly.

I have refactored 8011 so that it now does the same thing cleaner.

Note that this does not solve the 5373 problem, merely proves that
there is a problem.

cheers
L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Ticket #5373

2010-07-11 Thread Lachlan Musicman
On Sun, Jul 11, 2010 at 17:31, Russell Keith-Magee
 wrote:
>>  wrote:
>> I'm not quite sure I understand. Does that mean we can have
>> conflicting verbose_names? My mental unrolling of your advice brings
>> me to:
>
> The two verbose names are describing different things.
>
> "Novel" is the verbose name for a book object. The admin page for a
> list of "books" will be titled "Novel", and say "select a Novel", etc.
>
> "Paperback" is the verbose name for the relationship held between
> Authors and Books.

ok, got it. Cheers

> The only reason to get verbose_name and verbose_name_plural involved
> is when the automated scheme for class name de-munging won't work. The
> obvious use case for this is plurals: your list of Walrus objects
> should say "You have 3 Walruses", not "You have 3 Walruss".

In that case, how would I go about localizing the class name without
verbose_name? Surely that is a second reason to use verbose_name?

> The edge case that I'm referring to is the case where a verbose name
> isn't specified on the field, and you get one inherited from the
> object you're related to.

The problem I'm referring to is that the de-munged class name of a FK
on the admin page of the class containing that FK isn't acknowledging
the localisation?

I've added another working patch to the ticket, but no test for it
yet, and I'm sure I'm stil doing something wrong.

cheers
L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Ticket #5373

2010-07-10 Thread Lachlan Musicman
On Fri, Jul 9, 2010 at 00:00, Russell Keith-Magee
 wrote:
> On Thu, Jul 8, 2010 at 3:55 PM, Lachlan Musicman  wrote:
>> Hola,
>>
>> I'm new to this dev thing, but I've done some work on ticket #5373
>
> Thanks for pitching in! Hopefully I'll be able to give you enough
> feedback to progress this issue without scaring you off :-)

That would be great, cheers

> I agree that the first patch (.2.patch) isn't the right approach --
> isinstance checks are generally an indication that you're doing
> something wrong (or at least that you could be doing it better).

Yeah, I knew that, just didn't have the eloquence

> However, I'm also concerned about unexpected consequences for the
> second patch. The obvious use case that you're breaking is if your
> ForeignKey manually defines a verbose_name.

I'm not quite sure I understand. Does that mean we can have
conflicting verbose_names? My mental unrolling of your advice brings
me to:

eg 1:
class Book(models.Model):
name = models.CharField(max_length=50)

class Meta:
verbose_name = _(u'Novel')
verbose_name_plural = _(u'Novels')

class Author(models.Model):
name = models.CharField(max_length=50)
books = models.ManyToManyField(Book, verbose_name=_(u'Paperback'))

In this (ugly, but possible?) case, we have conflicting verbose names.
Which should take precedence? Your note would indicate that Paperback
should?


> So - the next step is to make the tests more robust; you'll either
> prove that this isn't a problem, or you'll find the edge case that
> needs to be fixed.

It's definitely a problem - I've started this because it's one I experience :)

> would be at a lower level -- in this case, testing that foreign key
> fields return an appropriate verbose_name, and/or that ModelForms pick
> up a translated verbose name.

Got it - am working on it now.

cheers
L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Ticket #5373

2010-07-08 Thread Lachlan Musicman
Hola,

I'm new to this dev thing, but I've done some work on ticket #5373

http://code.djangoproject.com/ticket/5373  Field label for a
ForeignKey not translated

There are two different patches fixing the same problem - I've no idea
which is considered better. I don't like the late import on the first
patch (5373.2.patch), and the second may have unexpected consequences
(5373_related.py.diff ).

I've also added a patch for tests/regressiontests/admin_inlines that
confirms that either patch works.

I'm not sure what to do next?

cheers
L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.