Re: INCLUDE with parameters

2010-02-05 Thread Atamert Ölçgen
On Saturday 06 February 2010 06:35:41 Osiaq wrote: > Hello! Is there any way to pass parameters into INCLUDE implemented > within django template? > Something like this: > > {% include 'test.html' x='10' %} > > or similar? > Included templates are rendered with a copy of the main template's

ANNOUNCE: Django 1.2 beta released

2010-02-05 Thread James Bennett
Tonight we've released Django 1.2 beta 1: * Blog entry: http://www.djangoproject.com/weblog/2010/feb/06/12-beta-1/ * Release notes: http://docs.djangoproject.com/en/dev/releases/1.2-beta-1/ * Checksums: http://media.djangoproject.com/pgp/Django-1.2-beta-1.checksum.txt Note that this constitutes

Re: Template-Include and block.super

2010-02-05 Thread newspaper-django-lackey
The others are correct. You can't put block tags inside an include. It's pretty logical really. The block system cascades down templates through the "extends" system. Includes are by nature outside that track. They can be pulled into any template at any point in the process. Block tags in an

Re: Problem with apache server

2010-02-05 Thread newspaper-django-lackey
If you are using wsgi you can touch your wsgi settings file and it has the same effect as restarting apache without a restart most of the time. If you are only running one site on the django installation it isn't any better, but if you are hosting multiple sites and your change is on one

Re: django-app user clashes with python-module user

2010-02-05 Thread newspaper-django-lackey
Naming conflicts are a consistent issue brought up on the boards. I've had issues several times where an app name conflicted with a core Python library, Pluggable, or library extension. Generally the process I follow for apps, both personally created and pluggable, is to put them not directly on

Re: Pulling a user to save a form

2010-02-05 Thread Dylan Evans
user = User.objects.get(username__exact='bob') Works fine for me, you may want to try get since it will throw an exception if there is no matching user. Then you know the problem is elsewhere. On Sat, Feb 6, 2010 at 11:30 AM, kamilski81 wrote: > I would like to save a form

Re: Speeding the code-test-debug cycle

2010-02-05 Thread Russell Keith-Magee
On Sat, Feb 6, 2010 at 1:25 AM, Malcolm Box wrote: >> From there, I have only been able to reduce test time down from hours >> to minutes. Tests ought to run in seconds - so fast that you can run >> them after every few edits - TDD. > > Totally agree, and what I'm looking

INCLUDE with parameters

2010-02-05 Thread Osiaq
Hello! Is there any way to pass parameters into INCLUDE implemented within django template? Something like this: {% include 'test.html' x='10' %} or similar? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: django_evolution evolve not found

2010-02-05 Thread Wiiboy
Shawn: Really? I'm not surprised, it had more than its fair share of bugs. Thanks for the link BTW. Is that your project? -- 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

Re: Django or CMS.

2010-02-05 Thread Kenneth Gonsalves
On Friday 05 Feb 2010 5:39:47 pm Rob B (uk) wrote: > I can't seem to find a decent CMS that would fit the criteria. What > are people's opinions / experiences with CMS'? What would you > recommend? Thanks > although I am a django fanatic, in this case I would point you to Plone - as long as

[MODELS] Default value depending on other table field

2010-02-05 Thread mf
I have a table named service with a type field. The amount of the service depends on the type field. The price of the type of service could change. But the amount could sometimes be a different value, because of special clients, discounts, etc... I would like to fill the amount field with the

Re: djangogolf

2010-02-05 Thread Kenneth Gonsalves
On Friday 05 Feb 2010 7:23:02 pm scoobygalletas wrote: > Hi! > > http://greenchilly.in/ throws: > > 502 Bad Gateway > nginx/0.6.32 > yes fixed -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS http://nrcfosshelpline.in/web/ -- You received this message because you are subscribed

Pulling a user to save a form

