Facundo Casco | 1 Aug 2006 01:07
Picon

Re: Distribute Django program to run on a local computer

maybe this make no sense to you but what about making a custom Linux
liveCD with everything you need installed. All the end-user has to do is
know how to boot from CD, no install, nothing left on their systems.

Facundo

Joseph Heck wrote:
> It's a little more tricky than just packaging Django up nicely because
> of the external dependencies. I have a set of windows installers that
> I have bundled up for myself to drop onto windows machines to get them
> set up with a dev environment (sqlite3 based). It's a little tricker
> on the Mac - but only because getting all the pieces parts installed
> is sort of a pain (no binary installer and I haven't gone to the
> trouble to make one myself).
>
> For any given platform you could make up a package and drop it around
> i'd expect. But it is a fair bit of work getting everything together.
>
> -joe
>
> On 7/31/06, * Rob Hudson* <treborhudson <at> gmail.com
> <mailto:treborhudson <at> gmail.com>> wrote:
>
>
>     Quick version:
>     Is there a way to bundle up a Django application, maybe wrap an
>     installer around it if need be, and distribute it by CD to install and
>     run on a person's local system.  Preferrably cross platform (Windows
>     and Mac).
>
(Continue reading)

Jan Claeys | 1 Aug 2006 01:40
Picon

Re: Is Django the framework I've been looking for?


Op vr, 21-07-2006 te 05:58 +0300, schreef Elver Loho:
> SciTE for my code, though, which is pretty much just glorified Notepad
> with syntax hightlighting :P 

That's what it looks like at first sight; when you look deeper, it's
more like an alternative to vim or emacs, except it doesn't run in a
console and is smaller(!)...   ;-)

--

-- 
Jan Claeys

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

SmileyChris | 1 Aug 2006 01:48
Picon
Gravatar

Re: Database API question: I am not able to return a QuerySet


Suriya wrote:

> This returns the list of rows in table A that have status
> in table B set to 1 at some point in the past. What I want
> is the latest status from table B.

I see. Yes, you can either use a (grouping) custom SQL query or
refactor.

How I would do it is to have just one model (B) and an optional
foreignkey to self which indicates this has been replaced. If the FK is
blank, it is a current object (otherwise it is a historical object)

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Joseph Heck | 1 Aug 2006 01:52
Picon
Gravatar

Re: Distribute Django program to run on a local computer

I've been doing exactly that myself - I have a VMWare image (not exactly LiveCD, but VMWare player is free...) that I use for a development environment. At OSCON I was taking briefly about it. I need to clean it up and post it. Right now it's sort of beleagured with all my additional stuff.

-joe

On 7/31/06, Facundo Casco <facundo <at> multiviajesar.com.ar> wrote:
maybe this make no sense to you but what about making a custom Linux
liveCD with everything you need installed. All the end-user has to do is
know how to boot from CD, no install, nothing left on their systems.

Facundo


--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Malcolm Tredinnick | 1 Aug 2006 02:22
Gravatar

Re: Distribute Django program to run on a local computer


On Mon, 2006-07-31 at 16:52 -0700, Joseph Heck wrote:
> I've been doing exactly that myself - I have a VMWare image (not
> exactly LiveCD, but VMWare player is free...) that I use for a
> development environment. At OSCON I was taking briefly about it. I
> need to clean it up and post it. Right now it's sort of beleagured
> with all my additional stuff. 

The original poster required running on Mac as well, though. That rules
out VMWare (Mac on Intel isn't nearly widely enough deployed yet to be a
reasonable assumption, even if VMWare supports it).

Live CDs have a slight drawback in that they take over your computer
whilst you are using them, so evaluating a submission whilst taking
notes requires two computers and you lose the ability to cut and paste
and easily take screenshots, etc, without a lot of fiddling around
running a remote viewer.

So we still have a bit of thinking to do to reach nirvana here.

Malcolm

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Jan Claeys | 1 Aug 2006 02:23
Picon

Re: Django on win xp


Op vr, 21-07-2006 te 22:37 -0700, schreef Tyson Tate:
> Wait, Linux or XP?

Or Linux _on_ XP: <http://colinux.org/> ?  :-)

--

-- 
Jan Claeys

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

limodou | 1 Aug 2006 02:38
Picon
Gravatar

Re: Django on win xp


On 7/22/06, Kevin Menard <nirvdrum <at> gmail.com> wrote:
>
> On 7/22/06, Tyson Tate <tyson <at> fallingbullets.com> wrote:
> >
> > Wait, Linux or XP?
> >
> > Regardless, you might want to read the documentation first:
> >
> > http://www.djangoproject.com/documentation/install/
>
> Be sure to read the comments, too.  There is some useful info in there
> on how to set up the symlinks in Windows.
>
You can install django just like a standard third party module:

