Re: Model Validation - Best practices

2007-10-23 Thread Malcolm Tredinnick

On Wed, 2007-10-24 at 04:40 +, Camo wrote:
> Hi Guys,
> 
> I just been working my way through Django, top framework by the way.
> 
> Anyways I just wondering if any one can shed some light model
> validation,
> 
> It seems the only validations are either through the newforms or
> simple validation through the fields.  But there doesn't seem to be
> any bussiness rule validation functions for models.  My concern is
> that validations should really be kept in the model and not in
> forms.
> 
> So I was just wondering how people go about validating models.

At the moment this is work in progress. There is some development going
on to finish up model-aware validation and complete some earlier work on
model validation. At that time, you'll be able to call
my_model.validate() and have things work similarly to how they do with
newforms.

Right now, there's a validate() method on the Model class, but it is
incomplete and not recommended for production use.

In the interim, doing things in the save() method is possible, although
it's not a brilliantly nice design, since save() should never raise
validation errors and, if it does, you won't get feedback to, say, the
admin interface or places like that. But it's the workaround you need to
do at the moment.

Regards,
Malcolm

-- 
Atheism is a non-prophet organization. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Model Validation - Best practices

2007-10-23 Thread Kenneth Gonsalves


On 24-Oct-07, at 10:10 AM, Camo wrote:

> So I was just wondering how people go about validating models.

overide the save() method and add your own business rules in the model

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: AP-style state names

2007-10-23 Thread [EMAIL PROTECTED]



On Oct 23, 9:11 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2007-10-23 at 17:43 -0700, [EMAIL PROTECTED] wrote:
> > I just know this has got to be lurking around in Django somewhere...
> > If I use USStateField, is there a filter or other method to output the
> > state name in Associated Press style? I know there's AP filters for
> > times and numbers, but can't find anything for states. and looking
> > around in localflavor I don't see any mapping that would connect, say,
> > Kan. to KS.
>
> > Anyone got any ideas?
>
> If you're asking for a function that converts 'KS' to 'Kan.', then, no,
> there isn't anything like that at the moment.
>
> For better or worse, localflavor is becoming a catch-all for that kind
> of stuff, so write up a patch if you think it's genuinely useful. I
> don't personally have strong opinions either way, since there are more
> important states to me than the US ones and I don't find AP style to be
> particularly convincing in a lot of cases, but I realise some people
> like to use it, so it might well be worth including.
>
> Regards,
> Malcolm
>
> --
> Works better when plugged in.http://www.pointy-stick.com/blog/

Thanks. Maybe I will have a go at it. Seems like it would be fairly
straightforward, even for someone of my limited abilities. I'm already
fairly familiar with us_states.py, as I made a dirty hack to include
Canada in it.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: AP-style state names

2007-10-23 Thread Malcolm Tredinnick

On Tue, 2007-10-23 at 17:43 -0700, [EMAIL PROTECTED] wrote:
> I just know this has got to be lurking around in Django somewhere...
> If I use USStateField, is there a filter or other method to output the
> state name in Associated Press style? I know there's AP filters for
> times and numbers, but can't find anything for states. and looking
> around in localflavor I don't see any mapping that would connect, say,
> Kan. to KS.
> 
> Anyone got any ideas?

If you're asking for a function that converts 'KS' to 'Kan.', then, no,
there isn't anything like that at the moment.

For better or worse, localflavor is becoming a catch-all for that kind
of stuff, so write up a patch if you think it's genuinely useful. I
don't personally have strong opinions either way, since there are more
important states to me than the US ones and I don't find AP style to be
particularly convincing in a lot of cases, but I realise some people
like to use it, so it might well be worth including.

Regards,
Malcolm

-- 
Works better when plugged in. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: AP-style state names

2007-10-23 Thread James Bennett

On 10/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I just know this has got to be lurking around in Django somewhere...
> If I use USStateField, is there a filter or other method to output the
> state name in Associated Press style? I know there's AP filters for
> times and numbers, but can't find anything for states. and looking
> around in localflavor I don't see any mapping that would connect, say,
> Kan. to KS.

http://code.djangoproject.com/browser/django/trunk/django/contrib/localflavor/us/us_states.py#L71

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



AP-style state names

2007-10-23 Thread [EMAIL PROTECTED]

