Object list with values to ForeignKey and ManyToMany

2008-05-27 Thread Tomás Garzón Hervás
Hi, I need help, thanks . My first problem with values: class Servicio(models.Model): empresa = models.ForeignKey(Empresa,blank=True,null=True,related_name='servicios_internos') [EMAIL PROTECTED] Trabajadores trabajadores = models.ManyToManyField(Trabajador,

Re: Json / Ajax problem

2008-05-27 Thread mwebs
I am sorry :-) could answer this by googling after "django Querydict" __getitem__(key) is the solution. mwebs schrieb: > Hello, > > I am performing an ajax-post-request. > > When I print request.POST I get this: [u'wew'], u'tags': [u'weew']}> > > How can I access the values? > > > Thanks

Json / Ajax problem

2008-05-27 Thread mwebs
Hello, I am performing an ajax-post-request. When I print request.POST I get this: How can I access the values? Thanks for your help. Toni --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Use variables inside an 'include' tag (and/or: how to set a variable in a template)

2008-05-27 Thread Juanjo Conti
You should create an inclusion tag: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags Juanjo -- mi blog: http://www.juanjoconti.com.ar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Django Installation Issue on Shared Hositng

2008-05-27 Thread A
I am have some issues setting up Django on shared web hosting. I have searched around and tried a few fixes as posted to no avail. Linux hosting environment. I get the following error message: Traceback (most recent call last): File "", line 1, in ? ImportError: No module named django I

Sorl Thumbnails Directory Permissions

2008-05-27 Thread Michael Ellis
I'm using sorl-thumbnails on Apache. It's working fine, except permissions on the directory in which it writes the thumbnails — / media/images — must be set to 777. For obvious security reasons, I'd like to work around this somehow...or at least minimize the threat. Any suggestions? Thanks! ME

Re: Efficient counting...

2008-05-27 Thread Russell Keith-Magee
On Wed, May 28, 2008 at 2:38 AM, radioflyer <[EMAIL PROTECTED]> wrote: > > Which is the most efficient, 'proper' way to get a count on a query > set? > > t_results = Track.objects.filter(query).order_by('title') > count = t_results.count() # and pass 'count' to the template. > > or, in the

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread Kevin Teague
Milan Andric wrote: > > Furthermore I just did > > import sys > sys.stderr.write(os.system(cmd)) > sys.stderr.flush() > > to see what the error message from the command is in the production > server log. > > Try using the subprocess module (Python 2.4+) to call your program instead of

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread Eric Wertman
This happens because the buffer from the os call is finite in size. You probably weren't reading it originally... so the process blocked while it waited for the buffer to empty out. Since you never read it, the process stalls forever. That's why --quiet worked.

Re: ANN Satchmo 0.7 Release

2008-05-27 Thread Empty
On Mon, May 26, 2008 at 11:05 PM, Chris Moffitt <[EMAIL PROTECTED]> wrote: > I am very happy to announce the immediate availability of Satchmo version > 0.7. Congratulations to you Chris and the rest of the team. I'm looking forward to digging into all the new features. Good work. Michael

Re: Project with two settings.py problem

2008-05-27 Thread Graham Dumpleton
On May 28, 8:28 am, konatufe <[EMAIL PROTECTED]> wrote: > The problem is related to the apache directive SetEnv > > I detected that this directive isn't working good, they not set > correctly the var DJANGO_SETTINGS_MODULE > > Any idea? As per documentation at:

Re: Project with two settings.py problem

2008-05-27 Thread konatufe
The problem is related to the apache directive SetEnv I detected that this directive isn't working good, they not set correctly the var DJANGO_SETTINGS_MODULE Any idea? On May 19, 6:46 pm, konatufe <[EMAIL PROTECTED]> wrote: > Hello Guys: > > I'm using one project withtwoapplications that are

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread James Bennett
On Tue, May 27, 2008 at 11:05 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > Worked just fine from the interpreter but I noticed some stuff being > returned on stdout (same as on cmd line). So I added the --quiet > option to htmldoc and now it seems fine and returns 0 in the > interpreter. Maybe

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread Milan Andric
On May 27, 11:05 am, Milan Andric <[EMAIL PROTECTED]> wrote: > On May 27, 1:10 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > > > Milan Andric wrote: > > > Hello, > > > > I have a helper-like django method that does a little pdf generation. > > > For some reason when I run this view on the dev

