Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Trevor Stanley

Kenneth Gonsalves wrote:

On Wed, 2011-01-19 at 22:34 +, The Stanley Household wrote:
  

Happy to send Model if needed but at the moment I'm unable to run the
server to provide admin error report, can C&P from terminal if that
would help with the error. 



please copy and paste your code - it is easier for us to help when we
see what you are doing
  

Kenneth

Here is the code.  I've added some notes to try and explain what I think 
I'm doing


class Fringe(models.Model):
   code = models.CharField(max_length=3, unique = 'true')
   description = models.CharField(max_length=50)
   percentage = models.DecimalField(max_digits=6, decimal_places=5, 
default=0)

   flat_rate = models.IntegerField(blank=True, null=True)
   floor = models.IntegerField(blank=True, null=True)
   ceiling = models.IntegerField(blank=True, null=True)
   total = models.IntegerField(blank=True, null=True)

   def __unicode__(self):
   return self.code


class Detail(models.Model):
   account = models.ForeignKey(Account, related_name= 'account_account')
   description = models.TextField(max_length=200)
   fringe = models.ManyToManyField(Fringe, blank=True, null=True)
   location = models.ForeignKey(Location, blank=True, null=True)
   set_code = models.ForeignKey(Set_Group, blank=True, null=True)
   flag = models.ManyToManyField(Flag, blank=True, null=True)
   quantity = models.IntegerField(blank=True, null=True)
   units = models.CharField(max_length=10)
   multiplier = models.IntegerField(default=1)
   value = models.IntegerField(blank=True, null=True)
   native_total = models.IntegerField(blank=True, null=True)
   currency_code = models.ForeignKey(Currency)
   currency_total = models.IntegerField(blank=True, null=True)
   prev_total = models.IntegerField(default = 0)
   variance = models.IntegerField(blank=True, null=True)
   sort = models.IntegerField()
   cash_flow_code = models.ForeignKey(Cashflow, related_name= 
'cashflow_code')

   cash_flow_start_week = models.IntegerField(blank=True, null=True)
   cash_flow_weeks = models.IntegerField(blank=True, null=True)
   notes = models.TextField(max_length=200, blank=True, null=True)
   fringe_total = models.DecimalField(max_digits=6, 
decimal_places=5,blank=True, null=True)
  
   def __unicode__(self):

   return self.description
  
   class Meta:

   ordering = ['account']
  
  
   @models.permalink

   def get_absolute_url(self):
   return('bt4_edit_detail', (), { 'object_id':self.id })
  
   def _get_fringe_value(self):
   ft = 
Fringe.objects.select_related().filter(id=self).values()"""select record 
by ID from the M2M connection fringes"""
   qft=ft#.filter(id=self).values()"""Now obsolete as added to line 
above will amend when I get it working"""

   """so as not to pass a single value to sum if only one record
passed from ft then just pass value of percentage"""
   if qft.count()<=1:
   aqft=qft.filter('percentage')
   """if more than one record returned from related model do sum on 
percentage"""

   else:
   aqft=qft.annotate(sum('percentage'))
   """return value as decimal as it is actually a percentage which 