I just know this has got to be lurking around in Django somewhere...
If I use USStateField, is there a filter or other method to output the
state name in Associated Press style? I know there's AP filters for
times and numbers, but can't find anything for states. and looking
around in localflavor I don't see any mapping that would connect, say,
Kan. to KS.

Anyone got any ideas?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to select all the values from my Field attribute 'choices?

2007-10-23 Thread Karen Tracey
On 10/23/07, Greg <[EMAIL PROTECTED]> wrote:
[snip]

> class Collection(models.Model):
>
> THE_MATERIAL = (
> ('1', 'Paper'),('2', 'Plastic'),('3', 'Other'),
> )
>
> material = models.CharField(max_length=50, choices=THE_MATERIAL)
>
> ///
>
> However, now I want to be able to do a query that returns all of the
> values in THE_MATERIAL (even if it's not being used by any
> collection).  How would the query be setup to do this?


Well, you can't set up a query for something that isn't in the database.
But the values are right there in THE_MATERIAL.  If you want a list of just
the text values, stripping away the numeric choices, some simple Python:

material_list = [y for x,y in THE_MATERIAL]

would do it.

Karen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Scaling the server

2007-10-23 Thread Graham Dumpleton

On Oct 24, 5:13 am, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> A few weeks ago I had problems with my dedicated server, it was
> stucking twice or more times a week. After some digging, I solve the
> problem updating the mysqldb lib version. The server goes ok almost
> all the time, but I still have server stuck when I had too much hits.
>
> My server had 1.8mi to 2.2mi of hits a day, I found that I must scale
> my server. Before start the machine acquisition and money expending, I
> wanted to get some experience from you. I don´t want to kill a fly
> with a cannon ball ;)
>
> I had django running over a mod_python/apache instance that are
> serving my media files too. One of my bottlenecks was the home page,
> yesterday I start to generate it through a script called by cron. I
> follow this approach even using locmen cache backend. Is it a good
> idea to use lighttpd on the same server to serve static files or
> should I need to setup a different server to database and maybe
> another to media files?

What percentage of requests are actually yielding static pages?

People often too quickly run to lighttpd thinking it will somehow
magically solve all their problems, but if the bulk of the requests
are actually dynamic and served by Django, and it is Django and the
database which are the bottleneck, it will make very little if any
difference.

Now to try and get to what the real issue may be, expand on what you
mean by 'server stuck when I had too much hits'. What exactly is
getting stuck, the connections through to the database, or Apache
itself running out of processes and/or worker threads to keep up with
the volume of requests? Or is the box starting to run out of physical
memory and starting to swap excessively.

Where the problem lies will guide what you may need to do.

Graham


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to select all the values from my Field attribute 'choices?

2007-10-23 Thread Greg

Hello,
When I first developed my application I created a table that stored
all the different types of materials

class Material(models.Model):
material = models.CharField(maxlength=100)

To get all the materials in the table all I needed to do was query the
table.  Recently, I've been going through my code to see if I can
clean it up.  So I deleted my table Material and made it into a
'choices' attribute.  So now I have

class Collection(models.Model):

THE_MATERIAL = (
('1', 'Paper'),('2', 'Plastic'),('3', 'Other'),
)

material = models.CharField(max_length=50, choices=THE_MATERIAL)

///

However, now I want to be able to do a query that returns all of the
values in THE_MATERIAL (even if it's not being used by any
collection).  How would the query be setup 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django writing self-generated files to disk

2007-10-23 Thread rsc

Thanks for taking the time to answer this, much appreciated.