2010-02-05 Thread kamilski81
I would like to save a form by doing the following: #Goal has a User ForeignKey (django.contrib.auth.models.User) - class GoalForm(ModelForm): class Meta: model = Goal --- class Goal(models.Model): user = models.ForeignKey(User, editable=False) -- view.py

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-05 Thread mrts
Patch has been uploaded to http://code.djangoproject.com/ticket/12780 . After applying the patch you can override def formsets_are_valid(self, formsets, form, form_is_valid, instance, request): and do any complex validation you like. As it's rather arcane, I've provided an

Re: django_evolution evolve not found

2010-02-05 Thread Bill Freeman
Perchance it needs to be added to settings.INSTALLED_APPS ? On Fri, Feb 5, 2010 at 12:22 PM, gintare wrote: > I have installed django_evolution from Debian package. > It is now under /usr/lib/pyhton2.5/site-packages/django_evolution > > i also added : >  ln -s `pwd`

Re: getting dictionary values on template

2010-02-05 Thread fchow
On Feb 5, 1:24 am, Mike Ramirez wrote: > > http://docs.djangoproject.com/en/dev/topics/templates/#variables > > {{ mydata_dict.key }} > > Templates use the dot operator to access attributes to a variable. The above will attempt to find a key in the dict named 'key'...which

Re: Flat file application for binary data?

2010-02-05 Thread Mike Ramirez
Also check the FileField for info on how django handles files by default. Probably the best starting point. http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield and sending files is a view like this: def project_download(request, project, filename, version): project_file =

Re: Flat file application for binary data?

2010-02-05 Thread Mike Ramirez
On Friday 05 February 2010 10:44:42 John DeRosa wrote: > I'm building a site that will include using lots of image files, audio > clips, and video clips. Including users uploading these things and then > later referencing them. > > I don't want to store this binary data in the database, but

Re: Accesing a foreign key parent model attribute from a related class

2010-02-05 Thread eaman
On Feb 5, 10:01 pm, Dj Gilcrease wrote: [CUT] > http://dpaste.com/hold/155132/ > > That should do it Thanks a lot, I was thinking of getting that path in a couple of ways that are way less 'pythonic' and elegant then your proposed solution. instance.gallery.dir and a

Bulk adding permissions from QuerySet failing, what am I doing wrong?

2010-02-05 Thread Eric Chamberlain
Hi, This is my first time working with groups and permissions. I'm trying to bulk set permissions on a group: apns_users, created = Group.objects.get_or_create(name='APNS Users') if created: # set permissions permissions =

Re: Flat file application for binary data?

2010-02-05 Thread Wayne Koorts
>> Anybody know of an suitable application for this? >> > > FileFields and ImageFields are by default stored on disk, with just a pointer > stored in the db.  For more examples, take a look at David Larlet's > django-storages (http://code.welldev.org/django-storages/wiki/Home) and > Justin

Re: Flat file application for binary data?

2010-02-05 Thread Peter Herndon
On Feb 5, 2010, at 1:44 PM, John DeRosa wrote: > I'm building a site that will include using lots of image files, audio clips, > and video clips. Including users uploading these things and then later > referencing them. > > I don't want to store this binary data in the database, but instead

Re: Sort by attribute not in database

2010-02-05 Thread Peter Herndon
On Feb 5, 2010, at 1:02 PM, ChrisC wrote: > This may be an easy question to answer, but I just can't seem to do > this. > > I have a model called Computer which has a function (turned into an > attribute via the property builtin) which queries the local filesystem > to get a modification time.

Re: Accesing a foreign key parent model attribute from a related class

2010-02-05 Thread Dj Gilcrease
On Fri, Feb 5, 2010 at 12:39 PM, eaman wrote: > I'd like to upload the Photos (models.ImageField(upload_to='foto') ) > to ``dir / foto``, with 'dir' taken from the class Gallery. > My question is: how can i build the  path "(upload_to='foto')"  with > Gallery.dir ?

Accesing a foreign key parent model attribute from a related class

2010-02-05 Thread eaman
Hello, I'm working on a photo gallery web app, and I've got a question aboute the models: class Gallery(models.Model): title = models.CharField(max_length=30) dir = models.CharField(max_length=20) class Photo(models.Model): title =

Flat file application for binary data?

