Hi,
I've create a model:
class ImagenesLugar(models.Model):
archivo = models.ImageField(upload_to="imageneslugar/")
texto = models.CharField(max_length=400)
The thing is that when i create a new instance of this model and
assign instance.archivo to a file then instance.archivo.path does
Hi all,
I'm trying to deploy my app under a non-root url (http://myserver.com/
myapp), using apache and wsgi, but I'm having troubles with the
configuration of the authentication framework.
When trying to log in, I get redirected to the url I defined for that
in the settings file (LOGIN_URL), but
Hi,
I've been editing the DevelopersForHire page and I get a possible spam
message.
If i go with a proxy it says that too but adds that i've more links
than the allowed max number.
Also, i wanted to add a ticket about this but i got the same messages.
I'm not spamming, look, I'm a human =)
--~-
Hi,
I'm creating a django proyect and when i want to add a group and the
group's permission i get a "Table 'mysite.auth_group_permissions'
doesn't exist"
I've seen that in some tutorials, on syncdb, the output contains the
following line:
Creating many-to-many tables for Group model
I never see
Hi,
I'm developing a django project and I want to put a chronometer in one
of my pages, so pass X seconds the view will be reload again.
Can anyone help me?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to d
Buenas
Os informo de que desde el 22 de septiembre al 1 de octubre se
imparte
en GRANADA un curso presencial de Django de 40 horas de duración. En
el que se enseñan las bases para comenzar con este framework, así
como
su integración con Ajax.
Aquí teneis el enlace:
http://continua.ugr.es/data_h
GLatLng looks a good start:
http://django-googlemap.googlecode.com/svn/trunk/geo/googlemap/models.py
On Sun, Mar 15, 2009 at 11:32 PM, Sergio wrote:
>
> Hello,
>
> I'm working on field validation for latitude and longitude. I need to
> validate them according to the DMS (degree, minutes, seconds
se a middleware as a decorator to a view function (and vice versa):
from django.utils.decorators import decorator_from_middleware
newview = decorator_from_middleware(middleware_class)(yourapp.someview)
--
Javier
--~--~-~--~~~---~--~~
You received this mes
On Thu, Jul 9, 2009 at 1:38 PM, Keith Pettit wrote:
> I though there was something similar to doing a "pk = obj.save()" but I
> can't seem to find the right way to do it.
after doing the "obj.save()", the obj will have
) and
join() methods just for this). but for multi-process Django i don't
think it would work.
maybe is it possible to use signals like this? i haven't checked the
source, but it seems plausible to have them dispatched _after_ the
request is serviced.
--
Javier
--~--~-~--~--
On Thu, Jul 9, 2009 at 3:30 PM, Javier Guerra wrote:
> maybe is it possible to use signals like this? i haven't checked the
> source, but it seems plausible to have them dispatched _after_ the
> request is serviced.
no, it doesn't work like that. also, it seems that
%}
{% include "column.html" %}
{% endwith %}
{% with articles.right as col_articles %}
{% include "column.html" %}
{% endwith %}
{% with articles.center as col_articles %}
{% include "column.html" %}
{% endwith %}
-
--
Javier
--~--~
know that this will generate three DB tables. The media and
> document tables will share primary keys, with the media table defining
> any fields not found in the document table.
that's what the 'abstract = True' avoids
--
Javier
--~--~-~--~~~-
(if any) architecture-wide design choice.
--
Javier
--~--~-~--~~~---~--~~
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
mparable to memcached.
the main hurdle is to control expiry when needed; but on simple cases
(like these) can be the best way.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
On Mon, Jul 13, 2009 at 4:36 PM, David wrote:
>
> Thanks Amit. Here is the problem that I meet.
>
> alerts = Alert.objects.filter((Q(dataset=dataset1)
>
> for eachalert in alerts:
> e_metric1 = eachalert.criteria1_metric1
try "e_metric1 = eachalert[criter
--
or in the urls.py:
urls.py
from django.views.decorators.cache import cache_page
urlpatterns = ('',
(r'^foo/(\d{1,2})/$', cache_page(my_view, 60 * 15)),
)
--
Javier
--~--~-~--~~~---~--~~
You r
On Mon, Jul 13, 2009 at 5:48 PM, David wrote:
> TypeError: 'Alert' object is unsubscriptable
sorry, i was mixing languages.
try "e_metric1 = eachalert.get (criteria1_metric1)"
--
Javier
--~--~-~--~~~---~--~~
You received this
On Tue, Jul 14, 2009 at 12:08 PM, Fred
Chevitarese wrote:
> Use the Chrome Browser to see the source code generated by Django, and
> then you can follow the css of your page.
all browsers can show the page source, no need to push for any
specific one (yeah, Chrome is my favorite)
--
and verifying the
response and effects.
hope that helps,
--
Javier
--~--~-~--~~~---~--~~
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
pearance of
your website, quite possibly even change the whole user experience
without rewriting the 'operational' code.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
x27;m redirected to /page (without the hash part).
> Does anyone else have ideas of how to do something like this? Thanks!
maybe urlencode()'ing the '/page#section1' parameter?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you a
l concepts could
be alot more detached from the DB, and a thick business.py layer (with
lots of tests!) would be definitely the best answer.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django us
wser's fault, should be
worked around with JavaScript
--
Javier
--~--~-~--~~~---~--~~
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
i understand it, the #part doesn't get _back_ to the server; but is
it getting to the browser in the first place? not in the 'current
url', but in the 'action' attribute of the form, (or 'href' of a
link?)
--
Javier
--~--~-~--~~~--
don't forget Flot: http://code.google.com/p/flot/ why do it in the
server when you can use your user's machine?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gr
's a lot of insights on
this (don't remember who gave that talk, and i can't access youtube
from work)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post t
ject into a
string-like value. maybe when 'examining' it.
if you simply try to access its fields, you should find them there.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users&
python code, and when i begin
with the template, i fire up Quanta (the web devlopment IDE for KDE).
it uses the same Kate KPart, so it still works great with Python, but
adds a lot of HTML tools (previews, CSS editor, element editor, etc.)
--
ust write a middleware that picks the name from the original URL
and stores it (or maybe the whole User object) in the request.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
of the SQL you want. much better is to
think in terms of the data you want from the DB.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
ard characters in the hostname.
other servers do it different.
--
Javier
--~--~-~--~~~---~--~~
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
d how to add a column with the total number of items:
Order.objects.annotate(Count('item'))
but i can't count subsets of items. Is there any way to do that in
the DB, or I have to do it in Python?
--
Javier
--~--~-~--~~~---~--~~
You received this mes
;s the server's job to optimize it.
It looks like it's doing the exact same fetches as the equivalent
JOINs
tks a lot
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Wojciech Gryc wrote:
> Filtering by user ID each time would
> be extremely wasteful, would it not?
not with the right indexes.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users
On Tue, Aug 11, 2009 at 2:47 AM, Harish wrote:
> s there any other way of doing this?
read the whole result set and use Python sorting.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djan
27;s content in the response.
done!
in my case, i'm using NginX, so i had to add an 'X-Accel-Redirect'
with the path to the file. i think for Apache and lightttpd you do
something similar, but pass an URL instead of a local path. be sure
Ben's comment is more like my step 2, but with a
couple extra hoops to get to the URL. doesn't do anything for
security, since in he ends serving the file with Django anyway.
> Javier, could you post some example code? I'm pretty sure this is bang-
> on what I want, although
as a filter.
put the logic in the view function (or maybe in the model!) and hand a
simple boolean to the template
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
27;t see any value on latin1 or other
limited kludges)
--
Javier
--~--~-~--~~~---~--~~
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
plate? Is there a centralized/better/prescribed way to do
> this?
there shouldn't be any URL inthe templates, either use {% url ... %}
for linking to views, or {{MEDIA_URL}}/relative/path for media
content.
--
Javier
--~--~-~--~~~---~--~~
You received thi
On Tue, Aug 18, 2009 at 1:14 PM, Sydney Weidman wrote:
>
> On Aug 18, 11:57 am, Javier Guerra wrote:
>> On Tue, Aug 18, 2009 at 11:49 AM, Sydney Weidman wrote:
>> > I'm moving some Django applications that used to be served from the
>> > root of the site to
ttp://docs.djangoproject.com/en/dev/topics/auth/#authentication-data-in-templates
--
Javier
--~--~-~--~~~---~--~~
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
On Fri, Aug 21, 2009 at 2:09 PM, Joshua Russo wrote:
> Why does this not work?
> >>> import decimal
> >>> tst = {'myTst': (decimal.Decimal, 0)}
> >>> for k, v in tst:
> ... print('%s: %s' % (k, v))
use:
for k,
def strippeddoamin (self):
return stripdomain(self.domain)
--
Javier
--~--~-~--~~~---~--~~
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@goo
On Mon, Aug 24, 2009 at 1:42 PM, Merrick wrote:
>>>> url = yourmodel.objects.get(id=1)
>>>> url.domain
> u'http://yourdomain.com/'
what does url.stripdomain() return?
--
Javier
--~--~-~--~~~---~--~~
You received this mess
rl.stripdomain() as a property:
class ..:
...
@property
def stripdomain(self):
.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
anted, of course, that you use appropriate indexes.
Django will automatically add the most important indexes for you.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
om django import template
>
> register template.Library()
should be 'register = template.Library()'
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> register.filter(uscurrency)
should be
register.filter ('uscurrency', uscurrency)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
antts"[{"rows".
instead of
{"gantts":[{"rows".
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
ge to use profiles instead of table
inheritance?
I know the userprofiles were the only choice before there was table
inheritance; but is it still the best way?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
want some data stored in the intermediate relationship table,
define the intermediate model and use the 'through' parameter to the
fieldtype
(http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.through)
--
Javier
--~--~-~--~~~
On Mon, Sep 7, 2009 at 10:55 AM, Samuel Hopkins wrote:
> Anyhow, the purpose of this email was just to ask the community what
> editor(s) they preferred to use with Django.
Kate and Quanta+
--
Javier
--~--~-~--~~~---~--~~
You received this message becau
ight against so much existing code as you might
have to when making Drupal work as you want. Many people feel they
have to code less to write their own Django-based CMS than to
customize an existing one. If that's your case, you're a lot less
likely to brea
() to the updated object's get_absolute_url()
--
Javier
--~--~-~--~~~---~--~~
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 uns
esponse" freeing up Django resources.
note that you can simply return that same header without waiting for
this patch. the main advantage will be that it automatically uses the
appropriate header for different servers.
--
Javier
--~--~-~--~~~---~--~~
You receiv
n most cases, you want the possibility of several contacts per user,
so you can use the many-to-one. the only drawback if that you get an
extra step to go from user to contact: "User.contact_set.all()". if
you use one-to-one, the ORM lets you skip that step and write simply
"User.
kinds might use 'keys
and values', or 'documents', or maybe a 'forest of objects'...
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
ght that using a 'test' directory with an empty
__ini__.py and the tests files inside that should work...
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
On Mon, Sep 21, 2009 at 3:29 PM, Szymon wrote:
> Isn't "self" refers to existing object?
only if you include it in the parameter list:
class whatever:
def method (self, moreparams...):
... use 'self' instance...
--
Javier
--~--~-~--~~-
is: Store them in a the database or store them in the filesystem as
> actual files?
- store in the filesystem
- in the view that would serve them, don't read the data, but send an
"X-SendFile" header to make apache deliver it.
--
Javier
--~--~-~--~~
t is not accessible by url as long
as apache can read it.
I don't know if this is enough security for your app.
Javier (a different one, BTW).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users
#x27;filepathname'
return resp
note, i've done this with NginX (which uses 'X-Accelerate' instead of
'X-SendFile'), but i've heard it works on Apache too
--
Javier
--~--~-~--~~~---~--~~
You received this message because you
sed the django templates, I use direct (and ugly and dirty)
Mysql queries instead of using the django ORM, so I don't know if it's
going to be useful for you, but I can upload it to google code, if you
desire.
Best regards,
Javier.
--~--~-~--~~~---~--
look now 232323
> etc
what i usually do is:
- in the view just get all the books, ordered by author
- in the template iterate over the books, with an {% ifchanged
book.author %} to display the author name
--
Javier
--~--~-~--~~~---~--~~
You received thi
'use from any project', not "copy to every project".
for that, it has to be accessible from the python path, since it's
just a couple of python modules
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On Tue, Sep 29, 2009 at 4:24 AM, Kenneth Gonsalves
wrote:
> will document after trying it in production - a zillion times faster
faster than. ? flup?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
{{ element.name }} - Desc: {{ element.desc }}
{% endfor %}
--
Javier
--~--~-~--~~~---~--~~
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
sorry, the right syntax is
{% for key, element in toto.items %}
Name: {{ element.name }} - Desc: {{ element.desc }}
{% endfor %}
(as documented in
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for )
--
Javier
--~--~-~--~~~---~--~~
You
rking, replace the actual data copying with the right
headers to make the frontend webserver deliver the file.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
Bogdan I. Bursuc wrote:
> You may consider
> creating a tag or a filter for this job.
or a function on the model class
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
On Fri, Oct 9, 2009 at 8:09 AM, Aaron wrote:
> What is the proper way to introduce optional arguments here?
add a second line to your URL mappigs with the third argument:
(r'^(?P[-\w]+)/(?P[-\w]+)/$', 'model_view'),
(r'^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/$
On Fri, Oct 9, 2009 at 9:38 AM, Aaron wrote:
>
> On Oct 9, 11:22 am, Javier Guerra wrote:
>> add a second line to your URL mappigs with the third argument:
>>
>> (r'^(?P[-\w]+)/(?P[-\w]+)/$', 'model_view'),
>> (r'^(?P[-\w]+)/(?P[-\w]+)/(?P[
that querysets are evaluated? Meaning that you actually
> access them, just create querysets.
also, from the transcript you send, it's not obvious if you actually
run the app in the same python process or if it's running separately
and you'd want to magically see the ef
uld manage to have two fields on Objective, that
return the completed and remaining task sets respectively...
unfortunately, i have no idea how to do that.
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&q
On Fri, Oct 16, 2009 at 2:35 PM, claytonbonelli wrote:
> The image file is displayed on
> my html page, but the SVG file dont.
maybe some mime-type configuration missing?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscri
ew:
mypiles = request.user.collectionuserpile_set.order_by(collection_type)
in the template:
{% for pile in mypiles %}
{% ifchanged %} {{pile.type}} {% endifchanged %}
{{pile.item}}
{% endfor %}
--
Javier
--~--~-~--~~~---~--~~
You received this message because you ar
r
t in CollectionType.all())
in the template:
{% for type,pile in mytypes %}
{{type}}
{% for item in pile %}
{{item}}
{% endfor %}
{% endfor %}
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
On Tue, Oct 20, 2009 at 1:47 PM, Михаил Лукин
wrote:
> What is your best practice in such situations?
write a custom tag
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
tween the webapp and the background job, unless you modify
either mod_wsgi or flup to spawn a thread for background
processing (Graham? what would it take to add that to mod_wsgi?)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscr
augmented with flash libraries, like the great one from
http://swupload.org/)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-use
gle user that could
understand what it was asking, and why. and once it's disabled on a
machine, it's very hard to enable again.
the server doesn't have to be PHP, in fact it's usually FTP. the PHP
part is mostly to set the options for the tag
--
Javier
--~--~---
On Tue, Oct 27, 2009 at 1:54 PM, Todd Blanchard wrote:
> I'm starting a project where some models need to be fully versioned.
check django-reversion:
http://code.google.com/p/django-reversion/
--
Javier
--~--~-~--~~~---~--~~
You received this message
to 'self')
name
creation_date
if a host can belong to several hostgroups simply change the foreign
key from host to hostgroup to a ManyToManyKey.
make sure that the 'parent' field in hostgroup is null'able, to
account for 'main' groups
--
Javier
--~--~---
t want a database query for every request, because menu entry
> list would be very low frecuency updated
check
http://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching
specifically the {% cache %} {% endcache %} tag
--
Javier
--~--~-~--~~---
On Thu, Oct 29, 2009 at 10:18 AM, pbzRPA wrote:
> It's a pity django does not provide this kind of
> functionality.
hum it would be a pretty impressive feat for an ORM to take some
arbitrary python code and recompile it to (portable!) SQL to make the
DB do the work.
On Fri, Oct 30, 2009 at 4:05 PM, TiNo wrote:
> SQL's GROUP BY is made for this isn't it?
no, it's not.
SQL's GROUP BY discards 'individual' rows off the result, showing only
'grouping' rows.
--
Javier
--~--~-~--~~~---
On Mon, Nov 2, 2009 at 2:00 PM, Max Battcher wrote:
> I'm rather fond of using URLs of the form:
>
> http://example.com/~username/
+1
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
ecord to the response, roughly:
template = load template
response = httpresponse()
for record in queryset:
response.write (template.rendertostring (record)
return response
i'm not sure; but this might let the response object stream the data,
greatly reducing ram pres
what about
people_with_bffs = Person.objects.filter(bbf_id__isnull=False)
?
(disclaimer, i haven't tried it)
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To pos
rner.
maybe not the embedded chat, (that is better handled with a full Comet
architecture); but the 'more messages available' notification. in
this case, the query is not about messages for a user, rather it's
more like 'messages about this context', where the
Karen Tracey wrote:
> Thus, the actual sort is done by the database.
IOW, it's not about stable vs. non-stable sort algorithms, since it doesn't
transform one view's data to the next. instead, both views are generated from
the same data with different parameters.
--
Javier
)
(i'm not sure about '|'ing the Q() objects with the queryset 'user.events_set',
but i don't know how to express this as a Q() object)
--
Javier
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
he tables, it
makes sure to add any index that would help on the usual JOINs
--
Javier
--
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
and
nginx (at least) have this capability, but using different headers.
--
Javier
--
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
ect_id=task_id,
template_object_name="task",
extra_context = { 'project': project }
)
--
Javier
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
's a matter of taste
--
Javier
--
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
f using flot) or somebody else (if using Google charts)
deal with the heavy tasks.
--
Javier
--
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
ment.
if you use a JavaScript template (there are several jQuery plugins),
just return the data in JSON.
--
Javier
--
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.
T
1 - 100 of 677 matches
Mail list logo