On Oct 22, 6:26 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Oct 23, 6:27 am, Scott SA <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have a django instance running under mod-python/apache and am having 
> > trouble with a user that has a poor-quality connection. The task is to 
> > generate a tab-delim report (rather lengthy one) of which we've been 
> > writing-to-response:
>
> > "return HttpResponse(report_tdf, mimetype='text/tab-separated-values')"
>
> > Problem is, sometime during the 3-5 minutes it takes to generate this file, 
> > their connection fails. I could send the report via smtp, but would rather 
> > see if I can mark it to disk and then give them a URL to downlod via (esp. 
> > if their connection fails).
>
> > I've tried the standard file I/O mechanisms but, not surprisingly, appear 
> > to be running into a permissions problem. Making the directory 
> > world-writable or adding appache to the django-user's group is not a 
> > particularly appealing idea =8(@)
>
> > Django can upload and mark files to disk but using _that_ mechanism would 
> > appear to be a hack. And while I might be/appear-to-be one, I would prefer 
> > to do things as correctly as possible.
>
> > Soo, does anyone have a suggestion as to where I should head to resolve 
> > this problem?
>
> Use mod_wsgi instead and use its 'daemon' mode to run Django in a
> separate process, configuring that process to run as the user you
> would ideally prefer Django to run as and which would have access to
> the directories you want to write to. For example use the following
> configuration but replace 'user-1' with the actual UNIX user that
> Django instance should run as:
>
>   WSGIDaemonProcess site-1 user=user-1 group=user-1 threads=25
>   WSGIProcessGroup site-1
>
>   Alias /media/ /usr/local/django/mysite/media/
>
>   
>   Order deny,allow
>   Allow from all
>   
>
>   WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi
>
>   
>   Order deny,allow
>   Allow from all
>   
>
> Alternatively, use a fastcgi solution which allows you similarly to
> run Django in a separate process and using suexec or other means
> enable the Django instance to run as a different user.
>
> Having Django run as a distinct user is the safest way of doing it and
> also means that other user code running in Apache, eg PHP pages, can't
> fiddle with your Django data. To do this though, you will not be able
> to use mod_python since your code runs in the context of the Apache
> child processes. Similary, you can use 'embedded' mode of mod_wsgi,
> but as explained you can use 'daemon' mode of mod_wsgi.
>
> For more information see:
>
>  http://www.modwsgi.org
>  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> Graham


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Scaling the server

2007-10-23 Thread Michel Thadeu Sabchuk

Hi guys,

A few weeks ago I had problems with my dedicated server, it was
stucking twice or more times a week. After some digging, I solve the
problem updating the mysqldb lib version. The server goes ok almost
all the time, but I still have server stuck when I had too much hits.

My server had 1.8mi to 2.2mi of hits a day, I found that I must scale
my server. Before start the machine acquisition and money expending, I
wanted to get some experience from you. I don´t want to kill a fly
with a cannon ball ;)

I had django running over a mod_python/apache instance that are
serving my media files too. One of my bottlenecks was the home page,
yesterday I start to generate it through a script called by cron. I
follow this approach even using locmen cache backend. Is it a good
idea to use lighttpd on the same server to serve static files or
should I need to setup a different server to database and maybe
another to media files?

Thanks for any help,
Best regards.

--
Michel Thadeu 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error message when viewing admin? (ViewDoesNotExist at /admin/)

2007-10-23 Thread DJango Fett

The same thing happens to me.  I was going through the Tutorial to
make the Poll application.  The admin url was working fine.  When I
added in the patterns for the poll app, I get the same error you did.
If I comment out the admin line, the poll lines work fine.  If I
comment out the poll lines, the admin line works fine.  Where yours
says 'startsess', mine says 'vote'.  I imagine it is because it is the
last line for all of the polls patterns:

from django.conf.urls.defaults import *