Re: Enforcing case sensitivity at Model level

2008-05-27 Thread JonSidnell
Hi Richard Thanks for that - option 1 is pretty much what I was looking for (although option 2 looks more interesting in the longer term :)). So would I be right in thinking it's something like: class UrlModel(models.Model): url = models.CharField(maxlength=100) def save(self):

Re: Enforcing case sensitivity at Model level

2008-05-27 Thread Richard Dahl
1. Create a custom save() method on the model that took the contents of the field in question and called .lower() on the string - If you simply want to make sure only lowercase letter are saved to the database. 2. Create a custom field (subclass models.CharField?) that only accepted lowercase

manytomanyfield unique ??

2008-05-27 Thread oliver
hi, i am trying create a unique manytomanyfield in my module, as I need to some how manage to only create one object with a given selection of m2m relations. Unique together doesn't work on the m2m field. i am not to sure how to approche this, if doing some custom save function which checks if

Enforcing case sensitivity at Model level

2008-05-27 Thread JonSidnell
Hi I'm developing my first proper Django app after going through some books and tutorials (colour me newbie), and am wondering if there is any way to enforce case sensitivity at the model level of a django app? I have a model class which has a field called 'url', which I would like to ensure is

Re: Invalid block tag: 'with'

2008-05-27 Thread bcrem
I think I'll check my target host server; I'm starting work on a site that's to be hosted on GoDaddy - have to see what they're running. And if their tech-support is worthy of the name; first guy I spoke with there had to go offline a good five minutes to look up 'Django'. Hmmm. On hold with

Use variables inside an 'include' tag (and/or: how to set a variable in a template)

2008-05-27 Thread Berco Beute
In the following 'include' tag the 'dir' may vary: {% include "dir/tag.html" %} so I would rather use something like: {% include {{ dir }}"/tag.html" %} which of course doesn't work. Is there a way to accomplish this? Being able to set a variable inside a template would solve the problem, but

Re: Invalid block tag: 'with'

2008-05-27 Thread Karen Tracey
On Tue, May 27, 2008 at 3:14 PM, bcrem <[EMAIL PROTECTED]> wrote: > > That must be it Karen - I'm running 0.96.2. Guess I'll have to wait > for the next release (or be brave and install the dev version...). > > Thanks for your help. > I'd recommend installing the SVN version. If you are just

Re: How to Implement "Most Viewed"?

2008-05-27 Thread Justin Lilly
On first pass, it doesn't appear that google analytics allows this sort of querying. Server log parsing seems to be the best solution suggested in terms of scaling and such. -justin On Tue, May 27, 2008 at 2:59 PM, didier rano <[EMAIL PROTECTED]> wrote: > Hi, > > I think that store every page

how to test whether an 'include' yields an empty string?

2008-05-27 Thread Berco Beute
How can I test whether the following (example) 'include' tag returns any text? {% include "dir/tag.html" %} 2B --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Using login view

2008-05-27 Thread Adi
I just thought of a solution to my own problem. Instead of having three different 'next' pages, i should just have one page which adjusts itself based on who the user is. What else can I do? On May 27, 2:00 pm, Adi <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently using theloginviews straight

Re: Invalid block tag: 'with'

2008-05-27 Thread bcrem
That must be it Karen - I'm running 0.96.2. Guess I'll have to wait for the next release (or be brave and install the dev version...). Thanks for your help. bcrem On May 27, 2:59 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Tue, May 27, 2008 at 2:23 PM, bcrem <[EMAIL PROTECTED]> wrote:

Using login view

2008-05-27 Thread Adi
Hi, I am currently using the login views straight out of the box. That means that I have (r'^accounts/login/$', 'django.contrib.auth.views.login'), in my urls.py file. We have three different type of users of our system. Based on what the user type is, we would like to redirect the user to

Re: How to Implement "Most Viewed"?

2008-05-27 Thread didier rano
Hi, I think that store every page view access in a log file seems to be very efficient. But it needs to have a consolidated server who runs a script (with cron). After analyze log file of each django server, this script could store the number of page view with a very efficient and minimalist

Re: Invalid block tag: 'with'