2010-02-05 Thread John DeRosa
I'm building a site that will include using lots of image files, audio clips, and video clips. Including users uploading these things and then later referencing them. I don't want to store this binary data in the database, but instead want to store them in disk files. I've looked for a Django

Sort by attribute not in database

2010-02-05 Thread ChrisC
This may be an easy question to answer, but I just can't seem to do this. I have a model called Computer which has a function (turned into an attribute via the property builtin) which queries the local filesystem to get a modification time. ie. Computer.object.all()[0].last_modified returns a

Re: Problem with Last-modified header and Apache/mod_python

2010-02-05 Thread Malcolm Box
Answering my own question in case anyone else runs into this: The problem was caused by the last_modified field in the database being empty for existing assets (the last_modified stuff was added later to the model). When the last_modified database field is 0, then Django doesn't send a

Re: django_evolution evolve not found

2010-02-05 Thread Shawn Milochik
Django evolution has been discontinued. People use South instead. http://south.aeracode.org/ If you need help with it, I'd be glad to help. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django or CMS.

2010-02-05 Thread DJ Ango
Dude django-cms is great. Has most of that stuff. Try it out, my non- tech buddies use it easily. http://www.django-cms.org/ On Feb 5, 4:09 am, "Rob B (uk)" wrote: > The design agency I work for are looking into CMS options.  Being a > Django man myself I'm hoping to

Re: Any way to make get_or_create() to create an object without saving it to database?

2010-02-05 Thread kelvan . mailinglist
Oh, nice. thx 2010/2/4 Tom Evans tevans...@googlemail.com On Wed, Feb 3, 2010 at 9:44 PM, kelvan.mailingl...@gmail.com wrote: I have a similar problem. In my database is a result class. You need an exam, a user and the points to create a result and points are without null-values. Now I

Re: Speeding the code-test-debug cycle

2010-02-05 Thread Malcolm Box
Hi, Thanks for the suggestions. 2010/2/2 Phlip > Malcolm Box wrote: > > > Has anyone got any ideas on how to speed this up - for instance, is there > a > > way to say "use an existing test database"? > > Per my other advice to use fab and a fabfile with a test() target in

django_evolution evolve not found

2010-02-05 Thread gintare
I have installed django_evolution from Debian package. It is now under /usr/lib/pyhton2.5/site-packages/django_evolution i also added : ln -s `pwd` /django-trunk/django /usr/lib/python2.5/site-packages/ django_evolution But the command 'evolve' is not recognized. I.e. i am in project "links"

UPS shipping module in Satchmo - help?