urlpatterns = patterns('',
  (r'^admin/', include('django.contrib.admin.urls')),
  (r'^polls/$', 'index'),
  (r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
  (r'^polls/(?P\d+)/results/$',
'mysite.polls.views.results'),
  (r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
)



On Oct 3, 12:34 pm, Greg <[EMAIL PROTECTED]> wrote:
> Hello,
> Whenever I login to myadminview the very first thing I see if the
> following error.  It also happens occasionally when I'm going through
> myadminpages.
>
> ViewDoesNotExist at /admin/
> Tried startsess in module mysite.rugs.views. Error was: 'module'
> object has no attribute 'startsess'
> Request Method: GET
> RequestURL:http://127.0.0.1:8000/admin/
> Exception Type: ViewDoesNotExist
> Exception Value:Tried startsess in module mysite.rugs.views. Error
> was: 'module' object has no attribute 'startsess'
> Exception Location: c:\Python24\lib\site-packages\django\core
> \urlresolvers.py in _get_callback, line 184
> Python Executable:  c:\Python24\python.exe
> Python Version: 2.4.4
>
> //
>
> Template error
>
> In template c:\python24\lib\site-packages\django\contrib\admin
> \templates\admin\base.html, error at line 28
> Caught an exception while rendering: Tried startsess in module
> mysite.rugs.views. Error was: 'module' object has no attribute
> 'startsess'
> 18  {% if not is_popup %}
> 19  
> 20  
> 21  
> 22  {% block branding %}{% endblock %}
> 23  
> 24  {% if user.is_authenticated and user.is_staff %}
> 25  
> 26  {% trans 'Welcome,' %} {% if user.first_name %}
> {{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %} strong>.
> 27  {% block userlinks %}
> 28  {%
> trans 'Documentation' %}
> 29  / {%
> trans 'Change password' %}
> 30  / {% trans
> 'Log out' %}
> 31  {% endblock %}
> 32  
> 33  {% endif %}
> 34  {% block nav-global %}{% endblock %}
> 35  
> 36  
> 37  {% block breadcrumbs %}{%
> trans 'Home' %}{% if title %} › {{ title|escape }}{% endif
> %}{% endblock %}
> 38  {% endif %}
>
> //
>
> Line 28 is highlighted in the above code.  This code is in red '{%url
> django.contrib.admin.views.doc.doc_index %}' from line 28
>
> Thanks for any help


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Need help selecting a Django hosting provider

2007-10-23 Thread Yishai

We are very happy with webfaction (http://www.webfaction.com). Setting
up a django instance, database, etc. is a breeze. It also seems that
it would be pretty easy to scale with them (though we have not tried
this yet), at least up to medium+ traffic levels.




On Oct 18, 12:09 am, Greg <[EMAIL PROTECTED]> wrote:
> Ok...let's try this again.  Hopefully this works.
>
> Hello,
> I am looking for a hosting provider that offers support for Django
> apps.  I've only worked with the developmental version of Django.  So
> this is my first time picking out a hosting provider.  I've looked
> through the documentation 
> at:http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts,
> and there seems to be quite a few hosting providers to choose from.
>
> I'm wanting to hear what people's opinion's are that have used certain
> Django hosting providers in the past.  What are some of the good
> experiences people have had, and also what are some the bad
> experiences.  Are their any hosting providers that I should avoid?
>
> What questions should I ask each hosting provider?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: which Django version to use for live site to be released in end of february 2008

2007-10-23 Thread Jeremy Dunck

We're running on r6023 OK.  It was a quiet point on trunk after
Unicode landed and the related bugfixes were done.   If I were picking
now, I'd find a rev closer to current trunk.  But I'm pretty
knowledgeable about Django and don't mind managing my own rev and
applying important bugfixes when needed.

0.96 is r4810; trunk is now r6600.If you want lots of support and
stable, accurate docs, you probably want 0.96.   If you're concerned
about large changes later, something later might be worth going with,
but it will be a bit of a moving target.

As a small tip, I watch trunk and if there's something really useful
that's easy to pull in, I do that.  I was using {% with %} on 0.96 +
patches for a long while.

Have a look at this:
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
if you need more details.


On 10/23/07, ydjango <[EMAIL PROTECTED]> wrote:
>
> Not for the February/March 08 release, but yes, I will need it by the
> last quarter of 2008.
>
> Ashish
> On Oct 23, 8:18 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> > On 10/23/07, ydjango <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I am working on product which will be released end of february. I am
> > > planning to use Django for building the site. I am new to Django
> >
> > > Which version should I use - SVN or 0.96?
> >
> > > If I use 0.96, I am worried migration to 1.0 will be very painful and
> > > time consuming.
> > > If I use SVN version , I am not sure how stable it is?
> > > Are there any production sites using the svn version.
> > > Can some one please recommend?
> >
> > Do you need unicode (i18n or non-ASCII charsets)?  That's the biggest
> > single determining factor.
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: which Django version to use for live site to be released in end of february 2008

2007-10-23 Thread ydjango

Not for the February/March 08 release, but yes, I will need it by the
last quarter of 2008.

Ashish
On Oct 23, 8:18 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 10/23/07, ydjango <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am working on product which will be released end of february. I am
> > planning to use Django for building the site. I am new to Django
>
> > Which version should I use - SVN or 0.96?
>
> > If I use 0.96, I am worried migration to 1.0 will be very painful and
> > time consuming.
> > If I use SVN version , I am not sure how stable it is?
> > Are there any production sites using the svn version.
> > Can some one please recommend?
>
> Do you need unicode (i18n or non-ASCII charsets)?  That's the biggest
> single determining factor.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Earn $$ with WidgetBucks! and yuwie

2007-10-23 Thread http://r.yuwie.com/chiangmai

Earn $$ with WidgetBucks! and  yuwie
Earn $$ with WidgetBucks!
http://www.widgetbucks.com/home.page?referrer=3761001
or read more http://r.yuwie.com/chiangmai  and  http://yuwie.blogth.com/

As this particular method of advertising has proven to be a great way
of generating revenue I thought I'd give this new widget from
WidgetBucks a try. It takes products from top shopping websites like
Amazon, ebay and Walmart and displays the best prices using an
animated banner that you can display on your website or blog using
their widget code. They even have their own algorithm engine called
MerchSense for displaying products that are relevant to your websites
content, it even adapts to new content that you write so it's great
for blogs.

The widget also only displays the highest paying products. They say
that publishers that have tested the widget are seeing a $3-6 CPM
which compared to Google's Adsense is pretty good! Only difference
being is that the widget will not fit seamlessly into your content
like Adsense. For a CPM that high it's worth a try though!

Earn $$ with WidgetBucks!
http://www.widgetbucks.com/home.page?referrer=3761001 or read more
http://r.yuwie.com/chiangmai  and  http://yuwie.blogth.com/


Higher eCPM
Some early adapters are claiming earnings of $3 to $6 CPM (cost
per thousand impressions). Most ad networks are paying out $1 to $2
CPM. Of course only time will tell if the $3 to $6 CPM carries over
for everyone, but it’s worth a shot to see what happens.
$25.00 signup bonus
You need $50.00 for a payout and the $25.00 bonus puts you halfway
there. The only “condition” is that the bonus only hits your account
after you have made another $25.00 in clicks. Not a big deal.
Referrals
For every new referral you send to the Widget Bucks network you
earn $5.00 ONCE THEY HAVE EARNED THEIR FIRST $50.00 payout.
http://www.widgetbucks.com/home.page?referrer=549002

Update - The above is incorrect. That is what the website said
when I wrote this article. Currently it states: With WidgetBucks’
Referral program, affiliates can earn a 10 percent referral fee based
on the commissions earned by the people they refer. Affiliates receive
this 10 percent for the full 12 months after the new member joins.
Payouts to affiliates are monthly, along with their commission checks.
- Source
What makes Widget Bucks different than all the rest?
First and foremost it’s a widget that goes in the sidebar so it
obviously has application for blogging. Oh and if you don’t like a
traditional widget you have an assortment to choose from. I went with
a traditional 468×60 banner. Also you can either choose the
catergories it displays, or you can let MerchSense handle it for you
automatically.

MerchSense™ is Mpire’s patent-pending contextual algorithm
engine. It detects and analyzes the content of your website or blog to
determine what product offers are most relevant to your audience. If
you choose the MerchSense option when creating a new widget, simply
place the code on your site and let MerchSense automatically provide
the most appropriate ad content. MerchSense evaluates your editorial
information daily, so, as your content changes, WidgetBucks will
dynamically offer the highest-yielding products.
http://www.widgetbucks.com/home.page?referrer=3761001 or read more
http://r.yuwie.com/chiangmai  and  http://yuwie.blogth.com/

or read more http://r.yuwie.com/chiangmai

Beyond those things the reported CPM of $3 to $6 is neary twice
the industry average. Not bad at all.
What other features and benefits are there?
Taken directly from the Widget Bucks “about us” page.

* Self-service, scalable and relevant content that’s free and
easy to publish
* Dynamic, contextual widgets act as content (vs. ads) that
more effectively targets your users, not the masses
* Dynamic Ad Yield Management matches the best merchant for
each product while offering consumers the best price
* MerchSense (patent pending) contextual algorithm
automatically targets the right products for your site
* Proprietary analytics, pricing and relevancy engines display
buying trends of 100 million shoppers
* Extensive reporting tools and daily updates; Payouts are
monthly
* Complements existing programs, such as Google AdSense
* Over 300 configurations, 256 color schemes and formatted for
major IAB standard sizes
* Manual configuration also available by category
* Product listings from 30,000 merchants including trusted
leading brands

What are YOU waiting for?
I know you’re interested so why not just sign up for Widget Bucks
and give it a shot? For $3 to $6 CPM, and an instant $25.00 signup
bonus what have you got to lose?
http://www.widgetbucks.com/home.page?referrer=3761001
http://r.yuwie.com/chiangmai  or read more http://r.yuwie.com/chiangmai
and  http://yuwie.blogth.com/


--~--~-~--~~~---~--~~
You received this 

Re: which Django version to use for live site to be released in end of february 2008

2007-10-23 Thread Jeremy Dunck

On 10/23/07, ydjango <[EMAIL PROTECTED]> wrote:
>
> I am working on product which will be released end of february. I am
> planning to use Django for building the site. I am new to Django
>
> Which version should I use - SVN or 0.96?
>
> If I use 0.96, I am worried migration to 1.0 will be very painful and
> time consuming.
> If I use SVN version , I am not sure how stable it is?
> Are there any production sites using the svn version.
> Can some one please recommend?
>

Do you need unicode (i18n or non-ASCII charsets)?  That's the biggest
single determining factor.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



which Django version to use for live site to be released in end of february 2008

2007-10-23 Thread ydjango

I am working on product which will be released end of february. I am
planning to use Django for building the site. I am new to Django

Which version should I use - SVN or 0.96?

If I use 0.96, I am worried migration to 1.0 will be very painful and
time consuming.
If I use SVN version , I am not sure how stable it is?
Are there any production sites using the svn version.
Can some one please recommend?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone know where I can find cache tag library?

2007-10-23 Thread Jeremy Dunck

On 10/23/07, Karen Tracey <[EMAIL PROTECTED]> wrote:
> If you're referring to template fragment caching, it's been in trunk since
> rev. 6580 (just a couple of days). Doc is here:
>
> http://www.djangoproject.com/documentation/cache/#template-fragment-caching
>
> Does your checkout not have django/templatetags/cache.py?  It's certainly in
> svn:
>
> http://code.djangoproject.com/browser/django/trunk/django/templatetags/cache.py
>

 But beware the recent backwards-incompatible changes.
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newforms: required field mark

2007-10-23 Thread panta

I've done something similar for auto-generated forms (form_for_model()
and form_for_instance()), by derivating a class from BaseForm and
providing my own _html_output() method, which emits the label with
different attributes depending on its "requiredness" (using the
'attrs' parameter to BoundField.label_tag()).
Then pass your derived class to form_for_model() and
form_for_instance() using the form named parameter.

The code:

class ExtForm(forms.BaseForm):
def _html_output(self, normal_row, error_row, row_ender,
help_text_html, errors_on_separate_row):
"Helper function for outputting HTML. Used by as_table(),
as_ul(), as_p()."
from django.newforms.forms import BoundField
from django.newforms.fields import Field
from django.newforms.util import flatatt, ErrorDict,
ErrorList, ValidationError
from django.utils.html import escape
from django.utils.encoding import StrAndUnicode,
smart_unicode, force_unicode
top_errors = self.non_field_errors() # Errors that should be
displayed above all fields.
output, hidden_fields = [], []
for name, field in self.fields.items():
bf = BoundField(self, field, name)
bf_errors = self.error_class([escape(error) for error in
bf.errors]) # Escape and cache in local variable.
if bf.is_hidden:
if bf_errors:
top_errors.extend(['(Hidden field %s) %s' % (name,
force_unicode(e)) for e in bf_errors])
hidden_fields.append(unicode(bf))
else:
if errors_on_separate_row and bf_errors:
output.append(error_row %
force_unicode(bf_errors))
if bf.label:
label = escape(force_unicode(bf.label))
# Only add the suffix if the label does not end in
punctuation.
if self.label_suffix:
if label[-1] not in ':?.!':
label += self.label_suffix
if field.required:
label = bf.label_tag(label, attrs={'class':
'required'}) or ''
else:
label = bf.label_tag(label, attrs={'class':
'optional'}) or ''
else:
label = ''
if field.help_text:
help_text = help_text_html %
force_unicode(field.help_text)
else:
help_text = u''
output.append(normal_row % {'errors':
force_unicode(bf_errors), 'label': force_unicode(label), 'field':
unicode(bf), 'help_text': help_text})
if top_errors:
output.insert(0, error_row % top_errors)
if hidden_fields: # Insert any hidden fields in the last row.
str_hidden = u''.join(hidden_fields)
if output:
last_row = output[-1]
# Chop off the trailing row_ender (e.g. '')
and insert the hidden fields.
output[-1] = last_row[:-len(row_ender)] + str_hidden +
row_ender
else: # If there aren't any rows in the output, just
append the hidden fields.
output.append(str_hidden)
return u'\n'.join(output)

Hope this helps.
Cheers,
Marco


On Oct 22, 8:33 pm, [EMAIL PROTECTED] wrote:
> I see what you mean but I dont think it will work because I want the
> field elements to look sort of like:
>
> [Prompt:] [Textbox] [a red '*' initially or a error message after
> validation] [help text if any]
>
> So, in the template, I was hoping to be able do something like:
>
> {{field.label_tag}}: {{field}}
> {% if field.error%}
> {{ field.error }}
> {% else %}
>{% if field.required %} *{% endif %}
> {% endif %}
> {% if field.help_text %}}   color="silver">{{ field.help_text }}{% endif %}
>
> Not sure if I have all the code correct here but you get the idea...
>
> Thanks to everyone in the Django community!
> Carlos :)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone know where I can find cache tag library?

