For example:
formats['DATETIME_FORMAT'] = 'N j, Y, P';
On Oct 17, 10:13 pm, timc3 <t...@timc3.com> wrote:
> I am using jsi18n for trying to internationalize some Javascript and
> its work fine.
>
> But I am wondering how to translate the datetime format used (based on
> PH
>From a python prompt can you do:
from django.utils import copycompat
If not, Django might not be imported properly. Also check your
PYTHONPATH.
On Oct 18, 10:57 pm, mathphreak wrote:
> I just upgraded my computer to Ubuntu 10.10, and now running "python
> manage.py
Take a look at:
http://lincolnloop.com/django-best-practices/projects/layout.html
After you have done the tutorials and stuff.
Tim.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Well are you doing that in a page request? Is it timing out?
Also if you are doing this with large files its going to eat memory
and processing power like you couldn't believe. I would hand this off
to another service or daemon, or in my case Celery to do the work.
On Oct 19, 10:58 am, Pradnya
I am using jsi18n for trying to internationalize some Javascript and
its work fine.
But I am wondering how to translate the datetime format used (based on
PHP's date) to a format that Javascript can parse?
Thanks
--
You received this message because you are subscribed to the Google Groups
Then it doesn't match the plus sign. I guess I need to put something
in my regex to match that as well?
--
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
Well the space was still an issue it seems.
I have the following urlconf:
url(r'^group_view/(?P[-\w\s]+)/$', 'mysite.views.vs_group_view',
name="group_view"),
Which matches the whitespace but my URL reverse match still breaks.
Any ideas?
--
You received this message because you are
To answer my own question I think this has more to do with matching a
URL that has a string in it to my urls.py.
So this should really be about creating the correct entry in my urls
to match spaces..
--
You received this message because you are subscribed to the Google Groups
"Django users"
Or you could try BuildBot.
--
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
I am working with an external REST Provider whose GUIDs might have
spaces, plus signs and a few other characters in (I can't change
this).
In my template I use the following, which normally works except when
their are encoded characters in the string:
{% url group_view group.groupName|urlencode
> [snip]
>
> "Just updated to trunk" doesn't actually tell us what level you are at. I
> know there was very recently (within the last couple of hours) a fix made
> for a recent bug introduced in upload file handling. I do not not if you
> are running with that fix or not.
>
> So first, make
I have just updated to trunk and now I get a problem uploading files
into a filefield so I did an interactive session in shellplus and got
the following:
In [1]: from testsite.media.forms import MediaObjectForm
In [2]: d = {u'path': "my test image.png"}
In [3]: f = MediaObjectForm(d)
In [4]:
Checkout the forms documentation for information on how to change what
the ModelForms generates:
http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-index
You should be able to change the types of fields and fields names/ids/
class names to then hook into your javascript.
I usually create a template directory in the application directory,
and then sub directories underneath that. Helps when you need to start
translating I have found.
Or you could check out Bradley's GitHub project here:
http://github.com/bradleywright/django-layout/tree/master
Well I fixed this by updating to the latest django trunk.
--~--~-~--~~~---~--~~
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 is a continuation of a thread I started a couple of months ago
but didn't have time to investigate more:
http://groups.google.com/group/django-users/browse_frm/thread/dc2e49515ddcbf73?hl=en=1
It seems to be some problem with psycopg2 on my Ubuntu production test
machines as I am not
> > So is that the list that you are talking about?
>
> I'm assuming those values corropond tot he fields on the model, any reason
> you can't do:
>
> self.model(**cursor.fetchone())
Just tried to do that but it seems to be returning things as a tuple
so I get the error:
ModelBase object
Well I tried that:
def get_perm(self, *args, **kwargs):
from django.db import connection
cursor = connection.cursor()
cursor.execute("""
SELECT * FROM permfindernew(2, 132);
""")
result_list = []
for row in
Hi,
I have built my models and so forth, but I have the need to check
whether the user requesting an instance or set of instances from the
database has permission to do so.
For this I have a stored procedure (saved procedure) in the database
that when I give it a user id, it then returns the
Thanks for the information, its much appreciated.
Currently we are not doing anything that special. We use Nginx as our
webserver, with the configuration set to receive large files, then
django is then sent the file and we are just using the standard method
of multiple_chunks() .
Everything on
Show us the code for your view. But are you sending through the files
in the POST each time?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
So I take it that there is no way of doing 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-users@googlegroups.com
To unsubscribe from this
Hi,
I have a fairly standard model:
class MediaObject(models.Model):
""" An instance of a MediaItem """
name = models.CharField(max_length=256)
path = models.FileField(_("File"), max_length=256,
upload_to='tempUpload/')
And thats all well and good, my uploads work and so on.
But
>
> We'll need a bit more information here, since the devil's always in the
> details. At a minimum, what is the output of
>
> groupmembers.query.as_sql()
>
> There may be a problem with exclude and nested querysets. I just
> realised I haven't explicitly tested those.
>
> Also, which
I updated my django version to revision 9710 today and now I am
getting the following error message on screen:
Caught an exception while rendering: subquery has too many columns
This is the traceback:
Original Traceback (most recent call last):
File
To answer my own question:
class MediaRSS(Rss201rev2Feed):
def root_attributes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] = 'http://search.yahoo.com/mrss/'
return attrs
--~--~-~--~~~---~--~~
You
Thanks for that! Has got me to at least display a feed:
class MediaRSS(Rss201rev2Feed):
def root_attibutes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] = 'http://search.yahoo.com/mrss/'
return attrs
def
> Or explaining what is going wrong. :-)
>
> Care to give us a few clues as to the problems you're seeing? On the
> surface, your class looks fairly much correct.
ha ha!! Yes of course this is the message that I am getting:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
Has anyone got an example of a custom feed generator?
I am trying to create one and but I don't seem to be overriding the
correct methods:
class MediaRSS(Rss201rev2Feed):
def root_attibutes(self):
attrs = super(MediaRSS, self).root_attibutes()
attrs['xmlns:media'] =
Sounds like it is, will try it out soon.
Thanks!
--~--~-~--~~~---~--~~
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
So I have a model that looks like this:
class GroupsOfUser(models.Model):
name = models.CharField(_("Name"), max_length=50)
description = models.TextField(_("Description"), blank=True,
help_text=_("Optional"))
slug = models.SlugField()
group_members = models.ManyToManyField(User,
Thanks for the help. Yeah, my terminology is quite often wrong, to
much context switching with other things.
Unfortunately I am never sure what will go in to that field, just data
that's sourced from various types of media, and populated from another
system. I do know that it will almost always
I am having a problem with getting lists/dictionaries out of the
database.
If I have for instance this in a field of my database:
[['Image format', 'JPEG'], ['Image mode', 'RGB'], ['Image size',
'1440x900'], ['Compression', '21.0 times']]
And I call it from django, I would get the following
Perhaps a note for the future but what about keeping the old comments
system, and having the new as a separate contrib app? Then we have the
choice whether to stay or migrate.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Never really looked in manage.py but I did after my question, I see it
just hooks in to django and doesn't really do much itself - so it
doesn't need upgrading.
I got fed up of trying to get this to work so I moved my templates
directory so I have the following structure.
code/
-mysite/
> Shouldn't you run it from the mysite/ directory? Even further, now
that I think
> about it, you should can simplify things by simply manually
> creating the mysite/locale directory and then doing
>
> mysite $ python manage.py makemesages -l se
>
> (just tested it and it works)
It works for
> I'd say that for being able to scan you project's locale/ subdir
> (althouth this isn´t obvious from the docs) and the dirs listed in
> LOCALE_PATHS you need specify the Python module path of
> your settings file with the --settings command line switch
> as explained in:
>
>
Well then you just test to see what fields are pulled back, but its
fine, its possible.
I am doing it for a forum.
On Aug 24, 2:51 am, Rodolfo <[EMAIL PROTECTED]> wrote:
> Just for curiosity, why would one have two forms in a single page?
> I don't think it is possible to submit the two in a
the pagination.
On Aug 23, 8:44 pm, timc3 <[EMAIL PROTECTED]> wrote:
> On quite a few pages I am using the standard generic views, mostly
> wrapped, but not always.
>
> Anyway I would like to use a list_filter on my own views, much like
> the admins - filter by date, by boolean o
It looks like you are getting a little confused. For a start you don't
match anything for just http://localhost:8000/
(r'^$', 'urus.app.views.main')
Don't know whether thats on purpose or not. anyway.
> urlpatterns = patterns('',
> # Example:
> # (r'^urus/', include('urus.foo.urls')),
In your view you need to send both forms with different names and then
in the template access each form.
Like so:
t = firstForm()
p = secondForm()
objContext = RequestContext(request, {'firstform': t,
'secondform': p})
return render_to_response('formtemplate.html',
Try this:
wget http://www.initd.org/pub/software/psycopg/psycopg2-latest.tar.gz
tar -xzvf psycopg2-latest.tar.gz
cd psycopg2-2.0.7/
python setup.py build
sudo python setup.py install
This is if the setup.cfg is alright for your Postgres installation, if
not you might have to change setup.cfg to
On quite a few pages I am using the standard generic views, mostly
wrapped, but not always.
Anyway I would like to use a list_filter on my own views, much like
the admins - filter by date, by boolean or whatever.
I can see the long way around of building up a query, though this will
probably
I am trying to match the following URL:
http://127.0.0.1:8000/services/oembed/?ref=http://127.0.0.1:8000/media/slug/guid/
And the regex that I am using:
urlpatterns = patterns('',
url(r'^oembed/(?P[-\w]+)//(?[-\w]+)/media/(?P[-
\w]+)/(?P[-\w]+)/$', 'brokersite.services.views.mediaoembed'),
HI there,
I want to produce a version of a site for mobile phones so I will have
to serve up different templates, perhaps on a different subdomain.
Is there a recommended way to go about this? Do I have to recreate all
my views?
Thanks in advance.
Might be a stupid question but how did you apply the patch?
On May 12, 5:06 pm, Wes Winham <[EMAIL PROTECTED]> wrote:
> I've been using Brian Rosner's patch from that ticket, and it's been
> working great for me. I haven't ran in to any bugs so far and it's cut
> my view code down by several
I have a situation where I want a true or false to whether an object
is in a manytomany.
For instance, I have my users, and have created (separate to the
standard django groups) a groups table called GroupsOfUser with a
relationships defined as:
group_members = models.ManyToManyField(User,
> Renaming models to notification here is not a good idea (see below for
> the reason)
>
> > def create_notice_types(app, created_models, verbosity, **kwargs):
>
>
>
> > dispatcher.connect(create_notice_types,
> > signal=signals.post_syncdb, sender=notification)
>
> The sender here must
I am trying to use django-notification in an application but I am
having some problems with it creating notice types. In fact the
notification types are for the django-messages application but the
management.py file looks correct:
from django.dispatch import dispatcher
from django.db.models
I have the following model:
class GroupsOfUser(models.Model):
name = models.CharField(max_length=50)
description = models.TextField(blank=True,help_text="Optional")
slug = models.SlugField(prepopulate_from=('name',))
group_members = models.ManyToManyField(User,
The final working form:
if request.method == 'POST':
f = GroupForm(request.POST)
if f.is_valid():
newgroup = f.save(commit=False)
newgroup.group_owner = request.user
newgroup.groupmembers = request.user.id
newgroup.groupadmins =
On Apr 1, 10:49 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote:
> On 01/04/2008, timc3 <[EMAIL PROTECTED]> wrote:
Yes I think that you are right, and I actually did that on another
form. Trouble is on that I noticed a problem with
form.save(commit=False) when
Hi,
I thought that I could add in some additional information to a form
before it gets saved as a new object in the database but the following
isn't working:
def groupadd(request):
if request.method == 'POST':
form = GroupForm(request.POST)
if form.is_valid():
I have two model development problems that I was wondering whether
they have been solved before.
Firstly lets say that I have extended the user model, but I want to be
able for a user to store multiple e-mail addresses for themselves..
Is the easiest way to store this in a separate email table,
Well I got it to work by what you said. Here is my example for those
that might come across this thread:
if errors or request.POST.has_key('preview'):
response_dict = {}
datetime_now = datetime.datetime.now()
comment = errors and '' or
I get a pop-up error saying "internal server error" - which my
javascript is handling and displaying.
The full error in the page returned is:
Exception Type:
TypeError
Exception Value:
t: t... is not JSON serializable
Exception Location:
I am trying to send back the free comments form so I can process it
with ajax, and I am getting "is not JSON serializable" all the time.
I have copied post_free_comment and then I have simply done
if errors or request.POST.has_key('preview'):
response_dict = {}
So I thought that I had this fixed, but it appears on testing that the
comments system isn't logging me in correctly.
I have gone back to using the comments framework not my own view, but
still the same problem. When posting a comment, and putting in the
username and password I am not logged
I have successfully managed to integrate the comments system into my
Django application and its looking good (with some YUI ajax nonsense to
top it off). But one thing that I would like is non-registered,
non-logged in users to be able to post a comment.
I realise that this is the goal of the
Great, thanks for the help.
I was thinking that I would have to take the complete comments system
but if I can just define my views then that is excellent. I think I
can see how to make it degrade nicely so thats no problem.
Thanks again for the help.
So I am building my App and I have got the comments system working as I
want for the first round but I would like to utilise ajax to be able to
post and update in the page, rather than new pages all the time.
I have read though some excellent posts on ajax and django, and
understand what is
61 matches
Mail list logo