do you mean that queryset will query database every time i call
user[0]?
On 1月30日, 午前9:29, akaariai wrote:
> On Jan 20, 10:12 am, newme wrote:
>
> > user = User.objects.filter(pk="")
> > user is a QuerySet
>
> > every time i call user[0], i returns a different reference.
>
> > maybe it shoul
Thanks guys, I use Satchmo by the moment but my I'm interested in some
project with protocols differents with some exclusive credit cards (VISA,
MasterCard, Dinners Club)...
This part of the project is very difficult but I'm thinking to do something
more general or more pleasant for customers and
It should return whatever the units are in the coordinate system you have
set. You will probably want to transform the geometry to UTM first.
Something that treats the geometry as flat and sets distance to be in
meters or similar. srid=3857 or 900913 will do this nicely (caveat
emptor).
-- Jeff
Hello,
Any luck on this yet?
Best Regards,
Stanwin Siow
On Jan 31, 2012, at 11:39 AM, St@n wrote:
> Hello,
>
> I am playing around with tastypie and i want to create a hierarchy of
> data.
>
> What i currently have is this:
>
>
> class keywordResource(ModelResource):
>tweets = fields
Yes Jeff, this is what I want to do. I wasn't sure if there was an easier
way. What units does the distance function return? I tried this and it
seems to return the distance in units of 10km, is this correct?
Thanks again!
On Tue, Jan 31, 2012 at 9:04 PM, Jeff Heard wrote:
> Got it. So what you
Got it. So what you want to do is a list comprehension over the geometry
object, which *should* give you individual geometries is what it sounds
like. Then you can calculate distance() from each of these. Something
like this?
interesting_point = Point(x, y)
collection = result.geom
min_dist = m
Here's a more concrete example, say I am storing shapes of all
countries. Now, the US can't be stored in one polygon (we have hawaii and
alaska), therefore I have to store the many polygons in one
geometrycollection.
Now, say I have another point on the map, I would like to know how ar it is
from
Perhaps I didn't explain it well, Jeff. I am just trying to get the
smallest distance from one point to any of the points, lines, or polygons
inside of a queryset. The data I am receiving from the queryset is a
geometrycollection already... That is how it is being stored in the
database.
On Tue, J
You should be able to create a geometrycollection object from a queryset (you
may have to use a list comprehension for this), then calculate the centroid and
take the distance from that. Taking the distance from the edge should only be a
little more
Complicated. Check the django GEOS API docs F
Hi i have seen alot of people saying to use a context processor to
include forms in multiple page. I have written a context processor
login form that just returns the django Authentication form and
everything works great including the form.errors etc except that I
cant seem to redirect from the con
Another option, if you're using unittest2 (and if you're using Django's
TestCase, you're using unittest2) is assertIn --
self.assertIn(first, [one_value, another_value])
Yours,
Russ Magee %-)
On 01/02/2012, at 8:42 AM, Furbee wrote:
> I think you can do something like:
> assertTrue(fi
I think you can do something like:
assertTrue(first == one_value or first == second_value)
At the same time, when unit testing, you should really know exactly what a
value returned from a method is.
Furbee
On Tue, Jan 31, 2012 at 4:32 PM, xino12 wrote:
> Hello, I'm doing unitTesting and I
Hello, I'm doing unitTesting and I want to know if it's possible to
accept more than one value in the assetEqual method.
Maybe this works
assertEqual(first, one_value or another_value)
Sorry but I'm new programming with django.
Lots of thanks,
Rubén
--
You received this message because you a
I have a model that currently stores a Geographic Point (Using Django
GIS (GeoDjango)) and another model that has a field to store a
geometry collection (A collection of polygons, lines, and or points).
I am trying to find the distance from the point to any one of the
shapes in the geometry collec
Hi all,
I am newbie in django and while trying to write a database router for
using multiple database I did something like :
class Meta:
using = 'somedatabasename'
in Django models.py.
However while doing a syncdb I get an error like this :
TypeError: 'class Meta' got invalid a
On Jan 30, 5:14 pm, darwin_tech wrote:
> hmmm. I am the superuser, but I went ahead and tried the createuser
> command to make another. Still the same in the admin. No models or
> user/privilege options. The strange thing is there are boxes where you
> would expect apps/models top be, but they a
On Tuesday, 31 January 2012 20:04:33 UTC, Kolbe wrote:
>
> Hi guys, I created a new app and within that app, I also specified a
> new admin.py file. Is that how the admin portion for that app is
> managed?
>
> Anyway, after I created my models and syncdb, then run server, I have
> been unable
Hi Dennis,
thanks for the reply. The index / root of my site will contain the
registration page for new users to sign up and contain a login page
for people who are already registered to log in. so yes i would want
this functionality on the default page and not have to redirect to a
specific regis
Hi guys, I created a new app and within that app, I also specified a
new admin.py file. Is that how the admin portion for that app is
managed?
Anyway, after I created my models and syncdb, then run server, I have
been unable to access the admin gui.
I keep getting this error below, but I don't un
On Tuesday, 31 January 2012 18:38:18 UTC, JJ Zolper wrote:
>
> Sam,
>
> Since I'm on Ubuntu know with my Python and Django I'm wondering which
> CPython I should download?
>
> I saw stackless python on the python.org site but I'm not sure if that's
> what CPython version I would need. I thought t
Sam,
Since I'm on Ubuntu know with my Python and Django I'm wondering which
CPython I should download?
I saw stackless python on the python.org site but I'm not sure if that's
what CPython version I would need. I thought there was a standard CPython?
Any help about my interpreter for Python on
Hi if anyone could point me in the right direction it would be greatly
appreciated. Basically i have my index view which renders to
index.html the main page for a site. I need to know the best practice
to have my index view contain the registration form from django the
registration app so when the
Useful little package for y'all, written by Julien Phalip, which I've
packaged and pushed to PyPI.
django-private-views - https://github.com/dabapps/django-private-views
Inverts the usual @login_required logic, and instead makes all your views
private by default, and gives you a @login_not_requ
https://github.com/agiliq/merchant the braintree backend is good, so is
stripe. Depends on your type of transaction and the pricing you get.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://group
> If you don't want to use a custom version of Django, and can't wait
> for 1.4, you should be able to set the time zone for per database
> user. Connect to the database with your database user, and do this:
> ALTER USER "thedbuser" SET TIME ZONE 'wanted_zone'; -- where
> wanted_zone would be UTC f
If it was a BOM issue, wouldn't it get prepended? Unfortunately, I don't have
any better ideas either.
Aaron
--
This message was sent from a mobile device
On Jan 31, 2012, at 7:56, Ustun Ozgur wrote:
> No idea actually, but I would look for BOM related issues.
>
> Ustun
> --
> You receive
On Tue, Jan 31, 2012 at 07:59:38AM -0800, Jaroslav Dobrek wrote:
class Lexeme(models.Model):
class Meta:
unique_together = ((u"entity", u"language"),)
I beleive this will not work because Lexeme is not abstract, and
it has no 'entity' field.
language = models.ForeignKey(Langua
Unfortunately I deal with very different shapefiles and I create models
on the fly with ogrinspect tool.
I cannot know the shapefile structure, before user upload: for this
reason a table per shape is IMHO mandatory (as well as a clearer approach).
Are you sure you need a new model for every s
Hello,
I have got a class Lexeme which I would like to define as follows:
class Lexeme(models.Model):
class Meta:
unique_together = ((u"entity", u"language"),)
language = models.ForeignKey(Language)
# ...
I would like to have different types of lexemes, each of which has
Are you sure you need a new model for every shape your user inserts?
Most likely you need to design a generic models in which you would
insert new rows for every shape.
I mean generic in the sense that it is designed to contain different
shapes not any special Django or Python stuff
2012/1/31 Ale
No idea actually, but I would look for BOM related issues.
Ustun
--
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/-/YpAgjT_A98MJ.
To post to this group, send
+1 for debug toolbar.
If you choose to do it manually though, you can make use of a middleware
instead of passing templates in each view function explicitly, as shown
here: http://djangosnippets.org/snippets/766/
Ustun
--
You received this message because you are subscribed to the Google Gr
Wow! Congratulations on this release.
I'm looking at it right now.
:D
On Tue, Jan 31, 2012 at 1:11 PM, Jeff Heard wrote:
> https://github.com/JeffHeard/ga_ows
>
> http://geoanalytics.renci.org/uncategorized/ogc-wfs-for-django-released-on-github/
>
> It's not feature complete yet by any means, b
Hi list.
I need to create an app in which the user can upload a shapefile, which
must be stored in a database table with LayerMapping from
django.contrib.gis.utils, as explained here:
https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/#layermapping
The problem is that I need to upd
https://github.com/JeffHeard/ga_ows
http://geoanalytics.renci.org/uncategorized/ogc-wfs-for-django-released-on-github/
It's not feature complete yet by any means, but it is quite usable. There
is also an implementation of WMS included, but it is currently undocumented
as I clean up that code and
On Tue, Jan 31, 2012 at 5:43 AM, jj_Diego wrote:
> Well...
>
> I'm form Perú and nowadays I'm working with my friends on a proyect
> based on python...
>
> but our first difficulty its the online transactions using credit
> cards (visa, mastercard, diners club) in aweb store
>
> If anybody knows
Well...
I'm form Perú and nowadays I'm working with my friends on a proyect
based on python...
but our first difficulty its the online transactions using credit
cards (visa, mastercard, diners club) in aweb store
If anybody knows something or can help me... please send me an email.
Thanks
-
Thanks donarb, I'll give that toolbar a try.
Mario: I though Python has all that fancy metaprogramming stuff like
Ruby with Objective C style reflection?
On Mon, Jan 30, 2012 at 12:19 PM, donarb wrote:
> Use the Django Debug Toolbar, it shows all kinds of things. For
> templates, it shows the na
Hi all
I am presently setting up my shop using satchmo. I managed to
integrate zinnia for my blogging.
I am looking forward to integrate on how to embed youtube video using
zinnia blogpost.
Has anyone come across this requirement and help me out of this
please..?
++
--
You received this message
39 matches
Mail list logo