2007-10-23 Thread Karen Tracey
If you're referring to template fragment caching, it's been in trunk since
rev. 6580 (just a couple of days). Doc is here:

http://www.djangoproject.com/documentation/cache/#template-fragment-caching

Does your checkout not have django/templatetags/cache.py?  It's certainly in
svn:

http://code.djangoproject.com/browser/django/trunk/django/templatetags/cache.py

Karen

On 10/22/07, Nicholas Ding <[EMAIL PROTECTED]> wrote:
>
> Hi, guys:
> I've checked out the code from svn, and wanna use cache in the template,
> but cache tag library has gone...
> Does anyone know where is the tag library?
>
> Thanks
>
> --
> Nicholas @ Nirvana Studio
> http://www.nirvanastudio.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone know where I can find cache tag library?

2007-10-23 Thread Jeremy Dunck

On 10/22/07, Nicholas Ding <[EMAIL PROTECTED]> wrote:
> Hi, guys:
> I've checked out the code from svn, and wanna use cache in the template, but
> cache tag library has gone...
> Does anyone know where is the tag library?
http://www.djangosnippets.org/snippets/223/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Djangonauts in Amsterdam, Prague, or Krakow?

2007-10-23 Thread Rafal bluszcz Zawadzki

On Friday 19 October 2007 19:10:28 Brian Luft wrote:
> My wife and I are travelling through Eastern Europe for the next 2
> months. (we're starting in Amsterdam though).
>
> I'd love to meet up with any Djangonauts for a little chat.  I like
> beer, wine, Django, and open source software if anyone can spare a few
> minutes for a chat :)