2010-02-05 Thread django_jedi
Hi all, Has anyone customized the UPS shipping module of Satchmo? Here's what we'd like to do: The customer wants UPS to give a quote for all products being shipped in one container (by default, b/c of the way Satchmo communicates w/ UPS, the quote is assumes each product will get shipped in

Re: static serve problem

2010-02-05 Thread Atamert Ölçgen
On Friday 05 February 2010 15:25:27 H.İbrahim Yılmaz wrote: > i wrote views myself get everything from '/extend' directory. > How can i fix that? > Yours Sincerely, extend/login.css is a relative URL (relative to current URL whatever that is), if you do /extend/login.css then it becomes an

Template and Form Question

2010-02-05 Thread Jon Loeliger
Folks, I would appreciate some help figuring out how to create a templated form scenario. The quick form of the question is either: How do I iterate over two form field list simultaneously in my template using {% for f in form %}, sort of like {% for f,g in form1,form2 %}? or

ValidationError: ManagementForm data is missing or has been tampered with

2010-02-05 Thread Knut Ivar Nesheim
Hello fellow Django users, >From time to time users of one of my applications has problems with formsets. More specifically: ...my stuff... File "/usr/lib/python2.4/site-packages/django/forms/models.py", line 399, in __init__ super(BaseModelFormSet, self).__init__(**defaults) File

models and inheritance

2010-02-05 Thread msoulier
Hi, I have an existing model that I've used for some time, and just recently I had to break it up into two related models that share a great deal, but have some difference, so I used inheritance to create two subclasses. I notice that syncdb is smart enough to not create an sql table for the

Re: Django or CMS.

2010-02-05 Thread Jonas Obrist
Have a look at django-cms [1], it should be able to do what you need. And if there's some extra functionality you need it's very easy to program it. [1] http://www.django-cms.org Rob B (uk) wrote: The design agency I work for are looking into CMS options. Being a Django man myself I'm

Re: django and ldap

2010-02-05 Thread Peter Herndon
On Feb 5, 2010, at 5:45 AM, andreas schmid wrote: > ok django-ldap-groups works perfectly now! > That's great to hear! If you run into any issues, I'll be happy to help troubleshoot. ---Peter -- You received this message because you are subscribed to the Google Groups "Django users"

Re: entering scores (one model) for a list of students (another model)

2010-02-05 Thread Tim Arnold
Aha! thanks. I should have one model that contains the student and the score. Then I can use a form for the each student to fill out, and a formset for the teacher to provide the scores for each student in the class. That makes sense (I hope I'm understanding you correctly). Thanks for taking the

Re: entering scores (one model) for a list of students (another model)

2010-02-05 Thread Preston Holmes
Assuming you want to create a score per class - you should have students go to a form that: creates a student and first score if student does not already exist creates a score for the student for that class and date Basically the students should be creating the 'blank' scores when they come in.

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

2010-02-05 Thread Rob Hudson
Or use the SHOW_TOOLBAR_CALLBACK to customize when you want the toolbar displayed... I simply ship with what I consider reasonably safe defaults. For example: # Always show the toolbar DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR_CALLBACK: lambda req: True, } # Only show toolbar for super user

Problem setting up mysqldb 1.2.3c1 on Mac 10.5.8 Leopard

2010-02-05 Thread monchi
Hi there, I'm a first time Django user, trying to set up Django on my Mac 10.5.8 Leopard with MySQL from MAMP. Is this actually possible? I managed to get the welcome message from Django install, so that's working, I assume. Next, MySQL, I got this: >>> import MYSQLdb Traceback (most

Re: djangogolf

2010-02-05 Thread scoobygalletas
Hi! http://greenchilly.in/ throws: 502 Bad Gateway nginx/0.6.32 M- On Feb 5, 4:40 am, Kenneth Gonsalves wrote: > Hi, > > I just released djangogolf - software for managing golf tournaments. The > scoring module is ready, handicapping and draw are in the pipeline. The demo

UnicodeEncodeError on the admin when using translations

2010-02-05 Thread Juanjux (Google)
Hi, I put all the strings on my app on english and it works, but I translated them to spanish with makemessages and compilemessages and then every time I try to load a page on the /admin I get the exception at the end. My apache envvars and Django are all set to UTF-8. If I delete the django.mo

Re: entering scores (one model) for a list of students (another model)

2010-02-05 Thread Tim Arnold
On Feb 4, 4:07 pm, Tim Arnold wrote: > I'm creating a form that students fill in as they arrive at class. > Just name, email, etc. > When the class is over I want to display a form for the teacher to > enter the grades. > > So, no problem on the students entering their info,

Re: static serve problem

2010-02-05 Thread H . İbrahim Yılmaz
Hi, Yes it is looking for an 'accounts/login/extent/login.css'. But other apps which i wrote views myself get everything from '/extend' directory. How can i fix that? Yours Sincerely, 2010/1/28 Atamert Ölçgen : > On Thursday 28 January 2010 13:26:37 H.Ibrahim YILMAZ wrote: >>    

Re: Django or CMS.

2010-02-05 Thread Vranesic Ogi
Am Freitag 05 Februar 2010 13:18:47 schrieb Gonzalo Delgado: > El 05/02/10 09:09, Rob B (uk) escribió: > > The design agency I work for are looking into CMS options. Being a > > Django man myself I'm hoping to convince them to build one using > > Django. > > > > Requirements are roughly: > > > >

Re: getting dictionary values on template

2010-02-05 Thread harryos
thanks Javier..will read the docs .. > why so harsh to a newbie? that link doesn't help the question, > {{mydata_dict.key}} won't help, since 'key' here is also a variable. > > the answer is: > > {% for key, value in mydata_dict.items %} > {{key}} = {{ value }} > {% endfor %} > > and is

Re: Django or CMS.

2010-02-05 Thread Gonzalo Delgado
El 05/02/10 09:09, Rob B (uk) escribió: > The design agency I work for are looking into CMS options. Being a > Django man myself I'm hoping to convince them to build one using > Django. > > Requirements are roughly: > > Page control (creation/drafts/published/withdrawn/deletion) > Page revisions

Django or CMS.

2010-02-05 Thread Rob B (uk)
The design agency I work for are looking into CMS options. Being a Django man myself I'm hoping to convince them to build one using Django. Requirements are roughly: Page control (creation/drafts/published/withdrawn/deletion) Page revisions View draft pages on site for testing In-place editing

Re: getting dictionary values on template

2010-02-05 Thread Javier Guerra
On Fri, Feb 5, 2010 at 4:27 AM, Daniel Roseman wrote: > Seriously, did you try reading the documentation before asking this > question? Or searching the group? This is a very frequently asked > question. > > http://docs.djangoproject.com/en/1.1/topics/templates/#variables

Re: django and ldap

2010-02-05 Thread andreas schmid
ok django-ldap-groups works perfectly now! Mike Dewhirst wrote: > On 4/02/2010 11:14pm, David De La Harpe Golden wrote: >> On 04/02/10 08:33, andreas schmid wrote: >>> @brad: can you show me some sample code for this? >>> > > David > > I am using Peter Herndon's django-ldap-groups successfully.

Re: getting dictionary values on template

2010-02-05 Thread Atamert Ölçgen
Hi Harry, On Friday 05 February 2010 11:02:54 harryos wrote: > On the template html, I tried this > > {% for key in mydata_dict %} > {{key}} ={{ mydata_dict[key] }} > > {% endfor %} > > > This gives TemplateSyntaxError :Could not parse the remainder: '[key]' > from 'mydata_dict[key]' > > I

Re: getting dictionary values on template

2010-02-05 Thread Daniel Roseman
On Feb 5, 9:02 am, harryos wrote: > hi > I have a dictionary object passed to the template , from which I need > to retrieve values > > mydata={} > mydict['chemistry']=120 > mydict['physics']=164 > mydict['maths']=110 > > In my render_to_response I passed this object like

Re: getting dictionary values on template

2010-02-05 Thread Mike Ramirez
On Friday 05 February 2010 01:02:54 harryos wrote: > hi > I have a dictionary object passed to the template , from which I need > to retrieve values > > mydata={} > mydict['chemistry']=120 > mydict['physics']=164 > mydict['maths']=110 > > In my render_to_response I passed this object like >

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

2010-02-05 Thread chefsmart
If you use dcamer's fork http://github.com/dcramer/django-debug-toolbar you won't have to rely on INTERNAL_IPS and you can simply log in as a superuser to use django-debug-toolbar Regards. On Feb 5, 2:53 am, HARRY POTTRER wrote: > gah you're correct, I can't believe I missed

Re: Ajax with Django

2010-02-05 Thread chefsmart
http://lethain.com/entry/2007/dec/01/using-jquery-django-autocomplete-fields/ On Feb 5, 2:19 am, Rohan Shah wrote: > Any good documentation available on how to implement AJAX with Django ? > > -- > Thanks and Regards, > Rohan Shah > >

getting dictionary values on template

2010-02-05 Thread harryos
hi I have a dictionary object passed to the template , from which I need to retrieve values mydata={} mydict['chemistry']=120 mydict['physics']=164 mydict['maths']=110 In my render_to_response I passed this object like return render_to_response("myapp/mydatapage.html", {'mydata_dict':mydata}) I

abt facebook application

2010-02-05 Thread grp25
Does anyone know how to use minifb for connecting with facebook. We have written following code in views.py: def ModPythonHandler(request): * arguments = minifb.validate(_FbSecret, request.read()) if arguments["added"] != "1": return ServeIndexNonmember() else: