Re: parallel test running throwing pickleError

2016-06-30 Thread Harry Moreno
Any progress made on this front? I'm seeing this too in a Django 1.9 app 
using python 2.7

On Monday, February 29, 2016 at 3:24:13 PM UTC-5, girish ramnani wrote:
>
> Sorry i forgot to mention that, i have installed the tblib. this is my pip 
> list output
>
> Django (1.10.dev20160216200705, /home/girish/Documents/Github/django)
> fancycompleter (0.4)
> ordereddict (1.1)
> pdbpp (0.8.3)
> pip (8.0.3)
> py (1.4.31)
> Pygments (2.1.2)
> pytest (2.8.7)
> setuptools (18.2)
> tblib (1.2.0)
> wheel (0.24.0)
> wmctrl (0.3)
>
>
> On Monday, February 29, 2016 at 11:07:37 PM UTC+5:30, Simon Charette wrote:
>>
>> Hi Girish,
>>
>> I think you didn't to install the `tblib` package[1].
>>
>> Cheers,
>> Simon
>>
>> [1] 
>> https://docs.djangoproject.com/en/1.9/ref/django-admin/#cmdoption-test--parallel
>>
>> Le lundi 29 février 2016 12:13:08 UTC-5, girish ramnani a écrit :
>>>
>>> when running the django test in parallel using the runner.py . 
>>> _pickle.PicklingError: Can't pickle >> 'unittest.loader.ModuleImportFailure'>: attribute lookup 
>>> ModuleImportFailure on unittest.loader failed
>>>
>>> error is thrown, and when the runner is run using a single process. the 
>>> test suite executes.
>>>
>>> I am using a new virtualenv with django installed in editable mode.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8eec5343-d145-439d-b210-b317552e9733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.5 or Django 1.6 with python 3.3 on windos Server 2008

2013-11-07 Thread Harry Houdini
You will want to use mod_wsgi:

https://code.google.com/p/modwsgi/