I can try drink one or two couples of wine ;)

-- 
Rafał bluszcz Zawadzki
http://my.jabberpl.org - use jabber
http://bluszcz.jogger.pl - my blog
http://glam.pl - buy secondhand clothes
http://dkf.glam.pl - domorosły krytyk filmowy

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unable to display images

2007-10-23 Thread Rafal bluszcz Zawadzki

On Tuesday 23 October 2007 04:55:26 Anurag wrote:
> Sorry for this repeat post - but i am getting quite desperate and be
> very thankful for some help...
>
> I am unable to display images directly through Apache - with the
> following configuration.Can someone please help. Much thanks!


What is the problem? Does pictures are still serving by django? Try to get 
http://youserver/static/images/Contact1.png and
http://youserver/static/

then paste here first lines of output...

> the line in my base html reads the following
>   ALT ="contact"/>
>
> my media_url is set to /static/
> and the htpd.conf reads the following
>
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> PythonDebug On
> 
>
> 
> SetHandler None
> 
> Alias /media/  "C:/Python25/Lib/site-packages/django/contrib/admin/
> media/"
>  media/">
>Order deny,allow
>Allow from all
>  
>
> 
> SetHandler None
>  
> Alias /static/  "C:/myapp/static/"
> 
>Order deny,allow
>Allow from all
> 
>
>
> -- 
Rafał bluszcz Zawadzki
http://my.jabberpl.org - use jabber
http://bluszcz.jogger.pl - my blog
http://glam.pl - buy secondhand clothes
http://dkf.glam.pl - domorosły krytyk filmowy

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Authenticating static content when not using mod_python