2008-05-27 Thread Karen Tracey
On Tue, May 27, 2008 at 2:23 PM, bcrem <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm trying to use the 'with' tag in an html template, similar to > below: > > {% with package.view.object as f %} > {{ f.name }} > ... > {% endwith %} > > When I try this, however, I get a

Re: problem in remember me feature

2008-05-27 Thread Mayank Dhingra
yes, i've imported settings. from django.conf import settings On May 27, 9:52 pm, Sebastian Bauer <[EMAIL PROTECTED]> wrote: > did you have this: > > import settings > > in files where you using settings variable? > > Mayank Dhingra pisze: > > > any thoughts ? > > > On May 27, 12:58 pm, Mayank

Efficient counting...

2008-05-27 Thread radioflyer
Which is the most efficient, 'proper' way to get a count on a query set? t_results = Track.objects.filter(query).order_by('title') count = t_results.count() # and pass 'count' to the template. or, in the template, Your search returned {{t_results|length}} track{{t_results| pluralize}}.

Re: Dev server won't run. (Complete Newbie)

2008-05-27 Thread anndr0id
Wow, I knew it would be something super simple. haha. That worked! Thanks so much!! :) On May 27, 2:14 pm, "Adam Fast" <[EMAIL PROTECTED]> wrote: > Ok, the problem is 127.0.0.1 is localhost - just to your linux > machine. Do this instead: > > Replace the word LINUX_IP with the actual IP address

Invalid block tag: 'with'

2008-05-27 Thread bcrem
Hi all, I'm trying to use the 'with' tag in an html template, similar to below: {% with package.view.object as f %} {{ f.name }} ... {% endwith %} When I try this, however, I get a TemplateSyntaxError whose exception value reads: Invalid block tag: 'with' and my {% with

Re: Dev server won't run. (Complete Newbie)

2008-05-27 Thread Adam Fast
Ok, the problem is 127.0.0.1 is localhost - just to your linux machine. Do this instead: Replace the word LINUX_IP with the actual IP address of your linux machine (ifconfig is the command to get it) python manage.py runserver LINUX_IP:8000 (or 80) Then type the same IP/port you used

Re: How to Implement "Most Viewed"?

2008-05-27 Thread blis102
@Justin Are you aware of any way to do that with Google Analytics. That is in fact what we use but I am unaware of any API that I could use to achieve that. It doesnt seem like this would let me integrate this all into my models easily. @Norman Do you know of any good resources to do what you

Re: Dev server won't run. (Complete Newbie)

2008-05-27 Thread anndr0id
On the host machine. VM is just command prompt. On May 27, 1:52 pm, Randy Barlow <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > anndr0id wrote: > > So I've never used Linux or Django or Python before. I've got this > > huge project dumped into my lap and so

Re: Dev server won't run. (Complete Newbie)

2008-05-27 Thread Randy Barlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 anndr0id wrote: > So I've never used Linux or Django or Python before. I've got this > huge project dumped into my lap and so far I've got ubuntu 7.10 > command prompt running on my PC through VMWare and the Django server > up. This is the first day

Dev server won't run. (Complete Newbie)

2008-05-27 Thread anndr0id
So I've never used Linux or Django or Python before. I've got this huge project dumped into my lap and so far I've got ubuntu 7.10 command prompt running on my PC through VMWare and the Django server up. This is the first day I've got into any of this so please excuse my total lack of knowledge

Re: Some strange "cache" behavior

2008-05-27 Thread Michael Richardson
> I've tried with never_cache, but it doesn't work. The strange thing is > that today, I've added a new blog post, which was immediately visible > from the post list and post details. But some hours later it > disappears until I restart Apache. I really don't understand where the > problem can

Re: ManyToManyField, add custom column

2008-05-27 Thread Richard Dahl
You can do this with an intermediate table: class Fruit(models.Model): name = models.CharField() def __unicode__(self): return ('%s' % (self.name)) class FruitItem(models.Model): fruit = models.ForeignKey(Fruit) number = models.IntegerField() def __unicode__(self):

Re: problem in remember me feature

2008-05-27 Thread Sebastian Bauer
did you have this: import settings in files where you using settings variable? Mayank Dhingra pisze: > any thoughts ? > > On May 27, 12:58 pm, Mayank Dhingra <[EMAIL PROTECTED]> wrote: > >> I am experiencing a strange problem while using >> DualSessionMiddleware >> >>