python setup.py install

And django-admin.py will be automaticly installed in <pythoninstalldir>/Scripts

And you may put <pythonintalldir> and <pythoninstalldir>/Scripts in
PATH environment variable, so you can run python and django-admin.py
directly in any directory of the dos command window.

I think it's the easiest.
--

-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Suriya | 1 Aug 2006 03:36
Picon

Re: Database API question: I am not able to return a QuerySet


DavidA wrote:
> Suriya,
>
> You will probably have to do this in custom SQL or using extra(). Your
> query requires a subselect to get the "current B's" (B's with max(date)
> for each A).
>
> Here's the SQL that I think you need (if I understand the problem
> correctly):
>
> select * from <app>_A join <app>_B on <app>_B.a_id = <app>_A.id
> where <app>_B.date = (select max(date) from <app>_B where a_id =
> <app>_B.a_id)
> and <app>_B.status = 1

I think your SQL query provides what I need. For no rational
reason, I am trying to avoid custom SQL as much as I can.
This is what I have currently got

class ValidAsManager(models.Manager):
    def get_query_set(self):
        q = super(ValidAsManager, self).get_query_set()
        lst = [ i.id for i in q if i.status() == 1 ]
        # The call to filter() below does not work if lst
        # is empty, and I am handling that (not shown
        # here)
        return q.filter(id__in=lst)

This is obviously inefficient, but returns a QuerySet.

> I think that maps to
>
>  A.objects.extra(where=['<app>_B.a_id = (select max(date) from <app>_B
> where a_id = <app>_B.a_id)'], tables=['<app>_B']).filter(b__status=1)
>
> You might want to consider modeling this differently. I have a similar
> problem where I'm essentially tracking different versions of an object.
> But instead of just using one date, I use two for the range that the
> version was valid: date_from and date_thru. For the current version, I
> set date_thru to null. Then a query of the current versions is really
> easy: filter(date_thru__isnull=True). You can also see all versions at
> a given point in time with the slightly more complex (but efficient):
> filter(date_from__lte=some_date).filter(Q(date_thru__gt=some_date)|Q(date_thru__isnull=True))
>
> In your design all of these types of queries require a subselect. Of
> course, its more work to keep my table up to date, but I have the need
> to query it arbitrarily in many ways so paying a little expense at
> insert time (once per quarter) for better query performance (many times
> per day) is a good tradeoff, in my case.

It is a good idea to have two fields to help keep track
of which row is the latest. I have decided to keep the
table simple, so that the users who enter data do
not have to be educated. Or else, I will have to write
a custom interface for updating the status.

Thank you for your ideas.

Suriya

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Jorge Gajon | 1 Aug 2006 03:39
Picon

Re: Scandinavian characters in .po files and timezones


Hi,

Take notice that there is also a 'fileencoding' setting in vim. When
you create a new file in vim, 'fileencoding' will not be set and so it
will take the current value from 'encoding'.

When you open an existing file, vim will try to determine its encoding
and set 'fileencoding' accordingly. But be aware that if you change
the 'encoding' the 'fileencoding' variable will not be affected.

If you want to actually change the encoding of an existing file you
must change the variable 'fileencoding' and save (:w) the file.

Look at :help fileencoding   and   :help encoding    for more details.

You could also take a look at this script:
http://www.vim.org/scripts/script.php?script_id=789

Cheers,
Jorge

On 7/30/06, Mikko Nylén <mikko.nylen <at> gmail.com> wrote:
>
> Thanks for all answers. I was able to fix the problem by starting over with the django.po. May be the problem
was that when I did start working with the file, I didn't have set encoding=utf-8 and when I turned it on in
the middle, Vim didn't convert the characters to UTF-8.
>
> - Mikko Nylén
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Todd O'Bryan | 1 Aug 2006 03:55
Picon

Re: Simplifying template?


I would actually be okay writing the function in the view code, if we  
had a map filter.

{{ s.teachers|map:list_func|join:";" }}

Then add the following to the context:

"list_func": lambda(x): x.userinfo.informal_name()

How hard would that be to implement, and is it potentially useful  
enough that it'd be worth it?

Todd

On Jul 30, 2006, at 6:59 PM, SmileyChris wrote:

>
> Something like the following would be neat:
>
> {{ s.teachers|loop:"userinfo.informal_name"|join:"; " }}
> I thought of using python's "map" as the filter name but "loop" is
> probably be a more generic term.
>
> How I imagine the filter would look:
> def loop(value, arg):
>     # TODO: do some test to ensure value is iterable
>     return [djangos_magical_resolver("x." + arg) for x in value]
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
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 <at> googlegroups.com
To unsubscribe from this group, send email to django-users-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---


Gmane