2007-10-23 Thread AndyB

(my reply via email doesn't appear to have made it to the list - sorry
if the first paragraph is a repeat for anyone)

Thanks Chris, I didn't know about this and it would be the ideal
solution if I could get Dreamhost to install mod_xsendfile! Still
hopefully this will be useful for someone out there who is stuck with
FCGI but has some control over what modules are installed.

Now back to having to do it the laborious way - I remember being told
that django.views.static.serve wasn't meant to be used in a production
environment but in this context it seems to do everything I need (MIME
types etc.). Bearing in mind Django is going to have to handle the
static content for me is there anything wrong with using
django.views.static.serve?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: can contrib.sites.models (Site) belong to an application model?

2007-10-23 Thread Tim Perrett

For sure, ive been playing with it and have seen that I can have one-
to-many (Site has-many Partners) and ManyToMany, but I was looking to
have it so that one partner has many sites? Is the ManyToMany the only
way to do this? As in terms of a DB schema, its not a many to many
relationship.

Ideally I would like to be able to determine what partner that site
belonged to, is that even possible? It just seemed to me that there
might well not be a way of doing it???

Thanks for any help in advance

Tim




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: can contrib.sites.models (Site) belong to an application model?

2007-10-23 Thread Russell Keith-Magee

On 10/23/07, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
> I have a model called Partner which i would like to have-many Sites,
> is this possible? Or is this too ingrained in the django code itself?