will

   be used to create a new value from currency_total on save"""
   return u'%d' (aqft)

   fringe_value = _get_fringe_value('aqft')

   def save(self):
   self.native_total = self.quantity*self.multiplier*self.value
   self.currency_total = 
self.quantity*self.multiplier*self.value*self.currency_code.rate1

   self.variance = self.currency_total-self.prev_total
   self.fringe_total = self.fringe_value
   super(Detail, self).save()

--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



djangos flat pages

2011-01-20 Thread Lukasz Szymanski
Hi there,
Is there any way ( module,app ) to implement custom flat pages inside
the app?

example.
I have a newsletter app with user emails. I would like to have a email
form inside my app (admin backend) to send newsletters.

Cheers.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: [django-users] Custom signals

2011-01-20 Thread Piotr Zalewa
Yes,
that was it!
pre_copy.send(type(self), instance=self, ...

On 01/20/11 01:37, Łukasz Rekucki wrote:
> On 20 January 2011 02:00, Piotr Zalewa  wrote:
>> I'm trying to add custom signals to my models.
>> I'm sure I'm missing some step.
>>
>> http://paste.pocoo.org/show/323618/
>>
> 
> The "sender" argument in receiver() must match the one in send()
> (using identity). In receive() you're using a class, while in send()
> you're passing an instance of that class, so they have no chance of
> matching.
> 
> Try:
> 
> post_copy.send(sender=type(self), copied_to=new_version)
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Readonly on subset of forms in Admin inlines

2011-01-20 Thread Thomas

Am 20.01.2011 um 03:27 schrieb Peter Phillips:

> Hello,
> 
> Is there a straightforward way to set fields to read only for a subset
> of the forms in an inline formset in the Admin? I'd like to set some
> fields to read only on my inline form for rows that were not created
> by the user. However, when I set the fields to read only, it of course
> affects all rows/forms in the inline, preventing the user from editing
> their own rows. Do I need to do a custom formset for
> InlineModelAdmin.formset?


hi,

maybe this provides a proper solution for you:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields


good luck,
TR





http://thoreg.org




-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Kenneth Gonsalves
On Thu, 2011-01-20 at 08:37 +, Trevor Stanley wrote:
> Fringe.objects.select_related().filter(id=self)

should this not be (id=self.id)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Daniel Roseman
On Wednesday, January 19, 2011 11:07:04 PM UTC, scabbage wrote:
>
> How do I add CSRF token to curl then? 
>
> What if I wanna expose my views as web services without providing a 
> UI, how do I make sure clients (e.g. Ajax, actionscript, etc) can use 
> it without this CSRF issue? 
>
>
> Thanks. 
>

AJAX requests are automatically CSRF exempt. See:
http://docs.djangoproject.com/en/1.2/ref/contrib/csrf/#ajax 
--
DR.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: djangos flat pages

2011-01-20 Thread Konrad Delong
On 20 January 2011 09:43, Lukasz Szymanski  wrote:
> Hi there,
> Is there any way ( module,app ) to implement custom flat pages inside
> the app?
>
> example.
> I have a newsletter app with user emails. I would like to have a email
> form inside my app (admin backend) to send newsletters.

It looks like you want to customise the admin interface:
see here: http://djangocon.blip.tv/file/4106908/

cheers,
Konrad

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to add a top menu to admin site.

2011-01-20 Thread hollando
I'm building my application with the admin site.
As a start point, it make things so easy.
However, I want to add a top menu that links to my apps and some of
the dynamic pages.
My top menu is kinda simple. Unlike treemenu, it's just flat menu with
a few items.
One solution I can think of is by modifying base_site.html, add my
menu onto it.
But I want to high light the app that is currently been choose.
What is the best way to do this?  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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Shawn Milochik

On Jan 19, 2011, at 8:01 PM, scabbage wrote:

> Is there a way to completely disable CSRF handling?

Sure, just remove the CSRF middleware from your settings.py.


-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Russell Keith-Magee
On Thu, Jan 20, 2011 at 8:57 PM, Shawn Milochik  wrote:
>
> On Jan 19, 2011, at 8:01 PM, scabbage wrote:
>
>> Is there a way to completely disable CSRF handling?
>
> Sure, just remove the CSRF middleware from your settings.py.

While this advice is 100% accurate, I'd would *strongly* caution you
not to follow it.

If someone has a problem losing their house keys, the solution isn't
to remove your front door. Yes, removing the door does remove the need
for keys, but also leaves your house open to the weather, animals,
criminals, and so on. The fix, while it does solve the immediate
problem, makes the overall situation much worse.

Django's CSRF framework exists, and is enabled by default, for a
reason. CSRF attacks are both real and common, and defence against
CSRF is an important part of any serious web deployment.

If you're having difficulty with CSRF, the solution isn't to disable
CSRF. The solution is to work out what CSRF protection means, and how
to use it correctly. Although it's a little esoteric, and a little
unusual if you've come from a web framework that doesn't enforce good
security practices, it isn't *that* hard to use. You would be well
served to understand what is going on, rather than making the CSRF
problem go away by ignoring it.

Yours,
Russ Magee %-)

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to add a top menu to admin site.

2011-01-20 Thread Rehmetjan Tursun
in base_site.html:
App
in css:
.currentapp{
*css*
}


On Thu, Jan 20, 2011 at 1:49 PM, hollando  wrote:

> I'm building my application with the admin site.
> As a start point, it make things so easy.
> However, I want to add a top menu that links to my apps and some of
> the dynamic pages.
> My top menu is kinda simple. Unlike treemenu, it's just flat menu with
> a few items.
> One solution I can think of is by modifying base_site.html, add my
> menu onto it.
> But I want to high light the app that is currently been choose.
> What is the best way to do this?  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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
*Rehmetjan Tursun*

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to add a top menu to admin site.

2011-01-20 Thread Konrad Delong
On 20 January 2011 06:49, hollando  wrote:
> I'm building my application with the admin site.
> As a start point, it make things so easy.
> However, I want to add a top menu that links to my apps and some of
> the dynamic pages.
> My top menu is kinda simple. Unlike treemenu, it's just flat menu with
> a few items.
> One solution I can think of is by modifying base_site.html, add my
> menu onto it.
> But I want to high light the app that is currently been choose.
> What is the best way to do this?  Thanks

Hi,

I'm not quite sure why you want to pick the app, but the solution
would be to use a context processor [1], find a view based on
request's url [2] and determine the application based on the result.
Then, you can pass that into your template to enable/disable menu
highlight css class.

cheers,
Konrad


[1] 
http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors
[2] http://docs.djangoproject.com/en/dev/topics/http/urls/#resolve

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



forms.ChoiceField get displayed value

2011-01-20 Thread Dan
If have a ChoiceField in a form (sometimes dynamically changed with
javascript) when getting the cleaned_data for that field it will
always return the value.

i.e:


Property1


self.cleaned_data.get('property') will always return '1'

How can i access the displayed value 'Property1' ?

Thanks

-Dan

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: forms, hidden fields

2011-01-20 Thread niall-oc
Bang on the head :-)

Cheers for that

On Jan 18, 5:55 pm, Brian Neal  wrote:
> On Jan 18, 8:32 am, niall-oc  wrote:
>
> > ...
> > There is a simple form.  My question is how do you set a field to be
> > hidden.
>
> >http://docs.djangoproject.com/en/1.1/topics/forms/#looping-over-the-f...
>
> > This document explains how you may check if a field is hidden, however
> > there seems to be no information on how to initially set the field to
> > be hidden. I've tried adding hidden=True and is_hidden=True to the
> > above class but to no avail.
>
> > Any help would be really appreciated
>
> Hi - please see the docs on form widgets and how you can change out a
> form field's default widget:
>
> http://docs.djangoproject.com/en/1.2/ref/forms/widgets/http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#specifying-wi...
>
> I suspect you'll want to specify a HiddenInput widget for one or more
> of your form fields.
>
> Best,
> BN

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django regular expression urls wrong match

2011-01-20 Thread Ali Ismayilov
Here is my urls.py:

urlpatterns = patterns('',

# Admin's

(r'^admin/filebrowser/', include('filebrowser.urls')),

(r'^admin/', include(admin.site.urls)),

(r'^tiny_mce/(?P.*)$', 'django.views.static.serve',

{ 'document_root': os.path.join(settings.MEDIA_ROOT,
> 'tinymce/jscripts/tiny_mce') }),


> # Media

(r'^media/(?P.*)$', 'django.views.static.serve',

{ 'document_root': settings.MEDIA_ROOT }),

)


> urlpatterns += patterns('news.views',

# Categories

(r'^(?P[a-z]{2})/categories/$', 'category_list',

{}, 'news_category_list'),

(r'^(?P[a-z]{2})/categories/(?P[-\w]+)/$',
> 'category_detail',

{}, 'news_category_detail'),


> # news entries

(r'^(?P[a-z]{2})/news/$', 'entry_archive',

{}, 'news_entry_archive_index'),

(r'^(?P[a-z]{2})/(?P\d{4})/$', 'entry_archive_year',

{}, 'news_entry_archive_year'),

(r'^(?P[a-z]{2})/(?P\d{4})/(?P\w{3})/$',
> 'entry_archive_month',

{}, 'news_entry_archive_month'),


>  
> (r'^(?P[a-z]{2})/(?P\d{4})/(?P\w{3})/(?P\d{2})/$',
> 'entry_archive_day',

{}, 'news_entry_archive_day'),


>  
> (r'^(?P[a-z]{2})/(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$',
> 'entry_detail',

{}, 'news_entry_detail'),

)


But when I try to access http://127.0.0.1:8000/en/categories/ it asks for
entry_archive_day view, matches wrong pattern.

And when I comment out that pattern url matches with entry_archive_month
view pattern. If I try to comment out that one too, it'll match with
entry_archive_year. And then I try to comment out the last one too, it'll
match with entry_archive. After commenting out the latter one, I'll get
expected result: it'll match with category_list view pattern.

I've tried to change places of patterns. I've also tried to separate
categories and entries url pattern lists. No result.

I've tried it on another machine too. Same result.

thanks in advance,
Ali

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



question update: django auto filling some data based on model attribute

2011-01-20 Thread Mo Mughrabi
Any one? please, I been researching since yesterday

http://stackoverflow.com/questions/4725685/django-auto-filling-some-data-based-on-model-attribute

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



DjangoAMF status

2011-01-20 Thread Joni @ mindpulse
Hello,
Does anybody know if this project is active, or if it works OK with
django < 1.3 ? Last update was 2 years ago...
Or maybe there are other alternatives? Any info helps.

DjangoAMF manual: http://djangoamf.sourceforge.jp/index.php?UserManual_en

--
Joni

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoAMF status

2011-01-20 Thread meaglith
Maybe PyAMF is another choice.

---
Blog: http://douhua.im
Twitter: http://twitter.com/genedna
Website: http://douhua.im
---


On Thu, Jan 20, 2011 at 10:58 PM, Joni @ mindpulse wrote:

> Hello,
> Does anybody know if this project is active, or if it works OK with
> django < 1.3 ? Last update was 2 years ago...
> Or maybe there are other alternatives? Any info helps.
>
> DjangoAMF manual: http://djangoamf.sourceforge.jp/index.php?UserManual_en
>
> --
> Joni
>
> --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: forms.ChoiceField get displayed value

2011-01-20 Thread Scott Gould
Try something like this:

field = form.fields['property']
data = form.cleaned_data['property']
if isinstance(data, (list, tuple)):
# for multi-selects
friendly_name = [x[1] for x in field.field.choices if x[0] in 
data]
else:
# for single selects
friendly_name = [x[1] for x in field.field.choices if x[0] == 
data]


On Jan 20, 9:25 am, Dan  wrote:
> If have a ChoiceField in a form (sometimes dynamically changed with
> javascript) when getting the cleaned_data for that field it will
> always return the value.
>
> i.e:
>
> 
> Property1
> 
>
> self.cleaned_data.get('property') will always return '1'
>
> How can i access the displayed value 'Property1' ?
>
> Thanks
>
> -Dan

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: thumbnails and rackspace files

2011-01-20 Thread Michel Thadeu Sabchuk
Hi!

> basically does what i'm think of doing, but in a different area

I make the thumb generation using the template tag but AFAIK easy
thumbnails have a ThumbnailerImageField that can be configured to pre
generate the thumbs.

> also doesn't send the thumbnail over to cloudfiles, which is really
> what i'm wanting to do, and without running syncstatic.

Easy thumbnails connects with the storage and then the file is sent to
cloudfiles... You can use similar approach, anyway, I would give a
change to easy thumbnails ;)

> thanks for cumulus! its nicer having a specific backend for this
> instead of one that is useful for multiples.

The cumulus package and storage's mosso backend is the same software,
the cumulus is a rewrite of it. Someday the storages backend for
cloudfiles would be updated with cumulus news, but today, the cumulus
is the one actively updated.

Best regards,

--
Michel Sabchuk

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to create multi-leveled forms with freeform entry options

2011-01-20 Thread Steven L Smith
One of our internal clients has asked for a form with the following
structure:
http://ssecdn.net/marcomm_form.pdf

As you can see, there are a lot of checkboxes, and they (the client)
need to be able to add more via the admin.

I initially thought I'd store "Request Types" and "Requests" like
this:

class MarcommRequestType(models.Model):
name = models.CharField(max_length=255)
order = models.IntegerField()
is_active = models.BooleanField(blank=True, default=True)

class MarcommRequest(models.Model):
request_type = models.ForeignKey('MarcommRequestType')
name = models.CharField(max_length=255)
is_active = models.BooleanField(blank=True, default=True)


...and then, store each instance of the form with a ManyToManyField on
MarcommRequest, like this:

class MarcommTicket(models.Model):
created = models.DateTimeField(auto_now_add=True)
name = models.CharField(max_length=255)
department = models.CharField(max_length=255)
email = models.EmailField()
date_needed = models.DateTimeField()
requests = models.ManyToManyField('MarcommRequest')


That works perfectly, except for those questions that have "other" or
"date of event" or things of that sort. As far as I can tell, there's
no good way to have a third level of question to my form, if that
third level is any kind of text entry / non-relationship field.

I thought a possible solution might be to have a "sub question" model
that lets the admin users specify a label and field type, but then,
where do I save the *answers* to the sub-questions?

What's the most Djangonic / Pythonic way to do this type of thing? It
seems like the kind of problem someone might have faced before...

Thanks!
Steven L Smith
Web Developer, Nazareth College

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Trevor Stanley

Kenneth

That is what I originally though but if I write that this is the error I 
get:


in _get_fringe_value
   ft = Fringe.objects.select_related().filter(id=self.id).values()
AttributeError: 'str' object has no attribute 'id'

I'm in London and I do this in my spare time so have just arrived home 
from work.  Many thanks for looking at this for me.


Kenneth Gonsalves wrote:

On Thu, 2011-01-20 at 08:37 +, Trevor Stanley wrote:
  

Fringe.objects.select_related().filter(id=self)



should this not be (id=self.id)
  


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread scabbage
How do I include CSRF token in a curl request then? I use curl for
debugging. Cannot seem to find any info on Google :(

On Jan 20, 5:11 am, Russell Keith-Magee 
wrote:
> On Thu, Jan 20, 2011 at 8:57 PM, Shawn Milochik  wrote:
>
> > On Jan 19, 2011, at 8:01 PM, scabbage wrote:
>
> >> Is there a way to completely disable CSRF handling?
>
> > Sure, just remove the CSRF middleware from your settings.py.
>
> While this advice is 100% accurate, I'd would *strongly* caution you
> not to follow it.
>
> If someone has a problem losing their house keys, the solution isn't
> to remove your front door. Yes, removing the door does remove the need
> for keys, but also leaves your house open to the weather, animals,
> criminals, and so on. The fix, while it does solve the immediate
> problem, makes the overall situation much worse.
>
> Django's CSRF framework exists, and is enabled by default, for a
> reason. CSRF attacks are both real and common, and defence against
> CSRF is an important part of any serious web deployment.
>
> If you're having difficulty with CSRF, the solution isn't to disable
> CSRF. The solution is to work out what CSRF protection means, and how
> to use it correctly. Although it's a little esoteric, and a little
> unusual if you've come from a web framework that doesn't enforce good
> security practices, it isn't *that* hard to use. You would be well
> served to understand what is going on, rather than making the CSRF
> problem go away by ignoring it.
>
> Yours,
> Russ Magee %-)

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly
Hello, I am new to the Django world and I was wondering if someone can
help me step by step on how to install the Django on my Linux program.
I've read some tutorial guides and I am abit lost and faced some
issues. I am currently on linux and need to know how to add packages,
and things in order to run the Django. Please contact me. 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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Mongo - testing

2011-01-20 Thread Andrew Marder
Has anyone had any luck setting up testing databases with mongo? Right
now I'm using pymongo in a single app, and I thought it would be cool
if in that app I could see if my code was being tested and in that
case I could use a different database. Problem is there doesn't seem
to be an environment variable in Django that will tell me whether my
code is being tested.

Thanks for the help,

Andrew

http://groups.google.com/group/django-users/browse_thread/thread/3a5a756782d24b5e?pli=1

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Mongo - testing

2011-01-20 Thread Javier Guerra Giraldez
On Thu, Jan 20, 2011 at 4:26 PM, Andrew Marder
 wrote:
> Problem is there doesn't seem
> to be an environment variable in Django that will tell me whether my
> code is being tested.

that defeats the purpose of testing, doesn't it?

even more in your case, since you want to hide the 'too experimental'
part from the tests

-- 
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 from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Shawn Milochik
Exactly what have you tried, and where do you get stuck? What error 
message are you getting?


--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
Right now, I am having problem with the installation of linux ( I will try
to figure that out if not, will contact you about that). I do have a problem
with installing the Django on Linux. I am new to the Django world, so I've
already downloaded the Django to my usb drive. Is there a certain way I have
to install it into Linux--Derbian? I also have Python 2.5.2 (before I've
installed linux), so do I also need a certain way to install python in linux
( if it is not there)?

On Thu, Jan 20, 2011 at 3:37 PM, Shawn Milochik  wrote:

> Exactly what have you tried, and where do you get stuck? What error message
> are you getting?
>
> --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Michael
You can probably just run "sudo apt-get install python-django" from the
command line.

-- 
Michael 

On Thu, 2011-01-20 at 13:26 -0800, Kimberly wrote:
> Hello, I am new to the Django world and I was wondering if someone can
> help me step by step on how to install the Django on my Linux program.
> I've read some tutorial guides and I am abit lost and faced some
> issues. I am currently on linux and need to know how to add packages,
> and things in order to run the Django. Please contact me. 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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Shawn Milochik

On 01/20/2011 04:40 PM, Kimberly Harvey wrote:
Right now, I am having problem with the installation of linux ( I will 
try to figure that out if not, will contact you about that). I do have 
a problem with installing the Django on Linux. I am new to the Django 
world, so I've already downloaded the Django to my usb drive. Is there 
a certain way I have to install it into Linux--Derbian? I also have 
Python 2.5.2 (before I've installed linux), so do I also need a 
certain way to install python in linux ( if it is not there)?


This list doesn't support Linux installations, but you shouldn't have 
much trouble with a modern distribution. If you have the freedom to do 
so, try installing Ubuntu instead of Debian.


Once you get there, you'll be able to install Django using these docs:
http://docs.djangoproject.com/en/1.2/intro/install/

Shawn

--
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
But in order to do that, don't I need to have the Django source file
somewhere in my  computer/ or in my case.. I've downloaded the Django tar
file to my usb flash drive? The command you gave me, that works in the linux
world, right? Like I said, I am new to this Djando materials.

On Thu, Jan 20, 2011 at 3:42 PM, Michael  wrote:

> You can probably just run "sudo apt-get install python-django" from the
> command line.
>
> --
> Michael 
>
> On Thu, 2011-01-20 at 13:26 -0800, Kimberly wrote:
> > Hello, I am new to the Django world and I was wondering if someone can
> > help me step by step on how to install the Django on my Linux program.
> > I've read some tutorial guides and I am abit lost and faced some
> > issues. I am currently on linux and need to know how to add packages,
> > and things in order to run the Django. Please contact me. 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
I cannot install the Ubuntu, I have to use Derbian for work purposes.

On Thu, Jan 20, 2011 at 3:45 PM, Shawn Milochik  wrote:

> On 01/20/2011 04:40 PM, Kimberly Harvey wrote:
>
>> Right now, I am having problem with the installation of linux ( I will try
>> to figure that out if not, will contact you about that). I do have a problem
>> with installing the Django on Linux. I am new to the Django world, so I've
>> already downloaded the Django to my usb drive. Is there a certain way I have
>> to install it into Linux--Derbian? I also have Python 2.5.2 (before I've
>> installed linux), so do I also need a certain way to install python in linux
>> ( if it is not there)?
>>
>
> This list doesn't support Linux installations, but you shouldn't have much
> trouble with a modern distribution. If you have the freedom to do so, try
> installing Ubuntu instead of Debian.
>
> Once you get there, you'll be able to install Django using these docs:
> http://docs.djangoproject.com/en/1.2/intro/install/
>
> Shawn
>
>
> --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Ivo Brodien


> But in order to do that, don't I need to have the Django source file 
> somewhere in my  computer/ or in my case.

apt-get gets packages from the internet.

And btw. Ubuntu is based on Debian.

smime.p7s
Description: S/MIME cryptographic signature


Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Kimberly
This is now a LINUX-Derbian problem I am experiencing. I open the
virtualbox and clicked on the Linux-Windows that I wanted, and clicked
on "start" to run it. Once it run, it is black screen. I already mount
the Derbian iso to the program, so I am lost for words on what is
going on. This is a struggle and I am frustrated because I just don't
know where else to turn or what to do ( yes, read the tutorial and
doesn't help much).

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
MY boss never mentioned about using the Ubuntu, just want me to use the
Debian.

Thanks

On Thu, Jan 20, 2011 at 3:58 PM, Ivo Brodien  wrote:

>
>
> > But in order to do that, don't I need to have the Django source file
> somewhere in my  computer/ or in my case.
>
> apt-get gets packages from the internet.
>
> And btw. Ubuntu is based on Debian.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Michael
Debian maintains a repository of software that is available to download
and install easily.  The fastest way to do this is from the command
line.  "apt-get" is the program that will do this for you, you just give
it the name of the program you want, and it will download and install it
for you automatically.

In the case of Django, you probably just need to run "sudo apt-get
install python-django", and it will find django in the repository, plus
whatever dependencies it has, like python, and then install them for
you.  If apt-get finishes running without any errors, then you have
django installed.

If you're curious, the "sudo" part of the command just says to run it
with administrator privileges.  It will ask you for your user's
password.

-- 
Michael 

On Thu, 2011-01-20 at 15:46 -0600, Kimberly Harvey wrote:
> But in order to do that, don't I need to have the Django source file
> somewhere in my  computer/ or in my case.. I've downloaded the Django
> tar file to my usb flash drive? The command you gave me, that works in
> the linux world, right? Like I said, I am new to this Djando
> materials. 
> 
> On Thu, Jan 20, 2011 at 3:42 PM, Michael  wrote:
> You can probably just run "sudo apt-get install python-django"
> from the
> command line.
> 
> --
> Michael 
> 
> 
> On Thu, 2011-01-20 at 13:26 -0800, Kimberly wrote:
> > Hello, I am new to the Django world and I was wondering if
> someone can
> > help me step by step on how to install the Django on my
> Linux program.
> > I've read some tutorial guides and I am abit lost and faced
> some
> > issues. I am currently on linux and need to know how to add
> packages,
> > and things in order to run the Django. Please contact me.
> 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 group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> 
> -- 
> 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 group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Mike Ramirez


On Jan 20, 1:47 pm, Kimberly Harvey  wrote:
> I cannot install the Ubuntu, I have to use Derbian for work purposes.
>


Ok, I have some suggestions, as someone said this is not a linux
support group.

Before you start working with django, you should take this one step at
a time and get to know your working environment first. As a newbie to
linux, you should be going over the debian manuals [1].  That link
will take you through the installing debian on a i386 system. With
virtualbox the instructions are basically the same with some minor
vbox specific instructions (suggest reading up on vbox docs for how to
mount the iso, setup the environment, and configuring networking).

Once you get through this and you have a working install, do NOT jump
in with django at all, just don't, you'll end up with a few headaches.
Learn your environment, learn the basics of using the operating
system, learn how to admin it (no need to be an expert, but you can
learn how to use the operating system and manage files and create/
delete directories and permisions, understand what a root user and
your user and then move to package installation and how apache works
with the debian system.

linux.org lessons for beginners[2] will help (and also has a debian
install guide, not sure how outdated the install guide is actually).
The debian admin guide[3] will help you with some of the more advanced
techniques of managing packages and apache.

At this point if you still have problems it'll be best to direct them
to the debian lists and the debian irc channels.


If you can't take time to learn your environment like this because
your boss is demanding you do something django _NOW_... find a new
boss or explain to him he's putting you in an unfair position (unless
you bullshitted him into believing you're up to this point of
understanding with linux/debian, then you're s.o.l.).

Now when you get to here, you're ready to install django and have a
great understanding on how to do that already with apt-get (as the
suggestions given in other replies about apt-get are correct but way
above where you are at right now)

>From this point on if you have problems with django, come on back and
we'll be glad to help with most issues (including linux specific
stuff).

Mike.

[1] http://www.debian.org/releases/stable/i386/index.html.en
[2] http://www.linux.org/lessons/beginner/toc.html
[3] http://www.debian-administration.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Rainy


On Jan 20, 2:04 pm, Trevor Stanley  wrote:
> Kenneth
>
> That is what I originally though but if I write that this is the error I
> get:
>
> in _get_fringe_value
>     ft = Fringe.objects.select_related().filter(id=self.id).values()
> AttributeError: 'str' object has no attribute 'id'
>
> I'm in London and I do this in my spare time so have just arrived home
> from work.  Many thanks for looking at this for me.
>
>

This line isn't right:

fringe_value = _get_fringe_value('aqft')

Not sure what you're trying to do, if first arg
to that function is self, you should use it
as an instance method, e.g.

detail = Detail(...)
detail._get_fringe_value()

If you want to pass it a second arg, change
def line to accept a 2nd arg and call with:

detail._get_fringe_value('aqft')

-ak

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



manage.py test => FAILED (failures=4, errors=1) HELP ME!!!

2011-01-20 Thread Marco Lerco
Sorry for my bad English. I'm Italian :-)

I'm starting to study Satchmo.
I followed all the installation process (http://
www.satchmoproject.com/
docs/dev/new_installation.html), after which
I followed the command:

python manage.py satchmo_check

Result? This:

Checking your satchmo configuration.
Your configuration has no errors.

No problem it seems ... But no! Because after that I
have created a test project with "clonesatchmo.py"and I tried to
test with the command:

python manage.py test

And here's the problem:

... 
..EF... 
... 
..F..F.F...
==
ERROR: test_activation_view
(registration.tests.RegistrationViewTests)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/
django_registration-0.7-
py2.6.egg/registration/tests.py", line 301, in test_activation_view
kwargs={ 'activation_key':
RegistrationProfile.objects.get(user=self.sample_user).activation_key }))
  File "/usr/local/lib/python2.6/dist-packages/django/test/
client.py",
line 298, in get
response = self.request(**r)
  File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-
py2.6.egg/
satchmo_store/accounts/views.py", line 237, in activate
contact = Contact.objects.get(user=account)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/
manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 341, in get
% self.model._meta.object_name)
DoesNotExist: Contact matching query does not exist.
==
FAIL: test_registration_view
(registration.tests.RegistrationViewTests)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/
django_registration-0.7-
py2.6.egg/registration/tests.py", line 289, in test_registration_view
self.assertEqual(response.status_code, 302)
AssertionError: 200 != 302
==
FAIL: test_extension (sorl.thumbnail.tests.fields.FieldTest)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
fields.py", line 66, in test_extension
self.verify_thumbnail((50, 37), thumb, expected_filename)
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (50, 38) != (50, 37)
==
FAIL: test_thumbnail
(sorl.thumbnail.tests.fields.ImageWithThumbnailsFieldTest)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
fields.py", line 111, in test_thumbnail
self.verify_thumbnail((50, 37), thumb, expected_filename)
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (50, 38) != (50, 37)
==
FAIL: testTag (sorl.thumbnail.tests.templatetags.ThumbnailTagTest)
--
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
templatetags.py", line 118, in testTag
self.verify_thumbnail((90, 67), expected_filename=expected_fn)
  File "/usr/local/lib/python2.6/dist-packages/sorl/thumbnail/tests/
base.py", line 92, in verify_thumbnail
self.assertEqual(image.size, expected_size)
AssertionError: (90, 68) != (90, 67)
--
Ran 260 tests in 194.127s
FAILED (failures=4, errors=1)
Destroying test database 'default'...

In your opinion, what is the problem? Could you 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 django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Steven Elliott Jr
> Ubuntu IS Debian for all intents and purposes. Why does your boss insist that 
> you use a particular distro? It shouldn't really matter what your development 
> OS is (at least with *nix systems). Is there an existing Django application 
> that needs to be supported or is this a new project?
> 
> On Thu, Jan 20, 2011 at 3:58 PM, Ivo Brodien  wrote:
> 
> 
> > But in order to do that, don't I need to have the Django source file 
> > somewhere in my  computer/ or in my case.
> 
> apt-get gets packages from the internet.
> 
> And btw. Ubuntu is based on Debian.
> 
> -- 
> 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 group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Steven Elliott Jr
Why don't you try partitioning your hard drive instead and doing a dual boot 
installation? 

Also, it's Debian not Derbian. 

-Steve 

On Jan 20, 2011, at 4:59 PM, Kimberly  wrote:

> This is now a LINUX-Derbian problem I am experiencing. I open the
> virtualbox and clicked on the Linux-Windows that I wanted, and clicked
> on "start" to run it. Once it run, it is black screen. I already mount
> the Derbian iso to the program, so I am lost for words on what is
> going on. This is a struggle and I am frustrated because I just don't
> know where else to turn or what to do ( yes, read the tutorial and
> doesn't help much).
> 
> -- 
> 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 group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: "CSRF verification failed" when sending simple GET request using curl

2011-01-20 Thread Russell Keith-Magee
On Fri, Jan 21, 2011 at 4:40 AM, scabbage  wrote:
> How do I include CSRF token in a curl request then? I use curl for
> debugging. Cannot seem to find any info on Google :(

The CSRF token is just a hidden field on your form. When you render
your template, the CSRF token will be included on the rendered page.
Include that token as part of your post data as you would any other
field value.

Yours,
Russ Magee %-)

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Russell Keith-Magee
On Fri, Jan 21, 2011 at 7:21 AM, Steven Elliott Jr  wrote:
> Why don't you try partitioning your hard drive instead and doing a dual boot 
> installation?
>
> Also, it's Debian not Derbian.

And, as was pointed out on the last thread on this topic, this isn't a
Linux support group.

At the moment, none of your problems appear to be related to Django --
they are to do with using your chosen operating system. Django's
tutorial isn't going to provide *any* assistance on why your Debian
install won't boot into a virtualbox on Windows.

You'll have a lot more luck getting an answer if you direct your
queries to an appropriate forum, such as a Debian users list.

Yours,
Russ Magee %-)

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kenneth Gonsalves
On Thu, 2011-01-20 at 22:58 +0100, Ivo Brodien wrote:
> > But in order to do that, don't I need to have the Django source file
> somewhere in my  computer/ or in my case.
> 
> apt-get gets packages from the internet.
> 
> And btw. Ubuntu is based on Debian. 

and btw, the django version in debian is too old to be of use
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Expert help needed --LINUX on virtualBox using Windows 7 machine

2011-01-20 Thread Kenneth Gonsalves
On Thu, 2011-01-20 at 18:21 -0500, Steven Elliott Jr wrote:
> Why don't you try partitioning your hard drive instead and doing a
> dual boot installation? 
> 
> 

he is not doing dual boot - he is running linux under windows!
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Kenneth Gonsalves
On Thu, 2011-01-20 at 19:04 +, Trevor Stanley wrote:
> ft = Fringe.objects.select_related().filter(id=self.id).values()
> AttributeError: 'str' object has no attribute 'id' 

maybe filter(id=self.fringe) or (id=self.fringe_id)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
Thanks for the tips and advices. I still believe Django can be run on the
linux-Debian version. There are some updated Django which I've already saved
on my usb flash drive which I will soon run some commands on the linux as
some other people has advised me to do so. The person wants me to learn more
about django but NOT right away. However, I like to pick up on things quick.
I am getting the hang of some of the materials I've read but it takes some
time for me to fully grasp it since I am new to this. If any more advices
regarding to commands, let me know. Some people sent different commands on
how to install the Django/ Django-Python... I will test it out and see what
happens.

On Thu, Jan 20, 2011 at 7:40 PM, Kenneth Gonsalves
wrote:

> On Thu, 2011-01-20 at 22:58 +0100, Ivo Brodien wrote:
> > > But in order to do that, don't I need to have the Django source file
> > somewhere in my  computer/ or in my case.
> >
> > apt-get gets packages from the internet.
> >
> > And btw. Ubuntu is based on Debian.
>
> and btw, the django version in debian is too old to be of use
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Mike Ramirez
On Thursday, January 20, 2011 07:09:10 pm Kimberly Harvey wrote:
> Thanks for the tips and advices. I still believe Django can be run on the
> linux-Debian version.

No one is saying otherwise.

> There are some updated Django which I've already
> saved on my usb flash drive which I will soon run some commands on the
> linux as some other people has advised me to do so. The person wants me to
> learn more about django but NOT right away. However, I like to pick up on
> things quick.

Remember: Crawl, Walk, Run.  Otherwise you're in for a hell of a time.

Mike


-- 
All generalizations are false, including this one.
-- Mark Twain

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installing Django on Linux-Derbian using virtualBox on Windows 7 Machine

2011-01-20 Thread Kimberly Harvey
That is exactly what I am doing right now, I between the crawl and walk
phrase now, lol.

On Thu, Jan 20, 2011 at 9:23 PM, Mike Ramirez  wrote:

>  On Thursday, January 20, 2011 07:09:10 pm Kimberly Harvey wrote:
>
> > Thanks for the tips and advices. I still believe Django can be run on the
>
> > linux-Debian version.
>
> No one is saying otherwise.
>
> > There are some updated Django which I've already
>
> > saved on my usb flash drive which I will soon run some commands on the
>
> > linux as some other people has advised me to do so. The person wants me
> to
>
> > learn more about django but NOT right away. However, I like to pick up on
>
> > things quick.
>
> Remember: Crawl, Walk, Run. Otherwise you're in for a hell of a time.
>
> Mike
>
>  --
>
> All generalizations are false, including this one.
>
> -- Mark Twain
>
>  --
> 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 group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Localisation

2011-01-20 Thread Lachlan Musicman
On Wed, Jan 19, 2011 at 01:40, David Walker  wrote:

> There seem to be two main places where date formats originate.  They
> are set in settings.py and in the locale's formats.py
> (django.conf.locale..formats).
>
> formats.py sets (amongst others) DATE_FORMAT and SHORT_DATE_FORMAT for
> the locale in question (along with a load of other datetime formats).
> setings.py sets L10N, and also DATE_FORMAT and SHORT_DATE_FORMAT.
>
> If L10N is True, the SHORT_DATE_FORMAT in settings.py is not used in
> rendering, with the localised version from the appropriate formats.py
> being used instead.
> However, Django uses two versions of DATE_FORMAT.  The settings.py one
> defaults to to the US format of 'N j, Y', but can be changed.  The
> formats.py one contains the appropriate setting for your locale (but
> see en_GB below!).
>
> So, what does all this mean for rendering?  I think that the following
> happens (assuming that d is a date):
> {{d|date:"SHORT_DATE_FORMAT"}}
>    produces a localised short date: 'd/m/Y' here in the UK
> {{d}}
>    produces a localised long date: 'j \de F \de Y' in Portugal
> {{d|date}}
>    produces a date based on the settings.DATE_FORMAT ( 'N j, Y'
> unless changed), but incredibly the month name is translated to the
> browser locale.  This often produces date that no one would ever use
> like: Março 10, 2010 (the default setting with a Portuguese browser).
> I seem to remember seeing in some documentation somewhere (that I now
> can't find) that it was intended that the date filter without
> arguments would produce a consistent, machine readable date format.
>
> While it may be useful to have a locale independent date format, this,
> to me, has a number of problems:
> 1. re-using the variable name DATE_FORMAT is bound to cause confusion
> 2. using a common human format for locale independent machine readable
> dates is likely to cause confusion.
> 3. translating the result renders the whole process pointless.
>
> Meanwhile, the documentation says:
> http://docs.djangoproject.com/en/dev/ref/settings/#date-format
>    Note that if USE_L10N is set to True, then the locale-dictated
> format has higher precedence and will be applied instead.
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
>    When used without a format string...the formatting string defined
> in the DATE_FORMAT setting will be used, without applying any
> localization.
>
> Neither of these statements correctly describe the actual behaviour I
> have observed.
>
> To add to my confusion, django.conf.locale.en_GB.formats contains
> DATE_FORMAT='N j, Y', whereas I think it should be something like 'j F
> Y', 'j N Y' or 'jS F Y'.  The Unicode Common Locale Data Repository
> seems to agree with me, plumping for 'd  y' or 'd MMM
> y' (obviously these are in a different format).
>
> Have I got this right?

I am not sur e- you seem to have done the work and I trust you did it
correctly :)

> Where do I/we go from here?

I guess we need to bring it up with the developers - ie, should this
be listed as a bug, and if so is it a documentation bug/clarification
that's needed, or does something need to happen at a deeper level.
Plus, there seem to be a multitude of issues (precedence of SHORT_DATE
settings, en_GB short date format...) - which also complicates things.

> Is there a better forum for this?

Yes, I would say that the dev list is the place to go -
django-develop...@googlegroups.com I might send through a link to this
discussion to that list now

> Can I help improve things by writing bug reports?  enhancements
> requests? patches? documentation? or taking part in discussions?

Yes. How to do it is the hard part. I would frame it as a question,
with clearly demarked issues.

 re precedence: expected behavior vs explained behaviour vs witnessed
behaviour (remember to include OS, python version, django version,
documentation version)

re en_GB problems, raise it separately/secondarily and with links that
support your argument.

cheers
L.

-- 
"There are all kinds of pedants around with more time to read and
imitate Lynne Truss and John Humphrys than to write poems,
love-letters, novels and stories it seems. They whip out their
Sharpies and take away and add apostrophes from public signs, shake
their heads at prepositions which end sentences and mutter at split
infinitives and misspellings, but do they bubble and froth and slobber
and cream with joy at language? Do they ever let the tripping of the
tips of their tongues against the tops of their teeth transport them
to giddy euphoric bliss? Do they ever yoke impossible words together
for the sound-sex of it? Do they use language to seduce, charm,
excite, please, affirm and tickle those they talk to? Do they? I doubt
it. They’re too farting busy sneering at a greengrocer’s less than
perfect use of the apostrophe. Well sod them to Hades. They think
they’re guardians of language. They’re no more guardians of language
than the Kennel Club is the guardian of 

Re: Can someone help with Many-to-many referencing and then calculations against another field on the linked model

2011-01-20 Thread Kenneth Gonsalves
On Fri, 2011-01-21 at 07:33 +0530, Kenneth Gonsalves wrote:
> On Thu, 2011-01-20 at 19:04 +, Trevor Stanley wrote:
> > ft = Fringe.objects.select_related().filter(id=self.id).values()
> > AttributeError: 'str' object has no attribute 'id' 
> 
> maybe filter(id=self.fringe) or (id=self.fringe_id) 

no - that is wrong. filter(id__in=self.fringe.all())
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.