On Thursday, November 7, 2013 8:33:12 AM UTC-5, Robert Jonathan Šimon wrote:
>
> OK thank you, i need a real server, because a already created aplication 
> (a part) and i want to deliver to the internet. So best solution is Apache. 
> How can i install it with django 1.5 and python 3.3?
>
>
> On Thu, Nov 7, 2013 at 1:40 PM, Mike Dewhirst 
>  > wrote:
>
>> On 7/11/2013 9:34pm, Robert Jonathan Šimon wrote:
>>
>>> I still dont now how i can install Django into IIS.
>>>
>>
>> If you decide to use IIS you will find very few people able to help you 
>> if things go wrong. From a practical perspective, it would be safer to use 
>> Apache in your Django stack.
>>
>> However, you don't need either IIS or Apache during development. Django 
>> comes with its own server for development purposes. This lets you sensibly 
>> postpone your production webserver decision until you are ready to deploy.
>>
>> Your question in the subject line is easy to answer. Django 1.6 has just 
>> been released so go with that. Python 3.3 is better than 2.7 unless you 
>> need libraries which are only available for 2.7. Happily, things are 
>> changing fast in favour of 3.3.
>>
>> Good luck
>>
>> Mike
>>
>>  
>>>
>>> On Thu, Nov 7, 2013 at 11:21 AM, Timothy W. Cook 
>>> >> > wrote:
>>>
>>> Did you see this:
>>> 
>>> https://docs.djangoproject.**com/en/1.6/howto/auth-remote-**user/#
>>>
>>> On Thu, Nov 7, 2013 at 8:18 AM, Robert Jonathan Å imon
>>>
>>> >> > 
>>> wrote:
>>>  > I search for how can i do this, but i didnt find anything. Can
>>> you help me?
>>>  > It would be great if it can be on IIS 7.5
>>>  >
>>>  > --
>>>  > You received this message because you are subscribed to the
>>> Google Groups
>>>  > "Django users" group.
>>>  > To unsubscribe from this group and stop receiving emails from it,
>>> send an
>>>  > email to django-users...@**googlegroups.com 
>>> >> *>.
>>>
>>>  > To post to this group, send email to
>>> django...@googlegroups.com  >> googlegroups.com >.
>>>
>>>  > Visit this group at 
>>> http://groups.google.com/**group/django-users
>>> .
>>>  > To view this discussion on the web visit
>>>  >
>>> https://groups.google.com/d/**msgid/django-users/715d021d-**
>>> 77a5-4d2c-b99d-7d9efc72e304%**40googlegroups.com
>>> .
>>>  > For more options, visit https://groups.google.com/**
>>> groups/opt_out .
>>>
>>>
>>>
>>> --
>>> MLHIM VIP Signup: http://goo.gl/22B0U
>>> ==**==
>>> Timothy Cook, MSc          +55 21 94711995
>>> 
>>>
>>> MLHIM http://www.mlhim.org
>>> Like Us on FB: 
>>> https://www.facebook.com/**mlhim2
>>> Circle us on G+: http://goo.gl/44EV5
>>> Google Scholar: http://goo.gl/MMZ1o
>>> LinkedIn 
>>> Profile:http://www.linkedin.**com/in/timothywaynecook
>>>
>>> --
>>> You received this message because you are subscribed to a topic in
>>> the Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/**topic/django-users/**
>>> 9SzSCZWYwOk/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users...@**googlegroups.com 
>>> >> *>.
>>>
>>> To post to this group, send email to 
>>> django...@googlegroups.com
>>> .
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/**msgid/django-users/CA%2B%**
>>> 3DOU3Uj29zDW-%**3D2Q3ib7zn44spOaJ29Q7A7WiAk_**4BmqAn9Kw%40mail.gmail.com
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@**googlegroups.com .

Can Django do this?

2013-03-20 Thread Harry Ord
Hello

 Can i create a website just like this with Django?

http://www.hbn.cl/

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




Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?

2013-02-09 Thread Harry P
I'm struggling with the same problem.  It's pretty annoying that you can't 
run a LiveServerTestCase with debug=True.  It makes it overly hard to do 
TDD at the beginning of a project, because you need to customise logging 
behaviour to get any kind of debugging working... 

hp (http://www.tdd-django-tutorial.com/)

On Wednesday, January 30, 2013 8:30:33 AM UTC, Alessandro Pelliciari wrote:
>
> Thanks for the answer!
>
> Because i'm developing and integrating some flow (social registration etc) 
> through tests.
>
> So, instead of creating every time a new user, creating a new social 
> association, and then after every try delete them from the database, the 
> test does it from me.
>
> So, its like a kind of dirty TDD with functional (selenium because i have 
> facebook login for example) testing.
>
>
> Anyway i think i can resolve with the 500 response logging the error to 
> the console, but it's my first project in Django (and python) so i can't 
> understand completely the way to logging at this moment.
>
>  
> Alessandro
>
>
> Il giorno mercoledì 30 gennaio 2013 03:18:46 UTC+1, Ramiro Morales ha 
> scritto:
>>
>> Ramiro Morales
>> On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari"  
>> wrote:
>> >
>> > thanks for the link!
>> >
>> > So Isn't there a way to set DEBUG=True in tests?
>>
>> No. There isn't (at least with the built-in testing toolbox).
>>
>> Now, I'm trying to understand why do you rely in the debugging 500 
>> response contents on your tests. Do you screen scrap it to extract  
>> information about the origin of the failure?
>>
>

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




Re: Need guidance on static website conversion to Django

2013-02-06 Thread Harry Houdini

Maintaining that many static files has really got to suck, this is where 
Django is going to help you a lot. First step for you because you are just 
starting out it to play around with Django, build some base templates and 
try extending them until you get your templates looking how you want. Then 
go ahead and design the DB in a way that makes sense for making it easy to 
edit and display your site content (and to add whatever features on top of 
that you want- e.g the voting thing you wanted to add). 

And overall think it would make more sense to start with a vanilla Django 
install and get a feel for it before you jump to Mezzanine. I looked at 
Mezzanine for a project and spent a few days messing around with it and 
building up a site and I have to say that it adds a ton of functionality on 
top of Django but has a learning curve when it comes to customization. They 
modified django a lot compared to something like DjangoCMS I would say 
(which is more of a plugin). Mezzanine is also pretty new and under very 
active development (I follow their repo on Github, its pretty active) but 
you can usually talk to people on their IRC channel about it if you get 
stuck (its on freenode). 

You might find you can build it fast enough with vanilla Django and a few 
unobtrusive plugins and that you dont need the CMS stuff (django.admin does 
a lot actually but has some limits).



On Tuesday, February 5, 2013 1:37:06 PM UTC-5, Steve Metivier wrote:
>
>
>- Project: Convert an essentially static HTML website and its attached 
>WordPress blog, to Django, to improve on its currently slow load time, and 
>to enable its functionality to be extended. (It’s currently implemented on 
>a platform that I believe introduces significant overhead at runtime, and 
>is very restrictive in extensibility. It’s on one of those “build your own 
>website with no technical expertise” platforms.) 
>I should note that I do have technical expertise, having been a 
>professional developer in C for many years, and I now have a decent handle 
>on HTML and CSS, but am a beginner with both Python and Django.
>- The website is a famous quotes site. (It’s 
> www.InspirationalSpark.com, 
>if you want to take a look.) Each page focuses on a specific subject 
> (which 
>its URL indicates), and is comprised of some introductory text, including 
>meta tags, followed by 12-20 famous quote entries, each made up of the 
>quote itself, it’s author, and a short description. Finally, there are 
>related page links at the bottom, and AdSense in several places. The 
>navigation consists of topic links in the left column, and there is also a 
>right column containing various elements that are shared on all pages.
>- I envision each quote becoming a standalone object, so it can be 
>shared socially and, eventually, rated/voted. I intend for each quote to 
> be 
>associated with a single topic page, for the most part.
>- The purpose of the *blog* is to allow daily additions of new quotes, 
>which are scheduled as a “quote of the day”, go out to a feed, and are 
>posted to an associated Facebook page and to Twitter, and then listed on 
>one of the topic pages. I don’t actually want the individual posts to be 
>visible to the search engines, due to the thin content issue. They should 
>only be visible within one of the topic pages, and on the home page.
>- It’s critical that the page URLs remain unchanged, due to the number 
>of inbound links that already exist, and current traffic (around 10,000 
>views/day).
>- I think what I’m looking for is a CMS, with a twist, to enable 
>multiple objects per page. 
>Here’s the long-term plan:
>- Phase 1 – re-implement the website (separate from the blog), as is, 
>in Django, to hopefully improve its currently poor load time. High 
> priority 
>is given to maintaining the current URLs completely, for SEO reasons, and 
>to time to production launch.
>- Phase 2 – migrate the current WordPress blog to Django.
>- Phase 3 – add social media buttons to each quote on the page – for 
>Facebook and twitter.
>- Phase 4 – add user-created pages, where they can store and display 
>their favorite quotes, with accounts and registration.
>- Phase 5 – add voting on individual quotes within a page.
>- Getting to phase 1 completion is a high priority, even if it means 
>reworking components later to do so.
>- The admin interface would need to provide for adding new quotes, and 
>assigning them to topic pages, plus adding new topic pages. In the current 
>Wordpress blog implementation, it’s very handy to be able to specify each 
>of the fields for a quote entry via a form, then pick the category from a 
>list. It would be nice to keep this type of interface.
>- The scheduling of new “posts” feature is also 

Re: Django lucene

2013-01-18 Thread Harry Houdini

I originally went down this path but I too ran into many problems getting 
this to work and ended up using Whoosh instead. The site was small ~30 
pages or so it was still pretty fast. I had it index by reading the sitemap 
and pulling down the page content from the web server. I used 
BeautifulSoup4 to get the page title to store in the Whoosh DB. Anyway, 
just another option to consider.


On Tuesday, August 25, 2009 10:55:59 AM UTC-4, Puneet wrote:
>
> Hi, 
>
> Does anyone have tried django-lucene module for search ?? 
>
> I am able to compile the lucene and jcc as  required but the module is 
> not working properly as it is expected to work.  As mentioned in the 
> docs I have added to fields in my model 
>
>objects = models.Manager() 
>objects_search = Manager() # add search manager 
>
> But when I say ModelName.save() its not getting indexed with lucene 
> and when I say 
>
>  ModelName.objects.objects_search(name_first="Spike") 
>
> I am getting error that 
>
> AttributeError: 'Manager' object has no attribute 'objects_search' 
>
> Can any one help me with this ?? Does anyone have a small working 
> example ? 
>
> Thanks, 
> Puneet 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Ys0rcBWSMp0J.
To post to this group, send email to django-users@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.



Re: Test driven development in Django framework

2012-09-07 Thread Harry P
Hey, glad to hear someone's been found it useful!

re: whether my unit tests are unit tests or not... some people have a very 
restrictive definition of what a unit test is - they want it to be 100% 
isolated from other tests, always mock out the filesystem and the database, 
etc.  That's fine, but we tend to find it's a bit OTT, and a slightly more 
relaxed approach is more productive.   Ultimately, I'm writing two types of 
test - some high-level tests that test the behaviour of the app from the 
user's point of view - so call them system tests, or functional tests, or 
acceptance tests, or whatever you will, but their purpose is to check the 
system actually works.  The other type of test is low-level, they test the 
behaviour of individual functions, classes etc, and their purpose is to 
help you think about your code before you write it, to think through edge 
cases and to help write correct code.

So, to me, the important thing is that you have those two types of test, 
and that they help you achieve those two different objectives.  Finer 
details of terminology or practices to do with mocking, stubbing etc are up 
to personal preferences really.

cheers,
hp



On Friday, September 7, 2012 10:25:32 AM UTC+1, jyria wrote:
>
> Thank you for reply,
>
> I have been using your tutorial to learn TDD in django. One of the best I 
> have found so far. You also talk about "unit tests" and thats what is 
> confusing. As I understand, your tutorial examples are not unit tests in 
> the strict meaning of the term. 
>
> You have a great tutorial and I have learned a lot of them. Maybe too much 
> focus on admin and polls app for me. I would have liked to see something 
> different and new. What about running you selenium functional tests in a 
> acceptance testing framework?
>
> I would love to see your tutorials for intermediate/advanced level.
>
> On Thursday, September 6, 2012 1:57:08 PM UTC+3, Harry P wrote:
>>
>> Hi there,
>>
>> I work for a bunch of XP fanatics, so we do quite religious TDD in our 
>> Python/Django development.   We start with functional/acceptance tests, 
>> which we write using Selenium, driving a real web browser, and following a 
>> test script that is essential a user story.  We then write unit tests that 
>> we can run using a python manage.py test.
>>
>> I've written a "TDD for beginners" tutorial, that covers both of these 
>> types of test:
>>
>> http://www.tdd-django-tutorial.com/
>>
>> I'd love any comments, feedback, suggestions?
>>
>> rgds,
>> Harry
>>
>> On Thursday, September 6, 2012 1:47:08 AM UTC+1, Mike Dewhirst wrote:
>>>
>>> On 6/09/2012 3:04am, Javier Guerra Giraldez wrote: 
>>> > On Wed, Sep 5, 2012 at 7:46 AM, jyria <jyr...@gmail.com> wrote: 
>>> >> What is your experience? Is it worth it, and is it possible? 
>>> >> 
>>> >> I tried it and found it quite difficult to follow guideline of unit 
>>> testing 
>>> >> -- testing a unit of code, a class for example. Maybe Im just 
>>> ignorant, but 
>>> >> I didnt see, how can I create registration app only with unit tests. 
>>> The 
>>> >> only way I could drive implementation with tests was using more like 
>>> an 
>>> >> integration testing approach: calling requests with data and 
>>> asserting that 
>>> >> new user was registered and that form was valid/invalid etc, but this 
>>> goes 
>>> >> against TDD as I understand it. So should I not worry about pure 
>>> "unit 
>>> >> testing" approach and use django client http request to validate 
>>> >> RegistrationForm. Or I should write unit tests for RegistrationForm 
>>> class? 
>>> > 
>>> > TDD is not unit-testing 
>>>
>>> Here is a lovely diagram I found recently - probably by following a link 
>>> someone posted here - which shows the TDD process with unit tests and 
>>> acceptance tests. 
>>>
>>> IMO it covers pretty much everything in the universe ... 
>>>
>>> http://www.methodsandtools.com/archive/attready3.jpg 
>>>
>>> > 
>>> > https://www.google.com/webhp?q=tdd%20is%20not%20unit%20testing 
>>> > 
>>> > 
>>> > in short, it's like you've found: the tests you easily get with TDD 
>>> > are more (but not exactly) like integration tests, because you test 
>>> > features, not units.  The "test isolated units" mantra of unit-testing 
>>> > requires different work.  There's nothing wrong in 

Re: Test driven development in Django framework

2012-09-06 Thread Harry P
Hi there,

I work for a bunch of XP fanatics, so we do quite religious TDD in our 
Python/Django development.   We start with functional/acceptance tests, 
which we write using Selenium, driving a real web browser, and following a 
test script that is essential a user story.  We then write unit tests that 
we can run using a python manage.py test.

I've written a "TDD for beginners" tutorial, that covers both of these 
types of test:

http://www.tdd-django-tutorial.com/

I'd love any comments, feedback, suggestions?

rgds,
Harry

On Thursday, September 6, 2012 1:47:08 AM UTC+1, Mike Dewhirst wrote:
>
> On 6/09/2012 3:04am, Javier Guerra Giraldez wrote: 
> > On Wed, Sep 5, 2012 at 7:46 AM, jyria <jyr...@gmail.com > 
> wrote: 
> >> What is your experience? Is it worth it, and is it possible? 
> >> 
> >> I tried it and found it quite difficult to follow guideline of unit 
> testing 
> >> -- testing a unit of code, a class for example. Maybe Im just ignorant, 
> but 
> >> I didnt see, how can I create registration app only with unit tests. 
> The 
> >> only way I could drive implementation with tests was using more like an 
> >> integration testing approach: calling requests with data and asserting 
> that 
> >> new user was registered and that form was valid/invalid etc, but this 
> goes 
> >> against TDD as I understand it. So should I not worry about pure "unit 
> >> testing" approach and use django client http request to validate 
> >> RegistrationForm. Or I should write unit tests for RegistrationForm 
> class? 
> > 
> > TDD is not unit-testing 
>
> Here is a lovely diagram I found recently - probably by following a link 
> someone posted here - which shows the TDD process with unit tests and 
> acceptance tests. 
>
> IMO it covers pretty much everything in the universe ... 
>
> http://www.methodsandtools.com/archive/attready3.jpg 
>
> > 
> > https://www.google.com/webhp?q=tdd%20is%20not%20unit%20testing 
> > 
> > 
> > in short, it's like you've found: the tests you easily get with TDD 
> > are more (but not exactly) like integration tests, because you test 
> > features, not units.  The "test isolated units" mantra of unit-testing 
> > requires different work.  There's nothing wrong in adding 'real' 
> > unit-tests, but it's not required to do effective TDD. 
> > 
> > I guess that since unittesting became so well known so long ago, 
> > almost all test frameworks (including Python's and Django's) call 
> > their base test class "UnitTest", but they're not; they're just tests. 
> >   you make them feature tests, or integration tests, or unit tests, or 
> > whatever kind of test. 
> > 
> > now, about the pros/cons of unit-testing vs. other kinds of tests. 
> > that's a whole debate that i'm not going to touch. 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/zN3GT06MfH4J.
To post to this group, send email to django-users@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.



{% extends "view/base.html" %}

2011-04-08 Thread Harry
{% extends "base.html" %} works fine, but I want to point to a
static_dir.

Here is app.yaml:
- url: /view
  static_dir: static/view

Here is main.py:
template_values = {
'url': url,
'url_linktext': url_linktext,
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path,
template_values))

Here is the error:
raise TemplateSyntaxError, "Template %r cannot be extended, because it
doesn't exist" % parent
TemplateSyntaxError: Template 'view/base.html' cannot be extended,
because it doesn't exist

You can browse to the base.html, but class main() cannot see it.

Thanks for any assistance,
Harry

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Error: No module named admindjango.contrib.auth

2010-11-10 Thread Harry
Trying to follow Part 2 of the Django documentation

>>> python manage.py syncdb throws this when configuring admin
'Error: No module named admindjango.contrib.auth'
More errors if I try to include admin docs.

1) Need to know where I can see which modules are installed
2) Why this module did not install
3) How to fix it.

Mac OS X 10.6.4
django-admin.py --version = 1.1 SVN-13865
python --version = Python 2.6.1

4) Should I upgrade Python, and what will this break?

Thanks
Harry

-- 
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.



Re: select multiple without using foreignkey

2010-06-18 Thread HARRY POTTRER
> Ages ago I wrote asnippetwith a model field and form field to deal
> with this. It should still work. See:http://djangosnippets.org/snippets/1200/
> --
> DR.

I'm using this snippet like so:

MONTHS = [
(1, "January"),
(2, "February"),
(3, "March"),
(4, "April"),
(5, "May"),
(6, "June"),
(7, "July"),
(8, "August"),
(9, "September"),
(10, "October"),
(11, "November"),
(12, "December"),
]

class MyModel(models.Model):
months = MultiSelectField(max_length=30, choices=MONTHS,
help_text="What months of the year do you travel this route?")

And it works fine except for when I do MyModel.get_months_display() it
returns "1,2,3,4,5" instead of "January, Februrary, March, ..." Is
this by design, or am I using the snippet wrong?

-- 
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.



Re: how should reusable apps handle url namespace?

2010-06-12 Thread HARRY POTTRER
On Jun 4, 4:10 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jun 4, 5:06 am, HARRY POTTRER <cp368...@ohio.edu> wrote:
>
> > I'm writing a forum app that I want to be reusable. All of my urls I
> > have named. Some of them are named like "index" and "thread" which are
> > generic and will likely collide with existing project's urls. I don't
> > want to do something like name all my urls "forum_index" and
> > "forum_thread" either.
>
> > I think the best way is to use the newnamespacefeature, but I'm not
> > quite sure how to do it for reusuable apps. The docs make it seem like
> > the only purpose ofnamespaceurls is when you have two or more
> > instances of an app.
>
> You don't need to do anything with it. You don't define thenamespace
> in the application's urlconf, the end developer does it when they
> include your application's urlconf in their project-level one. See the
> docs on defining 
> namespaces:http://docs.djangoproject.com/en/1.2/topics/http/urls/#defining-url-n...
> --
> DR.

but how do I handle get_absolute_url? I don't see how I'm supposed to
resolve any urls if I don't supply it with a namespace...

-- 
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.



how should reusable apps handle url namespace?

2010-06-03 Thread HARRY POTTRER
I'm writing a forum app that I want to be reusable. All of my urls I
have named. Some of them are named like "index" and "thread" which are
generic and will likely collide with existing project's urls. I don't
want to do something like name all my urls "forum_index" and
"forum_thread" either.

I think the best way is to use the new namespace feature, but I'm not
quite sure how to do it for reusuable apps. The docs make it seem like
the only purpose of namespace urls is when you have two or more
instances of an app.

-- 
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.



select multiple without using foreignkey

2010-06-01 Thread HARRY POTTRER
I have a models that represents an event.

I want it to have a field that represents the days of the week that
the event occurs. This is easy if all you need to be able to do is be
able to select one day, but if you want to select multiple, the right
way seems to be to create a DayOfWeek object, create 7 instances in
your db, the use ManyToMany relations. To me that just seems wrong.
I'd rather store it as a string like "WFS" or "MWF". Is there an easy
way to do this in django?

-- 
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.



surveys

2010-05-11 Thread HARRY POTTRER
I have a project that I'm working on that works like this:

the user enters some points on a map which are then stored in a
database as a LineString object (via geodjango). Along with the
geographic data, the user is given a survey to fill out consisting of
simple questions like "how fun was this", "how old are you", and "was
the parking sufficient", etc. There will be a pool of roughly 100
questions, and the survey will be constructed based on the locale of
the user. Different locales results in different sets of questions.
There are 40-50 locales for this project.

My question is how should I set up the surveys. I don't really want to
hard code each survey per locale. I'd prefer to have the questions and
choices defined in the database.

There is a reusable app called "django-survey" but as far as I can
tell the project is completely undocumented. I have it installed, but
I can't figure out how to use it. Is this app the kind of thing that I
can use, or is it meant for something else completely?

-- 
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.



caching querysets between requests

2010-04-17 Thread HARRY POTTRER
I have a page that needs to get a few values via the aggregate
function of querysets. There are about 15 of them, and they all look
like this:

SELECT SUM(some_column_name) FROM ...

and they each take a few hundred milliseconds each. That makes the
page take a lot longer to render than I'd like. I'm thinking of
refactoring so it gets those values after the page renders via an Ajax
call.

Also, instead of having each one call it's own query, I'm thinking of
having each ajax call call one query like so:

SELECT SUM(column1), SUM(column2), ...

and take advantage of the fact that the above query is going to be
quicker than doing each one individually in database terms. Also,
doesn't django cache querysets? Does it cache them between requests?
Will the cache expire once the response is returned?

-- 
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.



Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread HARRY POTTRER
On Mar 30, 12:08 pm, Sven Richter  wrote:
>
> So if somebody could provide some working code, or a hint to
> repository or an application with some working code, i'd really
> appreciate that.
>
> Greetings
> Sven

You can look through my code: 
http://github.com/nbv4/flightloggin/blob/master/pdf/pdf.py

and an example of some output:

http://flightlogg.in/chris/print.pdf

-- 
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.



deepcopying form classes and thread safety

2010-03-29 Thread HARRY POTTRER
I have a model form in my project that has a field that is swapped out
for another field based on user preferences. Some users want a select
the value from a dropdown box, other people want to just type the
value into a textbox.

Before I had it like this:

def proper_flight_form(profile):
"""
Prepares the popup flight form based on how the user wants each
field
widget to be rendered as.
"""

from plane.models import Plane
from logbook.forms import TextPlaneField, FlightForm

if profile.text_plane:
text_plane_field =
TextPlaneField(queryset=Plane.objects.none())
FlightForm.base_fields['plane'] = text_plane_field
return FlightForm

return PopupFlightForm

This was bad because when it edited the class like that, it effected
all users. The next request that came in had the incorrect form field.
I kept getting errors such as "ValueError: invalid literal for int()
with base 10: 'N488AF'", which is caused by the form rendering the
textbox, but when it comes time to recieve that data the form class
has changed in that it now expects the data to be an integer from a
dropdown box.

So then I changed the way it worked by just defining two different
form classes, one with the textbox field, the other with the dropdown
box. This worked 100% fine, but wasn't very flexible.

So then I edited it so it deepcopies the form class first, and then
edits the fields on that copied class. I thought this would work, but
we're back to square one.

This is what I have now:

def proper_flight_form(profile):
"""
Prepares the popup flight form based on how the user wants each
field
widget to be rendered as.
"""

from copy import deepcopy
from plane.models import Plane
from logbook.forms import TextPlaneField, FlightForm

if profile.text_plane:
text_plane_field =
TextPlaneField(queryset=Plane.objects.none())
NewForm = deepcopy(FlightForm)
NewForm.base_fields['plane'] = text_plane_field
return NewForm

return FlightForm

-- 
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.



Re: if statement with url

2010-03-10 Thread HARRY POTTRER
maybe try request.path?

On Mar 10, 1:51 pm, Daxal  wrote:
> Hey,
>
> I wanted to use a if statement with a url like ...
>
> if you are on "/cm/add/"
> ..
> endif
> .
> option 1:
> I was wondering if anyone knows how to code that statement. if can
> compare string variables like {% ifequal somevariable url %} where
> "url" can be hard coded like "/cm/add" and somevariable would have to
> store the url which i think is too complex.
>
> option 2:
> some if statement that directly compares the url like {% if {url} == "/
> cm/add/" %}
>
> any thoughts and ideas guys?
>
> Thank you for all your replies. :)

-- 
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.



entering text+images into a textfield

2010-03-10 Thread HARRY POTTRER
I have a project where I'm taking a bunch of articles originally
written for a on a tripod page, and putting them into a database so
they can be served up by django.

Right now I have it all set up and working, but theres one problem. A
lot of these articles are very image heave. Each one has an average of
about 10 images.

I'm thinking of creating an app which acts, in part, as a modified
text widget in the admin. There will be a text box just like how there
is now, plus there will also be above it, another widget where you can
drag and drop images. When you save the model instance, it will save
those images into a directory named according to the slug of the
instance, or by the primary key, or maybe even the natural key.

Each image will be given a number based on the order of it being
uploaded. In the text box, where you want the images to be placed, you
enter something like  and the {1} will be replaced with
the url for that image.

Before I get started on this, does something similar to this exist? I
don't want to reinvent the wheel or anything...

-- 
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.



managers or classmethods?

2010-02-24 Thread HARRY POTTRER
Why not something like this:

class Person(models.Model):
@classmethod
def male(cls):
return cls.objects.filter(gender='M')

@classmethod
def female(cls):
return cls.objects.filter(gender='F')

name = models.CharField(maxlength=20)
gender = models.CharField(maxlength=1)

instead of defining a 'female' and 'male' custom managers as is
illustrated in the docs? Whenever I need to define 'table level'
functionality, I've always gone with the above method rather than
bother with a custom manager. What am I missing out on?

-- 
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.



Re: Expiring view caches

2010-02-11 Thread HARRY POTTRER
just a quick note to anyone out there who finds this thread with the
same problem as me:

in that snippet, you need to change this line:

if cache.has_key(key):

to this:

if key and cache.has_key(key):

in order for it to work. It seems that registering accounts on django-
snippets is broken, so posting this here is the next best thing

On Feb 11, 4:28 pm, HARRY POTTRER <cp368...@ohio.edu> wrote:
> Oh I see, the key is an entire request object. Thanks, that worked!
>
> On Feb 11, 4:22 pm, David Zhou <da...@nodnod.net> wrote:
>
> > Check out this snippet:
>
> >http://www.djangosnippets.org/snippets/936/
>
> > Some what old though (2008), so it might need updating to work properly.
>
> > -- dz
>
> > On Thu, Feb 11, 2010 at 4:18 PM, HARRY POTTRER <cp368...@ohio.edu> wrote:
> > > Is there any way to manually expire per-view caches?
>
> > > I have a view that executes between 100 and 200 database queries to
> > > render the page. The page basically renders a stats page for each user
> > > on my site. It only takes a few hundred milliseconds, but none the
> > > less I want some kind of cache sitting behind this page.
>
> > > The only problem is that the data on this page is somewhat dynamic.
> > > Whenever the user changes some data, the cache needs to be canceled
> > > and the page needs to be re-rendered. I can very easiely connect a
> > > signal or something to the user changing the data, but I'm having
> > > trouble figuring out how to expiring the view cache.
>
> > > I tried reverse()-ing the URL, and then feeding that into
> > > cache.delete(), but that didn't work. The docs really don't say how to
> > > expire per-view cache's other than just waiting for the expiration
> > > time to pass.
>
> > > --
> > > 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 
> > > athttp://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.



Re: Expiring view caches

2010-02-11 Thread HARRY POTTRER
Oh I see, the key is an entire request object. Thanks, that worked!

On Feb 11, 4:22 pm, David Zhou <da...@nodnod.net> wrote:
> Check out this snippet:
>
> http://www.djangosnippets.org/snippets/936/
>
> Some what old though (2008), so it might need updating to work properly.
>
> -- dz
>
> On Thu, Feb 11, 2010 at 4:18 PM, HARRY POTTRER <cp368...@ohio.edu> wrote:
> > Is there any way to manually expire per-view caches?
>
> > I have a view that executes between 100 and 200 database queries to
> > render the page. The page basically renders a stats page for each user
> > on my site. It only takes a few hundred milliseconds, but none the
> > less I want some kind of cache sitting behind this page.
>
> > The only problem is that the data on this page is somewhat dynamic.
> > Whenever the user changes some data, the cache needs to be canceled
> > and the page needs to be re-rendered. I can very easiely connect a
> > signal or something to the user changing the data, but I'm having
> > trouble figuring out how to expiring the view cache.
>
> > I tried reverse()-ing the URL, and then feeding that into
> > cache.delete(), but that didn't work. The docs really don't say how to
> > expire per-view cache's other than just waiting for the expiration
> > time to pass.
>
> > --
> > 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 
> > athttp://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.



Expiring view caches

2010-02-11 Thread HARRY POTTRER
Is there any way to manually expire per-view caches?

I have a view that executes between 100 and 200 database queries to
render the page. The page basically renders a stats page for each user
on my site. It only takes a few hundred milliseconds, but none the
less I want some kind of cache sitting behind this page.

The only problem is that the data on this page is somewhat dynamic.
Whenever the user changes some data, the cache needs to be canceled
and the page needs to be re-rendered. I can very easiely connect a
signal or something to the user changing the data, but I'm having
trouble figuring out how to expiring the view cache.

I tried reverse()-ing the URL, and then feeding that into
cache.delete(), but that didn't work. The docs really don't say how to
expire per-view cache's other than just waiting for the expiration
time to pass.

-- 
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.



Re: django-debug-toolbar with runserver not running on localhost

2010-02-04 Thread HARRY POTTRER
gah you're correct, I can't believe I missed that setting. thanks

On Feb 4, 4:48 pm, rebus_ <r.dav...@gmail.com> wrote:
> On 4 February 2010 22:06, HARRY POTTRER <cp368...@ohio.edu> wrote:
>
> > I've noticed that if I run the django dev server on localhost, debug-
> > toolbar works, but if I try to run he server like this:
>
> > ./manage.py runserver 192.168.1.145:8000
>
> > the site will work, but the toolbar won't show up. Is there a work-
> > around for this?
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> Do you maybe have INTERNAL_IPS set in your settings?
> It's used to decide on which addresses the toolbar will be shown.
>
> Read more about this on:http://github.com/robhudson/django-debug-toolbar.

-- 
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.



django-debug-toolbar with runserver not running on localhost

2010-02-04 Thread HARRY POTTRER
I've noticed that if I run the django dev server on localhost, debug-
toolbar works, but if I try to run he server like this:

./manage.py runserver 192.168.1.145:8000

the site will work, but the toolbar won't show up. Is there a work-
around for this?

-- 
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.



Re: fintering a queryset based on time

2010-02-02 Thread HARRY POTTRER
nevermind, i figured it out.

.extra(where=['EXTRACT (HOUR FROM datetime) = 0'])

add that to the queryset. Works in Postgres, don't know about the
others

On Feb 2, 10:47 pm, HARRY POTTRER <cp368...@ohio.edu> wrote:
> I have a table that has a bunch of rows, each with a datetime field.
> These rows are created every three hours (midnight, 03:00, 06:00,
> 09:00, etc). I want to filter the queryset to only grab the objects
> where the datetime field is midnight. Is there an easy way to do this?
> Something like:
>
> Model.objects.filter(datetime__hour="00:00")
>
> or something, but that actually works...

-- 
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.



fintering a queryset based on time

2010-02-02 Thread HARRY POTTRER
I have a table that has a bunch of rows, each with a datetime field.
These rows are created every three hours (midnight, 03:00, 06:00,
09:00, etc). I want to filter the queryset to only grab the objects
where the datetime field is midnight. Is there an easy way to do this?
Something like:

Model.objects.filter(datetime__hour="00:00")

or something, but that actually works...

-- 
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.



adding custom variables to the Meta class

2010-01-04 Thread HARRY POTTRER
I have an class that I created which takes a queryset, and a field on
the model that the queryset represents. Like this:

mc = MyClass(queryset=MyModel.objects.all(), lat_lng_field='lat_lng')

The class basically filters the queryset based on some geographical
values, but in order to do that, it needs to know which field the
coordinates are stored in.

Right now I have no choice but require you to pass in a string
representing the field name. But I think a better way would be to do
it kind of like this:

class MyModel(models.Model):
lat_lng = PointField()
name = CharFIeld(max_length=20)

class Meta:
verbose_name_plural = 'My Models'
lat_lng_field = 'lat_lng'

Then just modify MyClass to get the field name from the Model's Meta
class. Is this possible somehow? If not, whats the best way to go
about this without having to pass in the field name directly?

--

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.




Re: Multiple icontains using OR - Is it possible?

2009-12-15 Thread HARRY POTTRER
you're going to need the Q object, it seems.

from django.db.models import Q
MyModel.objects.filter(Q(summary__icontains=q) | Q
(title__icontains=q))

On Dec 15, 10:32 pm, tm  wrote:
> Hello Django Users,
>
> I'm trying to use icontains to check 2 fields in the same table for a
> keyword entered into a search.
>
> ex I've tried:
>
> queryset = MyModel.objects.filter(summary__icontains=q).filter
> (title__icontains=q)
>
> and
>
> queryset = MyModel.objects.filter(summary__icontains=q,
> title__icontains=q)
>
> Neither work, although judging by the docs the second one shouldn't in
> this case.  Has anyone successfully searched a MySQL DB using
> icontains on 2 filelds in the same model?  Any help greatly
> appreciated :)
>
> T

--

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.




mixing annotations and extra()

2009-11-16 Thread HARRY POTTRER
If you had a model called Flight which has two fields, one called
"total_time", and the other called "distance", you could create a
"speed" field like so:

Flight.objects.extra(select={'speed': 'distance / time'})

Each object will now have a 'speed' field. What if one of those fields
is a result of an annotation? In my particular case, 'distance' is
stored as an attribute of a Route object which is attached to Flight
via Foreign Key.

Flight.objects.annotate(distance=Sum('route__distance')).extra(select=
{'speed': 'distance / time'})

which doesn't work. How can this be achieved? Or is it even possible?

--

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=.




Colored HTTP status codes

2009-10-27 Thread HARRY POTTRER

I was looking around the trac for the django project and came across
this ticket:

http://code.djangoproject.com/ticket/6385

It seemed like a pretty cool idea, and I hoped it would get to be
added to the 1.2 release. Then I saw it was created over 2 years ago.

I applied the patch to my cope of 1.1, and it works perfectly. I've
been using it for 2 days and have had no problems.

What can I do to get this added to 1.2? (or any release for that
matter.) I have some free time, and a weird desire to make this part
of Django. I'm not familiar on how the whole process works. What do I
need to do?
--~--~-~--~~~---~--~~
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, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Developer Position in New York City, Urgent Stuff

2009-10-14 Thread HARRY POTTRER

LOL @ everyone getting trolled by four letters

On Oct 11, 8:05 pm, Wayne Koorts  wrote:
> >> Please refrain from posting messages with this tone to the Django mailing
> >> lists.
>
> > I wholeheartedly agree.
> > The Django community has a good reputation.
> > Don't screw it up with your foul verbal attacks.
>
> Surely it should be grounds for instant removal?
>
> Regards,
> Wayne
--~--~-~--~~~---~--~~
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, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Distance across a LineString in GeoDjango

2009-10-10 Thread HARRY POTTRER

I have a model which represents a route. I can use the `make_line()`
geoqueryset method to create a LineString like so:

>>> r = Route.objects.get(pk=33)
>>> # a route from Seattle to New York to Miami, a total distance
>>> # of about 3043.8 nautical miles
>>> r

>>> # a collection of the airports used in the route
>>> # turned into a LineString
>>> ls = Airport.objects.filter(routebase__route=r).make_line()
>>> ls


How can I find the total distance of that LineString object, so that
it returns a Distance object that I can then convert to nautical
miles? the .length() method here just returns a float, which is in who-
knows-what units...
--~--~-~--~~~---~--~~
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, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



BlogRush: a best way to increase your blog traffic

2007-09-24 Thread harry

Join here: http://www.blogrush.com/r18502062


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Cashcrate: A Good Paid Online Surveys

2007-09-20 Thread harry

To make money online survey taking, I have found that Cashcrate has
been the best use of my time and efforts. Not only are the surveys
frequent and ongoing, and you don't have to earn much to get your
first bank deposit/check, but their referral program is great. You can
find out more by clicking http://www.cashcrate.com/344712

... Read more at: http://onlinetips.info/cashcrate-a-good-paid-online-surveys/


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How To Get A Low Interest Credit Card

2007-09-12 Thread harry

Consumers often have the first credit card that they ever applied for,
never really analizing how the interest rate affects their payments,
but many other options exist and can help consumers decrease their
payments and achieve financial stability.
... Read more at: 
http://onlinetips.info/tips/credit/how-to-get-a-low-interest-credit-card.php


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Add a FREE text link to your web site!!!!

2007-08-31 Thread harry

Add a FREE text link to your web site: 
http://mmo.isgreat.org/modules.php?name=Web_Links


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---