Sure - Site is just a model in the contrib 'sites' application, so you
can import and reference the Site model just like you would for any
other Many-to-many relation:

from django.db import models
from django.contrib.sites.models import Site

class Partner(models.Model):
... your attributes here
sites = models.ManyToManyField(Site)

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: GET parameter in a template

2007-10-23 Thread Rufman


>
> The attribute on request is called GET (all upper-case). Django's
> templating language is case-sensitive.

thanks!! that was the problem


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Avoid Unhandled exception page from flup

2007-10-23 Thread Rafal bluszcz Zawadzki

Hello. I am trying to avoid default (below attached) default Unhandled ex. 
pagtes served by flup. Is there any easy way to override it / serve own page 
instead one of this:


def error(self, req):$
"""$
Called by Request if an exception occurs within the handler. May and$
should be overridden.$
"""$
if self.debug:$
import cgitb$
req.stdout.write('Content-Type: text/html\r\n\r\n' +$
 cgitb.html(sys.exc_info()))$
else:$
errorpage = """$
$
Unhandled Exception$
$
Unhandled Exception$
An unhandled exception was thrown by the application.$
$
"""$
req.stdout.write('Content-Type: text/html\r\n\r\n' +$
 errorpage)$

-- 
Rafał bluszcz Zawadzki
http://my.jabberpl.org - use jabber
http://bluszcz.jogger.pl - my blog
http://glam.pl - buy secondhand clothes
http://dkf.glam.pl - domorosły krytyk filmowy

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Some more interesting Powerpoint Shows

2007-10-23 Thread Ankur Kothari
How to make yourself
happy
How to make things
better
How to make them
stay
How to make the Olympic Games more
interesting
How To Make an Effective Presentation in 99
Second...
How to Live 
Life
How to have a happier
home
How to have a good
day
How to get through
2007
How to draw up a business
plan
How to avoid Car
Theft
How Thrilling it
is
how the mind is
conditioned
How Safe is big
car
How many friends have
you
How do you know as your organisation is
learning
How Do You 
Know
How Do You Feel
Now
How do I use powerpoint to
teach
How did this 
happen
How could 
you
How Big Is Wal 
Mart
how are 
you
House of 
Golf
hotline
Hotels particuliers pour voyager
autrement
Hot 
lips
Hot 
Dreaming
Hot 
Baloons
Horse 
Horrible 
Dolls
Horoscope 
test
hope 
eternal
Hop Step 
Jump
Hong Kong 
airport
Honey 
Homour
Hommage 
Senna

-- 
Ankur

CrIcKeT
http://cricketmyreligion.blogspot.com/
Exercise to live forever
http://exercisebetterandsafer.blogspot.com/

Indian cricket!!!
http://problemsgalore.blogspot.com/
MaKe MoNeY OnLiNe & GeT RicH  http://getrichonlinefast.blogspot.com/
How to win and influence People http://winpeople.blogspot.com/
Powerpoint Show
http://powerpoint-presentation-share.blogspot.com/
Healthy foods!!!
http://eattolivehealthy.blogspot.com/
See who is complaining? Aussie gets back from brave
Indians.   http://thewarofwordscalledrasicm.blogspot.com/
World news you would hate to
miss!!!
http://worldnewsyouwouldhatetomiss.blogspot.com/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 

GET parameter in a template

2007-10-23 Thread Rufman

hey

I render my template by passing a RequestContext object. This way i
can access the user info ({{ user.username }}). I tried displaying the
GET parameter like this: {{ get. }} and
{{ request.get. }}. Either way i don't get any
output. Is there even a way to display the get parameter without
explicitly passing it in the context?

thanks for the help


Stephane


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---