Random UnicodeDecodeError ??

2008-02-13 Thread Meista

Hi,

im getting a UnicodeDecodeError in my application.
The strange thing is that it appears on the very first request after a
restart.
Then everything works fine but the error appears sporadic over the
day.
The app runs as fastcgi. Django version is trunk from 01/27/2008
request.session['akt_Firma'] contains a number i.e "1".
Has somebody a hint for me?

Mike


Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/django/core/handlers/
base.py", line 82, in get_response
response = callback(request, *callback_args, **callback_kwargs)

  File "/var/www/xxx//rechnung/views.py", line 515, in DocList
firma=Firma.objects.get(nr=int(request.session['akt_Firma']))

  File "/usr/lib/python2.4/site-packages/django/db/models/manager.py",
line 69, in get
return self.get_query_set().get(*args, **kwargs)

  File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 261, in get
obj_list = list(clone)

  File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 114, in __iter__
return iter(self._get_data())

  File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 483, in _get_data
self._result_cache = list(self.iterator())

  File "/usr/lib/python2.4/site-packages/django/db/models/query.py",
line 189, in iterator
cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "")
+ ",".join(select) + sql, params)

  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line
163, in execute
self.errorhandler(self, exc, value)

  File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
35, in defaulterrorhandler
raise errorclass, errorvalue

UnicodeDecodeError: 'utf8' codec can't decode bytes in position 3-4:
invalid data
--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread Eric Abrahamsen

Oh... Well, TextMate has esc to cycle through completion based on  
words previously used in the document, but other than that it mostly  
works off tab triggers.


On Feb 14, 2008, at 2:56 PM, [EMAIL PROTECTED] wrote:

>
> I don't think thats what he meant be syntax completion, usually that
> means if I start typing a keyword/function/ or possibly a variable
> name it will start to complete it.
>
> On Feb 14, 12:48 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
>> Make sure you've got the document recognized as a Django template (ie
>> it says "HTML (Django)" at the bottom of the page). Try typing "if"
>> and hitting tab; does it turn into a set of if/endif template tags?
>> Look under the gear menu, also at the bottom of the page, for other
>> stuff you can do...
>>
>> Eric
>>
>> On Feb 14, 2008, at 12:36 PM, Francis wrote:
>>
>>
>>
>>> how do you get syntax completion?
>>
>>> I can't get it work with textmate. And it's one reason I'm sticking
>>> with eclipse (pydev).
>>
>>> On 13 fév, 17:18, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
 Textmate works great for me. I use GetBundle
 (http://projects.validcode.net/getbundle) to get the Django bundle
 which does syntax completion and highlighting for Django-specific
 Python files and Django template HTML.
>>
 More info here:http://code.djangoproject.com/wiki/TextMate
>>
 /alex
>>
 On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
>>
> Hi Djangonauts.
>>
> I was looking around for a good IDE for the Mac and have tried
> simple
> text editors like Smultron (http://smultron.sourceforge.net/) and
> full
> featured IDEs like Eclipse with PyDev but I am still not really
> satisfied.
> Simple text editors lack features like code completition or file
> tree
> navigation and Eclipse on the other hand is a bit slow on the Mac.
> So
> what do you use? Is it possible or reasonable to use Xcode (the
> "native" Mac IDE)?
>>
> Thomas
> >


--~--~-~--~~~---~--~~
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 Import "mysite" Problem

2008-02-13 Thread Malcolm Tredinnick


On Thu, 2008-02-14 at 13:07 +0530, Sairam Krishnamurthy wrote:
> Hi,
> 
> I created the tables in the database using models.py. It was
> successful. I tried to write a script to populate the database. My
> project name is "myproject". I have an app "test" inside that project.
> 
> When i tried to import a class "Users" from models.py("from
> myproject.test.models import Users") i gwt the following error. 
> 
> raise EnvironmentError, "Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e) EnvironmentError: Could not import settings
> 'configurator.settings' (Is it on sys.path? Does it have syntax
> errors?): No module named configurator.settings
> 
> I also added my project path to sys.path.
> 
> The DJANGO_SETTINGS_MODULE variable has a value myproject.settings.

So you need to be able to execute "import myproject". Which means that
the *parent* directory of myproject has to be on your Python path, not
myproject itself.

Regards,
Malcolm

-- 
Success always occurs in private and failure in full view. 
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
-~--~~~~--~~--~--~---



Django Import "mysite" Problem

2008-02-13 Thread Sairam Krishnamurthy
Hi,

I created the tables in the database using models.py. It was successful. I
tried to write a script to populate the database. My project name is
"myproject". I have an app "test" inside that project.

When i tried to import a class "Users" from models.py("from
myproject.test.models import Users") i gwt the following error.

raise EnvironmentError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'configurator.settings' (Is it
on sys.path? Does it have syntax errors?): No module named
configurator.settings

I also added my project path to sys.path.

The DJANGO_SETTINGS_MODULE variable has a value myproject.settings.

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



Re: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread grahamu



On Feb 14, 12:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> That's because you are expecting things from reverse() that it
> explicitly doesn't do. In particular, the "args" and "kwargs" parameters
> to reverse are only checked against capturing groups in the URL's
> regular expression.
>
> The reason for this is that to also permit people to specify things in
> extra_dict will rapidly (in fact, already has when people suggested
> this) lead to confusion about what is and isn't possible and how Python
> actually works. String matching is easy: all strings with the same value
> compare as equal. But then people start wanting to put QuerySets in
> there or other class instances or complex objects that have interesting
> equality comparison behaviour and the slippery slope leads straight to
> hell. So, to maintain sanity all around, you can't do that, as you've
> discovered. That's intentional.

LOL, my sanity has been questionable for years.

> Fortunately, there's a solution, I'm pretty sure:
>
> (r'^(?Pdrink)/', include(app.urls))
> (r'^(?Peat)/', include(app.urls))
>
> or, even more succintly:
>
> r'^(?Peat|drink)/', include(app.urls))
>
> These might trip across other urlresolver bugs, from memory (I have a
> feeling the bug still exists where if we don't match the first item
> that's a potential candidate, we fail unconditionally, rather than
> testing everything). In any case, I'll check out those side cases in the
> next few hours, since I'm doing some trunk work at the moment and this
> has come up.
>
> So either the alternatives work right now or will work within a day or
> two. That's certainly the way to approach this, though, because the
> other way just opens up the door to far too many user problems.

Your memory is quite good. I did try exactly what you suggested many
hours ago today and saw the result you describe (see below). If the
first item does not match it fails. So I figured I still didn't have
the syntax correct or something.

Presumably the url template tag will perform similarly to reverse when
the fix is made? So this would be equivalent:

{% url 'food-view' myname='drink' %}

Thanks so much for your help Malcolm.

urlpatterns = patterns('',
(r'^(?Pdrink)/', include('app.urls')),
(r'^(?Peat)/', include('app.urls')),
)

>>> reverse('food-view', kwargs={'myname':'drink'})
'/drink/'

>>> reverse('food-view', kwargs={'myname':'eat'})
Traceback (most recent call last):
  File "", line 1, in ?
  File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
reverse
return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
*args, **kw
args))
  File "c:\django\trunk\django\core\urlresolvers.py", line 283, in
reverse
return u''.join([reverse_helper(part.regex, *args, **kwargs) for
part in sel
f.reverse_dict[lookup_view]])
  File "c:\django\trunk\django\core\urlresolvers.py", line 88, in
reverse_helper

result = re.sub(r'\(([^)]+)\)', MatchChecker(args, kwargs),
regex.pattern)
  File "C:\Python24\lib\sre.py", line 142, in sub
return _compile(pattern, 0).sub(repl, string, count)
  File "c:\django\trunk\django\core\urlresolvers.py", line 129, in
__call__
raise NoReverseMatch("Value %r didn't match regular expression %r"
% (value,
 test_regex))
NoReverseMatch: Value 'eat' didn't match regular expression 'drink'
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Python & Django Noob at Django Sprint at PyCon 2008?

2008-02-13 Thread lirit

I'm new to Python and Django. I will be at the PyCon 2008. I'm
thinking about staying after the talks for the Django Sprint, but I'm
not sure what I can contribute... any suggestion?
--~--~-~--~~~---~--~~
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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread Malcolm Tredinnick


On Wed, 2008-02-13 at 22:35 -0800, grahamu wrote:
> 
> On Feb 13, 7:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
> [...]
> > As Alex pointed out, you're calling reverse() on something that isn't a
> > direct URL pattern. Don't do that. It makes no sense to call reverse()
> > on something that is actually a collection of URL patterns. Instead,
> > pick one of the URL patterns inside urls2 and call reverse on that.
> 
> Good point, one which I now understand from Alex' and your comments.
> 
> What I am trying to accomplish is two different project URLs which
> both resolve to the same application urlconf, yet can be
> differentiated by a view in the application. In other words, the app
> view needs to determine the root URL used to reach the view.
> 
> A slightly different example is in order. In this example we have a
> 'mysite' project url config, and an application url config.
> 
> mysite.urls contains
> [...]
> (r'^drink/', include('app.urls'), {'myname':'drink'}),
> (r'^eat/', include('app.urls'), {'myname':'eat'}),
> [...]
> 
> URLs /mysite/drink/ and /mysite/eat/ are next resolved at the
> application urlconf:
> 
> mysite.app.urls contains
> [...]
> url(r'^$', 'views.func', name='food-view'),
> [...]
> 
> At this point /mysite/drink/ and /mysite/eat/ resolve to the same app
> view function, "func".
> 
> mysite.app.views contains
> def func(request, myname):
> [...]
> originating_url = reverse('food-view',
> kwargs={'myname':myname})
> 
> This does not give me the results I expect, although it seems that it
> should. I expected kwargs 'myname' to help reverse() differentiate
> between the two URLs. Instead, both originating URLs (/mysite/drink/
> and /mysite/eat/) reverse() resolve to /mysite/drink/ (the first URL
> in the project urlconf).

That's because you are expecting things from reverse() that it
explicitly doesn't do. In particular, the "args" and "kwargs" parameters
to reverse are only checked against capturing groups in the URL's
regular expression.

The reason for this is that to also permit people to specify things in
extra_dict will rapidly (in fact, already has when people suggested
this) lead to confusion about what is and isn't possible and how Python
actually works. String matching is easy: all strings with the same value
compare as equal. But then people start wanting to put QuerySets in
there or other class instances or complex objects that have interesting
equality comparison behaviour and the slippery slope leads straight to
hell. So, to maintain sanity all around, you can't do that, as you've
discovered. That's intentional.

Fortunately, there's a solution, I'm pretty sure:

(r'^(?Pdrink)/', include(app.urls))
(r'^(?Peat)/', include(app.urls))

or, even more succintly:

r'^(?Peat|drink)/', include(app.urls))

These might trip across other urlresolver bugs, from memory (I have a
feeling the bug still exists where if we don't match the first item
that's a potential candidate, we fail unconditionally, rather than
testing everything). In any case, I'll check out those side cases in the
next few hours, since I'm doing some trunk work at the moment and this
has come up.

So either the alternatives work right now or will work within a day or
two. That's certainly the way to approach this, though, because the
other way just opens up the door to far too many user problems.

Regards,
Malcolm

-- 
The sooner you fall behind, the more time you'll have to catch up. 
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: Xcode as Django IDE

2008-02-13 Thread [EMAIL PROTECTED]

I don't think thats what he meant be syntax completion, usually that
means if I start typing a keyword/function/ or possibly a variable
name it will start to complete it.

On Feb 14, 12:48 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
> Make sure you've got the document recognized as a Django template (ie
> it says "HTML (Django)" at the bottom of the page). Try typing "if"
> and hitting tab; does it turn into a set of if/endif template tags?
> Look under the gear menu, also at the bottom of the page, for other
> stuff you can do...
>
> Eric
>
> On Feb 14, 2008, at 12:36 PM, Francis wrote:
>
>
>
> > how do you get syntax completion?
>
> > I can't get it work with textmate. And it's one reason I'm sticking
> > with eclipse (pydev).
>
> > On 13 fév, 17:18, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
> >> Textmate works great for me. I use GetBundle
> >> (http://projects.validcode.net/getbundle) to get the Django bundle
> >> which does syntax completion and highlighting for Django-specific
> >> Python files and Django template HTML.
>
> >> More info here:http://code.djangoproject.com/wiki/TextMate
>
> >> /alex
>
> >> On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
>
> >>> Hi Djangonauts.
>
> >>> I was looking around for a good IDE for the Mac and have tried
> >>> simple
> >>> text editors like Smultron (http://smultron.sourceforge.net/) and
> >>> full
> >>> featured IDEs like Eclipse with PyDev but I am still not really
> >>> satisfied.
> >>> Simple text editors lack features like code completition or file
> >>> tree
> >>> navigation and Eclipse on the other hand is a bit slow on the Mac.
> >>> So
> >>> what do you use? Is it possible or reasonable to use Xcode (the
> >>> "native" Mac IDE)?
>
> >>> Thomas
--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread Eric Abrahamsen

Make sure you've got the document recognized as a Django template (ie  
it says "HTML (Django)" at the bottom of the page). Try typing "if"  
and hitting tab; does it turn into a set of if/endif template tags?  
Look under the gear menu, also at the bottom of the page, for other  
stuff you can do...

Eric

On Feb 14, 2008, at 12:36 PM, Francis wrote:

>
> how do you get syntax completion?
>
> I can't get it work with textmate. And it's one reason I'm sticking
> with eclipse (pydev).
>
>
> On 13 fév, 17:18, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
>> Textmate works great for me. I use GetBundle
>> (http://projects.validcode.net/getbundle) to get the Django bundle
>> which does syntax completion and highlighting for Django-specific
>> Python files and Django template HTML.
>>
>> More info here:http://code.djangoproject.com/wiki/TextMate
>>
>> /alex
>>
>> On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> Hi Djangonauts.
>>
>>> I was looking around for a good IDE for the Mac and have tried  
>>> simple
>>> text editors like Smultron (http://smultron.sourceforge.net/) and  
>>> full
>>> featured IDEs like Eclipse with PyDev but I am still not really
>>> satisfied.
>>> Simple text editors lack features like code completition or file  
>>> tree
>>> navigation and Eclipse on the other hand is a bit slow on the Mac.  
>>> So
>>> what do you use? Is it possible or reasonable to use Xcode (the
>>> "native" Mac IDE)?
>>
>>> Thomas
> >


--~--~-~--~~~---~--~~
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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread grahamu


On Feb 13, 7:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
[...]
> As Alex pointed out, you're calling reverse() on something that isn't a
> direct URL pattern. Don't do that. It makes no sense to call reverse()
> on something that is actually a collection of URL patterns. Instead,
> pick one of the URL patterns inside urls2 and call reverse on that.

Good point, one which I now understand from Alex' and your comments.

What I am trying to accomplish is two different project URLs which
both resolve to the same application urlconf, yet can be
differentiated by a view in the application. In other words, the app
view needs to determine the root URL used to reach the view.

A slightly different example is in order. In this example we have a
'mysite' project url config, and an application url config.

mysite.urls contains
[...]
(r'^drink/', include('app.urls'), {'myname':'drink'}),
(r'^eat/', include('app.urls'), {'myname':'eat'}),
[...]

URLs /mysite/drink/ and /mysite/eat/ are next resolved at the
application urlconf:

mysite.app.urls contains
[...]
url(r'^$', 'views.func', name='food-view'),
[...]

At this point /mysite/drink/ and /mysite/eat/ resolve to the same app
view function, "func".

mysite.app.views contains
def func(request, myname):
[...]
originating_url = reverse('food-view',
kwargs={'myname':myname})

This does not give me the results I expect, although it seems that it
should. I expected kwargs 'myname' to help reverse() differentiate
between the two URLs. Instead, both originating URLs (/mysite/drink/
and /mysite/eat/) reverse() resolve to /mysite/drink/ (the first URL
in the project urlconf).

Since this concept is proving difficult to implement while most other
tasks in Django are easy, I began wondering if my design needs
refactoring. For instance, I could have mysite.urls resolve /drink/
and /eat/ to separate app urlconfs:

(r'^drink/', include('app.urls.drink'), {'myname':'drink'}),
(r'^eat/', include('app.urls.eat'), {'myname':'eat'}),

That idea violates DRY, because both app urlconfs will contain exactly
the same subsequent patterns and function calls but with different
pattern names. Most of my refactoring ideas end with the same result,
duplication of code. Perhaps that is inevitable in this case.
Regardless thanks very much for clearing up my initial confusion about
where to name a pattern.
--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread Francis

how do you get syntax completion?

I can't get it work with textmate. And it's one reason I'm sticking
with eclipse (pydev).


On 13 fév, 17:18, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
> Textmate works great for me. I use GetBundle
> (http://projects.validcode.net/getbundle) to get the Django bundle
> which does syntax completion and highlighting for Django-specific
> Python files and Django template HTML.
>
> More info here:http://code.djangoproject.com/wiki/TextMate
>
> /alex
>
> On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Djangonauts.
>
> > I was looking around for a good IDE for the Mac and have tried simple
> > text editors like Smultron (http://smultron.sourceforge.net/) and full
> > featured IDEs like Eclipse with PyDev but I am still not really
> > satisfied.
> > Simple text editors lack features like code completition or file tree
> > navigation and Eclipse on the other hand is a bit slow on the Mac. So
> > what do you use? Is it possible or reasonable to use Xcode (the
> > "native" Mac IDE)?
>
> > Thomas
--~--~-~--~~~---~--~~
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 set initial value for select multiple

2008-02-13 Thread cschand


I have a form

class NetworkForm(forms.Form):
choices = []
for network in Network.objects.all():
choices.append((network.id, network.name))

network =
forms.CharField(widget=forms.CheckboxSelectMultiple(choices=choices))

and in view i called this network form by
   network_form = NetworkForm()

  My problem is i want to set initial value for the given network
CheckboxSelectMultiple field..

Is there is any way to go it?

Thanks in advance

cschand
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Null ManyToManyFields

2008-02-13 Thread SeanFromIT

I have a class with ManyToManyFields that are 'optional' relations. If
I set the ManyToManyField to null=True and blank=True, the admin
interface treats it as optional, but when I hit Save I get the error:

OperationalError at /admin/app/report/add/
(1048, "Column 'addedBy_id' cannot be null")

So, what's the proper way to make the m2m relation optional?
--~--~-~--~~~---~--~~
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: Null ManyToManyFields

2008-02-13 Thread Malcolm Tredinnick


On Wed, 2008-02-13 at 19:34 -0800, SeanFromIT wrote:
> I have a class with ManyToManyFields that are 'optional' relations. If
> I set the ManyToManyField to null=True and blank=True, the admin
> interface treats it as optional, but when I hit Save I get the error:
> 
> OperationalError at /admin/app/report/add/
> (1048, "Column 'addedBy_id' cannot be null")

I suspect this isn't the error you think it is. Firstly,
ManyToManyFields are pretty much implicitly null=True always. This is
because you have to save an object before you can add things to its
many-to-many fields. 

Secondly, if model XYZ has a ManyToManyField, there's no column in the
database table for XYZ corresponding to that field. Instead, there's the
intermediate table. So that column error can't be coming from a column
in the table for XYZ.

Could you post the smallest failing example possible to show what's
going on here. The only way I can imagine getting that error is if it's
caused by the intermediate table (linking your model to the other
model). That would mean the admin interface was lettting you add
something that wasn't already saved, which would elicit complaints frmo
everybody using ManyToManyFields in the admin interface. The two columns
in the intermediate table are named after the models they link, so is
one of you models called "addedBy"? If not, you're debugging the wrong
problem.

So, recheck what's going on here. Maybe everything you say is accurate,
but I'm a little suspicious. If it is correct, shrink your example to
the smallest possible failing example and then record every step you do
(maybe even take a screenshot or two to show the situation right before
you press "save"). On the information you've provided so far, it's a
little hard to work out what might be going on.

Regards,
Malcolm


> 
> So, what's the proper way to make the m2m relation optional?
> > 
> 
-- 
I don't have a solution, but I admire your problem. 
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
-~--~~~~--~~--~--~---



Can't login to /admin/ on production server over FastCGI

2008-02-13 Thread Dave Dash

When I go to /admin/ and login the screen just returns to the login
screen again with no errors or anything.

I have SESSION_COOKIE_DOMAIN set propperly as well and that didn't
help (the faq said it might).

I then tried using the built in server, and I ran that using the same
domain, but port 8000 as the listener.  That worked fine.

In fact, when I went to the production server (fastcgi) that cookie
got me to the admin interface.

So I'm wondering if there's some trick that is preventing the cookie
from getting to me.  I have liveHTTP headers, but I'm nothing looks
too out of the ordinary.  Cookies are sent with the requests just fine
and recieved just fine...
--~--~-~--~~~---~--~~
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: def __str__ invalid syntax

2008-02-13 Thread SeanFromIT

The problem was blank space mismatch. Choose your IDE wisely...

On Feb 3, 9:10 pm, SeanFromIT <[EMAIL PROTECTED]> wrote:
> class Report(models.Model):
> ID = models.AutoField(primary_key=True)
> Abstract = models.CharField(blank=True, maxlength=60)
> def __str__(self):
> return self.Abstract
> class Meta:
> db_table = 'Report'
>
> Invalid syntax error on first letter of def __str__(self). 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
-~--~~~~--~~--~--~---



How to return Admin to previous filters after save?

2008-02-13 Thread cyberjack

I have an admin interface managing a few thousand records. Finding a
record requires heavy use of multiple list_filter selections. However,
once a user edits a record, the admin interface redirects to the root
admin URL and loses the filter state.

Is there an easy way to have the admin editor return to the calling
URL after a form submit?

 Ie, I'd like the Admin tool to redirect to
   /admin/foo/?is_active__exact=0&type__exact=A&model__exact=B
instead of
  /admin/foo/?

Thanks,

-Josh
--~--~-~--~~~---~--~~
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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread Malcolm Tredinnick


On Wed, 2008-02-13 at 15:22 -0800, grahamu wrote:
[...]
> >>> reverse('eat')
> Traceback (most recent call last):
[...]
> NoReverseMatch
> 
> Is there a workaround for this issue? Am I doing something
> incorrectly?

As Alex pointed out, you're calling reverse() on something that isn't a
direct URL pattern. Don't do that. It makes no sense to call reverse()
on something that is actually a collection of URL patterns. Instead,
pick one of the URL patterns inside urls2 and call reverse on that.

>  Should I file a ticket?

The only semi-bug here is maybe that we don't issue a warning if you
pass a name to something with an include(). We do correctly raise an
error if you try to use the name in reverse(), though (The case where
you called reverse('drink') worked correctly, since it was for a
specific, unambiguous URL pattern). There's no bug there.

You might like to open a ticket for the warning issue. However the type
of call you're trying to make is not intended to work; it just doesn't
make sense in the general case.

Regards,
Malcolm


-- 
I just got lost in thought. It was unfamiliar territory. 
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: FloatField Size on Generic Views

2008-02-13 Thread Malcolm Tredinnick


On Wed, 2008-02-13 at 10:35 -0800, [EMAIL PROTECTED] wrote:
> Is there a way to set the "size" attribute of FloatFields in Generic
> Views? Currently they're pretty big, and it seems like max_digits was
> deprecated in FloatFields with the arrival of DecimalFields.

You're confusing two concepts here. There's the size of a field with
respect to the data size -- how large a value is stored in the database
-- and there's the size of the form field when displayed in a form.

Attributes like max_digits (in fact, almost all attributes on model
fields) deal with how the data is represented at the database level.
They carry no presentation information since there are many different
ways to present the same data.

So you're wanting to change the size of the HTML form field. CSS is the
usual answer here. Short- to medium-term, we'll port the generic views
over to newforms, which might make things a little easier, but that
hasn't been done yet (there are a couple of patches around, but they
need a little reviewing and tweaking, so it'll be done at some point).

Regards,
Malcolm

-- 
On the other hand, you have different fingers. 
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: Using the sites-system with a twist - is it possible?

2008-02-13 Thread Malcolm Tredinnick


On Wed, 2008-02-13 at 14:52 +0100, Johan Liseborn wrote:
[...]
> As far as I can tell, the Django site-system relies on the different
> sites having different domains,

Well not exactly, but close. The idea is one site per settings file. At
the moment you can't change that to be more dynamic. It's a long-term
plan to be able to do so, but it's very low priority and not entirely
trivial (it's part of a larger set of things to be more
WSGI-accommodating).

>  while my requirement seems to indicate
> that the "site" (or pseudo-domain) should be decided by the logged in
> user rather than the domain name, so I am a bit pessimistic that I can
> accomplish what I say above, even though the two use cases seems very
> similar data-handling-wise; please tell me I am wrong... :-)

Well, they're similar in that different access paths see different data,
but that's pretty much everything in web land. The Sites framework is
one level at which these access paths can be controlled. You want to
control it at a different level: per-request.

If I was going to be doing this, I'd almost certainly just write up a
quick middleware that ran after the authentication middleware on the
request path and set an attribute on the request object indicating the
"site" (in your model) to use for further lookups. Then it's just a
matter of filtering lookups with that restriction each time. Needs a
little thought, depending on what you're doing, but certainly possible.

> Also, is there a way to play with the sites-system using runserver? It
> seems you need to have multiple settings-files (which I guess would be
> simple using e.g. Apache and a bunch of virtual hosts), but it seems I
> cannot do that with runserver.

There's nothing to stop you creating multiple settings files and
starting multiple runserver instances on different ports.

Regards,
Malcolm

-- 
If at first you don't succeed, destroy all evidence that you tried. 
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
-~--~~~~--~~--~--~---



TemplateDoesNotExist at /admin/

2008-02-13 Thread Roy Lowrance

I am new to Django and working my way through the Django book, which I
believe is the 0.96 release.

I'm up to Chapter 6 and trying to get the admin site to work. When my
browser goes to http://.../admin/, I get the message in the subject
line. I'm guessing that the admin directory under mysite needs to have
the file login.html.

Is this right?

Where can I find this file?

Thanks, Roy

Here is the top part of the error page displayed by the development server:


TemplateDoesNotExist at /admin/
admin/login.html
 Request Method: GET
 Request URL: http://127.0.0.1:8000/admin/
 Exception Type: TemplateDoesNotExist
 Exception Value: admin/login.html
 Exception Location:
/Library/Python/2.5/site-packages/django/template/loader.py in
find_template_source, line 72

--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread Eric Abrahamsen

> Textmate, and a couple of terminal windows for mysql and ipython.
> 2 monitors helps ;-)
>
> what does 'getbundle' do? I already have django specific templates in
> textmate via the "mateup" script on their site.


Another happy TextMate user! GetBundle is just a simpler interface
(itself a bundle) for installing and updating bundles. If you've
already got the Python Django Templates bundle it won't help you
(unless you want an easier way to install other new bundles).

eric
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Releasing django-treemenus: a generic menu application for Django

2008-02-13 Thread Julien

Hi all,

I hope it's ok if I do this announcement here, as my blog hasn't been
hooked up to the Django community aggregator yet .

I remember when starting using Django, I was a bit disappointed that
there was no easy-to-use or straight-forward application to build
menus, at least I didn't find any that suited me. Yet, menus are
something that you find on pretty much every website, and I wanted to
fill that gap. So I started making my own app, and made it generic and
open source so it could hopefully benefit other django users.

So here it is, django-treemenus[1], a simple and generic application
that lets you easily build tree-structured menus for your django site.
It contains all (and only) the essentials, and it should be easy for
anyone to extend it to fit their particular needs. You can define your
own templates, and there's a user-friendly admin interface to manage
the structure of your menus.

All the code and documentation are available at google code [1].

Have a go, and please let me know about potential issues or bugs,
either here, on my blog[2] or on the google code issue tracking
system.

All the best,

Julien

[1] http://code.google.com/p/django-treemenus/
[2] http://www.creativityandcognition.com/blogs/julien/?cat=5
--~--~-~--~~~---~--~~
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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread Dj Gilcrease
Try writing your urls like this

urlpatterns = patterns('',
   url(r'^drink/', 'views.func', kwargs={'myname':'drink'}, name='drink'),
   url(r'^eat/', 'views.func', kwargs={'myname':'eat'}, name='eat'),
   url(r'^exercise/', 'views.func', kwargs={'myname':'exercise'},
name='exercise'),
   url(r'^sleep/', 'views.func', kwargs={'myname':'sleep'}, name='sleep'),
)

Also to include kwargs in reverse, you do

reverse('views.func', myname='sleep')

2008/2/13 grahamu <[EMAIL PROTECTED]>:
>
> Thanks for your explanation, Alex.
> Unfortunately, "reverse('views.func')" always returns the first match
> for that function in urlpatterns.
>
> My objective is to distinguish between two different URL patterns
> which both resolve to the same view function.
> Given your suggestion, I tried the following:
>
>>>> reverse('views.func', kwargs={'myname':'drink'})
>>>> '/drink/'
>>>> reverse('views.func', kwargs={'myname':'exercise'})
>>>> '/drink/'
>>>> reverse('views.func', kwargs={'myname':'eat'})
>>>> '/drink/'
>>>> reverse('views.func', kwargs={'myname':'sleep'})
>>>> '/drink/'
>
> So that solution does not work because the resolver apparently ignores
> the kwargs when presented with a function instead of a named URL.
>
>
>
> On Feb 13, 4:34 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> > Hi, graham
> >
> > Imagine that your urls2.py has some number of patterns. And then you
> > call `reverse('eat')` what of them have to be returned? So to get
> > proper result you have to write something like this
> > `reverse('views.func')`
> >
> > On 14 фев, 02:22, grahamu <[EMAIL PROTECTED]> wrote:
> >
> > > Lots of people correctly suggest using named url patterns and the {%
> > > url %} template tag to obtain a URL. The concept is great and follows
> > > the DRY principle. However, I believe that if a pattern has an
> > > "include()" instead of a view function, the existing
> > > mechanism fails. An example of the problem, using three files in a
> > > standard Django project:
> >
> > > --file views.py--
> > > def func:
> > > pass
> > > --end file--
> >
> > > --file urls.py--
> > > from django.conf.urls.defaults import *
> > > from views import func
> > > urlpatterns = patterns('',
> > > (r'^drink/', 'views.func', {'myname':'drink'}, 'drink'),
> > > (r'^eat/', include('urls2'), {'myname':'eat'}, 'eat'),
> > > url(r'^exercise/', func, kwargs={'myname':'exercise'},
> > > name='exercise'),
> > > url(r'^sleep/', include('urls2'), kwargs={'myname':'sleep'},
> > > name='sleep'),
> > > )
> > > --end file--
> >
> > > --file urls2.py--
> > > from django.conf.urls.defaults import *
> > > urlpatterns = patterns('',
> > > (r'^$', 'views.func'),
> > > )
> > > --end file--
> >
> > > Invoking "manage.py shell", these are the results of calling reverse()
> > > (which I understand from the documentation works very much the same as
> > > {% url %}:
> >
> > > >>> from django.core.urlresolvers import reverse
> > > >>> reverse('drink')
> > > '/drink/'
> > > >>> reverse('eat')
> >
> > > Traceback (most recent call last):
> > >   File "", line 1, in ?
> > >   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> > > reverse
> > > return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> > > *args, **kw
> > > args))
> > >   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> > > reverse
> > > raise NoReverseMatch
> > > NoReverseMatch>>> reverse('exercise')
> > > '/exercise/'
> > > >>> reverse('sleep')
> >
> > > Traceback (most recent call last):
> > >   File "", line 1, in ?
> > >   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> > > reverse
> > > return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> > > *args, **kw
> > > args))
> > >   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> > > reverse
> > > raise NoReverseMatch
> > > NoReverseMatch
> >
> > > Is there a workaround for this issue? Am I doing something
> > > incorrectly? Should I file a ticket?
> > > Graham
> >
>



-- 
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
OpenRPG+ Lead Developer
~~http://openrpg.digitalxero.net
XeroPortal Creator
~~http://www.digitalxero.net
Web Admin for Thewarcouncil.us
~~http://www.thewarcouncil.us

--~--~-~--~~~---~--~~
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: Links to images in Blog posts

2008-02-13 Thread Eric Abrahamsen


> Do you have any idea if it is possible to modifyupload_toin a way  
> that it uses the ID of the the object?

That one gets asked a lot:
http://groups.google.com/group/django-users/browse_thread/thread/7e193c1532920a6f#

eric
--~--~-~--~~~---~--~~
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: OR lookups

2008-02-13 Thread [EMAIL PROTECTED]

@Julien as did I.

On Feb 13, 5:20 am, Julien <[EMAIL PROTECTED]> wrote:
> Maybe a quick mention in the docs saying: "Warning, this might not
> work in such and such case. But it is worked on and should be
> eventually fixed, see the queryset-refactor branch."
>
> I have to say that I spent quite some time trying to find out what was
> wrong with my code, as I fully trusted the docs (and so should we). A
> quick mention like that would have saved me quite some time and
> frustration ;)
>
> On Feb 13, 9:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Wed, 2008-02-13 at 00:27 -0800, [EMAIL PROTECTED] wrote:
> > > Perhaps the current documentation should be updated to reflect that
> > > this is not working. Its quite frustrating to have documentation that
> > > describes something as working when it is not.
>
> > > On Feb 12, 1:20 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > > wrote:
> > > > On Tue, 2008-02-12 at 00:56 -0800, Julien wrote:
> > > > > Thanks a lot for the tips! I think I'll go for the custom merging in
> > > > > Python.
>
> > > > > One stupid question. Is there any estimation as to when queryset-
> > > > > refactor might be merged to trunk? I know it's hard to answer, but
> > > > > should it be more like 1 month, 6 month, 1 year away?  :)
> > > > > The wiki says it's pretty unstable, so I guess it won't happen before
> > > > > a while...
>
> > > > Hopefully pretty soon. We're in the home stretch now and soon I'll be
> > > > asking for volunteers to test it.
>
> > Since the majority of OR lookups work, this isn't worth doing. It's a
> > better use of our time to fix the problems.
>
> > Regards,
> > Malcolm
>
> > --
> > Honk if you love peace and quiet.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
-~--~~~~--~~--~--~---



Releasing django-treemenus: a generic menu application for Django

2008-02-13 Thread Julien

Hi all,

I first meant to announce it on the Django community aggregator, but
Jacob hasn't replied to my request of hooking up my blog to it yet  :)
So I thought I'd post it here instead.

I remember when starting using Django, I was a bit disappointed that
there was no easy-to-use or straight-forward application to build
menus, at least I didn't find any that suited me. Yet, menus are
something that you find on pretty much every website, and I wanted to
fill that gap. So I started making my own app, and made it generic and
open source so it could hopefully benefit other django users.

So here it is, django-treemenus[1], a simple and generic application
that lets you easily build tree-structured menus for your django site.
It contains all (and only) the essentials, and it should be easy for
anyone to extend it to fit their particular needs. You can define your
own templates, and there's a user-friendly admin interface to manage
the structure of your menus.

All the code and documentation are available at google code [1].

Have a go, and please let me know about potential issues or bugs,
either here, on my blog[2] or on the google code issue tracking
system.

All the best,

Julien

[1] http://code.google.com/p/django-treemenus/
[2] http://www.creativityandcognition.com/blogs/julien/?cat=5
--~--~-~--~~~---~--~~
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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread grahamu

Thanks for your explanation, Alex.
Unfortunately, "reverse('views.func')" always returns the first match
for that function in urlpatterns.

My objective is to distinguish between two different URL patterns
which both resolve to the same view function.
Given your suggestion, I tried the following:

   >>> reverse('views.func', kwargs={'myname':'drink'})
   >>> '/drink/'
   >>> reverse('views.func', kwargs={'myname':'exercise'})
   >>> '/drink/'
   >>> reverse('views.func', kwargs={'myname':'eat'})
   >>> '/drink/'
   >>> reverse('views.func', kwargs={'myname':'sleep'})
   >>> '/drink/'

So that solution does not work because the resolver apparently ignores
the kwargs when presented with a function instead of a named URL.


On Feb 13, 4:34 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Hi, graham
>
> Imagine that your urls2.py has some number of patterns. And then you
> call `reverse('eat')` what of them have to be returned? So to get
> proper result you have to write something like this
> `reverse('views.func')`
>
> On 14 фев, 02:22, grahamu <[EMAIL PROTECTED]> wrote:
>
> > Lots of people correctly suggest using named url patterns and the {%
> > url %} template tag to obtain a URL. The concept is great and follows
> > the DRY principle. However, I believe that if a pattern has an
> > "include()" instead of a view function, the existing
> > mechanism fails. An example of the problem, using three files in a
> > standard Django project:
>
> > --file views.py--
> > def func:
> > pass
> > --end file--
>
> > --file urls.py--
> > from django.conf.urls.defaults import *
> > from views import func
> > urlpatterns = patterns('',
> > (r'^drink/', 'views.func', {'myname':'drink'}, 'drink'),
> > (r'^eat/', include('urls2'), {'myname':'eat'}, 'eat'),
> > url(r'^exercise/', func, kwargs={'myname':'exercise'},
> > name='exercise'),
> > url(r'^sleep/', include('urls2'), kwargs={'myname':'sleep'},
> > name='sleep'),
> > )
> > --end file--
>
> > --file urls2.py--
> > from django.conf.urls.defaults import *
> > urlpatterns = patterns('',
> > (r'^$', 'views.func'),
> > )
> > --end file--
>
> > Invoking "manage.py shell", these are the results of calling reverse()
> > (which I understand from the documentation works very much the same as
> > {% url %}:
>
> > >>> from django.core.urlresolvers import reverse
> > >>> reverse('drink')
> > '/drink/'
> > >>> reverse('eat')
>
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> >   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> > reverse
> > return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> > *args, **kw
> > args))
> >   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> > reverse
> > raise NoReverseMatch
> > NoReverseMatch>>> reverse('exercise')
> > '/exercise/'
> > >>> reverse('sleep')
>
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> >   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> > reverse
> > return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> > *args, **kw
> > args))
> >   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> > reverse
> > raise NoReverseMatch
> > NoReverseMatch
>
> > Is there a workaround for this issue? Am I doing something
> > incorrectly? Should I file a ticket?
> > 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
-~--~~~~--~~--~--~---



Re: What are the advantages of using Django for building things like blogs and CMS?

2008-02-13 Thread Doug B

> Basically I'm looking for some users to placate my fear that I'll run
> into insurmountable problems down the road and I'll end up kicking
> myself for not going with a CMS or blog system because the problems
> could have been trivially addressed with those systems.

It all depends on your needs, if they can all be provided out of the
box by a cms and a few plugins than I don't see any big advantage to
doing in yourself with django or any other framework.  On the other
hand if you do need more than they can easily provide Django is a
great alternative.  It's not a kitchen sink type framework though, so
you may have to hunt several places to solutions for some of the
common tasks.

A few of good ones:

www.djangosnippets.org (awesome site, 10x more so if there were a
search or you could browse tags by first letter rather than next,
next, next...)

http://www.b-list.org/weblog/categories/django/

http://code.djangoproject.com/wiki/DjangoResources  (I used django for
months and reinvented a wheel or two before finding this page. I guess
I'm blind)

Having spent the last few days making a wordpress plugin to integrate
with our django powered site I'm reminded how much nicer to deal with
python is than php.  That alone is a big 'feature' django has over
Wordpress and Joomla.   I've never regretted choosing Django.

--~--~-~--~~~---~--~~
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: What are the advantages of using Django for building things like blogs and CMS?

2008-02-13 Thread [EMAIL PROTECTED]

Well for one thing you get the built in admin!  Also for your specific
problem you mentioned you would go download comment-utils by James
Bennet.

On Feb 13, 5:57 pm, fyleow <[EMAIL PROTECTED]> wrote:
> I have been reading a lot about Django and created some test websites
> but nothing serious yet. I really like it and have been considering
> using it to create my own website which would probably include some
> sort of blog and various other CMS type functionality.
>
> I think it would be a great way to learn Django but I'm worried that
> if the project starts to grow in size I might be better off just using
> an existing CMS framework such as Drupal and Joomla! which have a lot
> of modules and plugins to add functionality.
>
> For example let's say I'm using Django to create a blog. I add a
> feature that allows users to comment on my posts but I later find that
> there are a lot of spam problems. If I had used a pre existing system
> such as WordPress I could probably find a plugin that deals with
> comment spam.
>
> How would I deal with the problem had I built a blog with Django? Sure
> I could create my own spam filter but that doesn't seem to be a
> trivial task. A bunch of little problems like these will spawn off
> many side projects which distracts from the main project.
>
> I guess I'm trying to get some experiences from those of you who have
> created sites with Django and how you've dealt with these issues. For
> example with the spam problem I described maybe there are some pre
> existing Python libraries that make dealing with the problem easier.
>
> Basically I'm looking for some users to placate my fear that I'll run
> into insurmountable problems down the road and I'll end up kicking
> myself for not going with a CMS or blog system because the problems
> could have been trivially addressed with those systems.
--~--~-~--~~~---~--~~
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: TemplateDoesNotExist for django-registration (but it does)

2008-02-13 Thread jonathan . lukens

Hi Karen,

Thanks, that is what the problem was.  Doh.

Jonathan

On Feb 13, 7:11 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Feb 13, 2008 6:04 PM, <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Trying to get django-registration up and running, and I bumped into
> > this error:
>
> > TemplateDoesNotExist at /accounts/register/
> > registration/registration_form.html
>
> > BUT: below, I can see that Django actually found the template, which I
> > created and placed in the place specified by the documentation:
>
> > Django tried loading these templates, in this order:
>
> >* Using loader
> > django.template.loaders.filesystem.load_template_source:
> >  o /home/jonathan/dev/django_projects/termworm/templates/
> > registration/registration_form.html (File exists)
> >* Using loader
> > django.template.loaders.app_directories.load_template_source:
> >  o /home/jonathan/django_trunk/django/contrib/admin/templates/
> > registration/registration_form.html (File does not exist)
>
> Does the process attempting to load the template (apache?) have permission
> to read that file?  I believe when it says "(File exists)" but still fails
> to load it, the normal cause is that permissions don't allow reading.
>
> 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: TemplateDoesNotExist for django-registration (but it does)

2008-02-13 Thread Karen Tracey
On Feb 13, 2008 6:04 PM, <[EMAIL PROTECTED]> wrote:

>
> Trying to get django-registration up and running, and I bumped into
> this error:
>
> TemplateDoesNotExist at /accounts/register/
> registration/registration_form.html
>
> BUT: below, I can see that Django actually found the template, which I
> created and placed in the place specified by the documentation:
>
> Django tried loading these templates, in this order:
>
>* Using loader
> django.template.loaders.filesystem.load_template_source:
>  o /home/jonathan/dev/django_projects/termworm/templates/
> registration/registration_form.html (File exists)
>* Using loader
> django.template.loaders.app_directories.load_template_source:
>  o /home/jonathan/django_trunk/django/contrib/admin/templates/
> registration/registration_form.html (File does not exist)
>

Does the process attempting to load the template (apache?) have permission
to read that file?  I believe when it says "(File exists)" but still fails
to load it, the normal cause is that permissions don't allow reading.

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
-~--~~~~--~~--~--~---



What are the advantages of using Django for building things like blogs and CMS?

2008-02-13 Thread fyleow

I have been reading a lot about Django and created some test websites
but nothing serious yet. I really like it and have been considering
using it to create my own website which would probably include some
sort of blog and various other CMS type functionality.

I think it would be a great way to learn Django but I'm worried that
if the project starts to grow in size I might be better off just using
an existing CMS framework such as Drupal and Joomla! which have a lot
of modules and plugins to add functionality.

For example let's say I'm using Django to create a blog. I add a
feature that allows users to comment on my posts but I later find that
there are a lot of spam problems. If I had used a pre existing system
such as WordPress I could probably find a plugin that deals with
comment spam.

How would I deal with the problem had I built a blog with Django? Sure
I could create my own spam filter but that doesn't seem to be a
trivial task. A bunch of little problems like these will spawn off
many side projects which distracts from the main project.

I guess I'm trying to get some experiences from those of you who have
created sites with Django and how you've dealt with these issues. For
example with the spam problem I described maybe there are some pre
existing Python libraries that make dealing with the problem easier.

Basically I'm looking for some users to placate my fear that I'll run
into insurmountable problems down the road and I'll end up kicking
myself for not going with a CMS or blog system because the problems
could have been trivially addressed with those systems.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[OT][ANN] Nanoki

2008-02-13 Thread Petite Abeille

[Not even remotely related to Django, Python or anything]

Nanoki, a sweet little wiki engine implemented in Lua [1].

http://alt.textdrive.com/nanoki/

Online demo:

http://svr225.stepx.com:3388/nanoki

Kind regards,

PA.

[1] http://www.lua.org/about.html

--~--~-~--~~~---~--~~
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: Upgrade to 0.96.1

2008-02-13 Thread Russell Keith-Magee

On Feb 14, 2008 8:03 AM, Robert Swerdlow <[EMAIL PROTECTED]> wrote:
>
> We are currently using 0.96 and want to upgrade to 0.96.1, but it is
> not clear if it is backward compatible.
>
> For example, does 0.96.1 have the newforms change from clean_data to
> cleaned_data?  Which changes are in 0.96.1 and which are later?
>
> Bottom line: what changes do we need to worry about now and which later?

Django point releases are made purely to correct critical security
patches, not to include new features.

0.96.1 contains _none_ of the changes between 0.96 and trunk, with the
exception of a single critical security fix. There should be _no_
backwards compatibility issues upgrading from 0.96 to 0.96.1.

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: reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread Alex Koshelev

Hi, graham

Imagine that your urls2.py has some number of patterns. And then you
call `reverse('eat')` what of them have to be returned? So to get
proper result you have to write something like this
`reverse('views.func')`

On 14 фев, 02:22, grahamu <[EMAIL PROTECTED]> wrote:
> Lots of people correctly suggest using named url patterns and the {%
> url %} template tag to obtain a URL. The concept is great and follows
> the DRY principle. However, I believe that if a pattern has an
> "include()" instead of a view function, the existing
> mechanism fails. An example of the problem, using three files in a
> standard Django project:
>
> --file views.py--
> def func:
> pass
> --end file--
>
> --file urls.py--
> from django.conf.urls.defaults import *
> from views import func
> urlpatterns = patterns('',
> (r'^drink/', 'views.func', {'myname':'drink'}, 'drink'),
> (r'^eat/', include('urls2'), {'myname':'eat'}, 'eat'),
> url(r'^exercise/', func, kwargs={'myname':'exercise'},
> name='exercise'),
> url(r'^sleep/', include('urls2'), kwargs={'myname':'sleep'},
> name='sleep'),
> )
> --end file--
>
> --file urls2.py--
> from django.conf.urls.defaults import *
> urlpatterns = patterns('',
> (r'^$', 'views.func'),
> )
> --end file--
>
> Invoking "manage.py shell", these are the results of calling reverse()
> (which I understand from the documentation works very much the same as
> {% url %}:
>
> >>> from django.core.urlresolvers import reverse
> >>> reverse('drink')
> '/drink/'
> >>> reverse('eat')
>
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> reverse
> return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> *args, **kw
> args))
>   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> reverse
> raise NoReverseMatch
> NoReverseMatch>>> reverse('exercise')
> '/exercise/'
> >>> reverse('sleep')
>
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
> reverse
> return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> *args, **kw
> args))
>   File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
> reverse
> raise NoReverseMatch
> NoReverseMatch
>
> Is there a workaround for this issue? Am I doing something
> incorrectly? Should I file a ticket?
> 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
-~--~~~~--~~--~--~---



Re: create user, using generic.auth

2008-02-13 Thread dall

Hmm, I was think so, but not sure, thanks!

On Feb 13, 10:28 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> Before saving the user you can add all your information after you call
> the function. So:
> new_user = User.objects.create_user(user name, email, password)
> new_user.first_name = 'john'
> new_user.last_name = 'doe'
> new_user.save()
>
> Note the user isn't actually created until you make the save call. If
> you want birthday you should look into the get_profile() function and
> a great article by James Bennett on Extending the user 
> model:http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m...
>
> Here is a link to the docs that can be 
> helpful:http://www.djangoproject.com/documentation/authentication/
>
> Hope that helps, Michael Newman
>
> On Feb 13, 3:17 pm, dall <[EMAIL PROTECTED]> wrote:
>
> > Why in User.objects.create_user(user name, email, password)
>
> > I can`t add more data, like birthday, last name, first name ?
>
> > Or how to do 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
-~--~~~~--~~--~--~---



reverse( ) and template tag 'url' fail when pattern has include

2008-02-13 Thread grahamu

Lots of people correctly suggest using named url patterns and the {%
url %} template tag to obtain a URL. The concept is great and follows
the DRY principle. However, I believe that if a pattern has an
"include()" instead of a view function, the existing
mechanism fails. An example of the problem, using three files in a
standard Django project:

--file views.py--
def func:
pass
--end file--

--file urls.py--
from django.conf.urls.defaults import *
from views import func
urlpatterns = patterns('',
(r'^drink/', 'views.func', {'myname':'drink'}, 'drink'),
(r'^eat/', include('urls2'), {'myname':'eat'}, 'eat'),
url(r'^exercise/', func, kwargs={'myname':'exercise'},
name='exercise'),
url(r'^sleep/', include('urls2'), kwargs={'myname':'sleep'},
name='sleep'),
)
--end file--

--file urls2.py--
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^$', 'views.func'),
)
--end file--

Invoking "manage.py shell", these are the results of calling reverse()
(which I understand from the documentation works very much the same as
{% url %}:

>>> from django.core.urlresolvers import reverse
>>> reverse('drink')
'/drink/'
>>> reverse('eat')
Traceback (most recent call last):
  File "", line 1, in ?
  File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
reverse
return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
*args, **kw
args))
  File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
reverse
raise NoReverseMatch
NoReverseMatch
>>> reverse('exercise')
'/exercise/'
>>> reverse('sleep')
Traceback (most recent call last):
  File "", line 1, in ?
  File "c:\django\trunk\django\core\urlresolvers.py", line 297, in
reverse
return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
*args, **kw
args))
  File "c:\django\trunk\django\core\urlresolvers.py", line 284, in
reverse
raise NoReverseMatch
NoReverseMatch

Is there a workaround for this issue? Am I doing something
incorrectly? Should I file a ticket?
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
-~--~~~~--~~--~--~---



Re: Xcode as Django IDE

2008-02-13 Thread Ian Holsman

Alex Ezell wrote:
> Textmate works great for me. I use GetBundle
> (http://projects.validcode.net/getbundle) to get the Django bundle
> which does syntax completion and highlighting for Django-specific
> Python files and Django template HTML.
>
>   
Textmate, and a couple of terminal windows for mysql and ipython.
2 monitors helps ;-)

what does 'getbundle' do? I already have django specific templates in 
textmate via the "mateup" script on their site.

--~--~-~--~~~---~--~~
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 with SQLAlchemy?

2008-02-13 Thread Russell Keith-Magee

On Feb 14, 2008 2:21 AM, Michael Hipp <[EMAIL PROTECTED]> wrote:
>
> I've been reading stuff like this:
> http://groups.google.com/group/django-developers/browse_thread/thread/5149e1c60dc65bff/a177bb34cfde1ec7
>
> And a zillion others on a Google search of 'django sqlalchemy'.
>
> What's the status?

For all practical purposes, the 'official' SQLAlchemy branch is dead.
It was proposed, the branch was set up, and then pretty much nothing
happened.

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
-~--~~~~--~~--~--~---



TemplateDoesNotExist for django-registration (but it does)

2008-02-13 Thread jonathan . lukens

Trying to get django-registration up and running, and I bumped into
this error:

TemplateDoesNotExist at /accounts/register/
registration/registration_form.html

BUT: below, I can see that Django actually found the template, which I
created and placed in the place specified by the documentation:

Django tried loading these templates, in this order:

* Using loader
django.template.loaders.filesystem.load_template_source:
  o /home/jonathan/dev/django_projects/termworm/templates/
registration/registration_form.html (File exists)
* Using loader
django.template.loaders.app_directories.load_template_source:
  o /home/jonathan/django_trunk/django/contrib/admin/templates/
registration/registration_form.html (File does not exist)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Upgrade to 0.96.1

2008-02-13 Thread Robert Swerdlow

We are currently using 0.96 and want to upgrade to 0.96.1, but it is  
not clear if it is backward compatible.

For example, does 0.96.1 have the newforms change from clean_data to  
cleaned_data?  Which changes are in 0.96.1 and which are later?

Bottom line: what changes do we need to worry about now and which later?

Thanks for your help
- Bob

--~--~-~--~~~---~--~~
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: 'unicode' object has no attribute 'strftime'

2008-02-13 Thread Alex Koshelev

You create string object with bits from form. But you have to make
date object. Example:

from datetime import date
_dob = date( year = form.clean_data['dob_year'],
   month = form.clean_data['dob_month'],
   day = form.clean_data['dob_day']
  )

On 14 фев, 01:48, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> Not quite sure what you mean exactly. This is how that field is
> structured in my models.py file:
>
> birthday = models.DateField(blank=True)
>
> So it's already set as a datefield, but for some reason it seems as
> though my join is converting it into a string and Django doesn't like
> that.
>
> By the way, I am using Django 0.96 and MySQL.
>
> On Feb 13, 10:38 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > If birthday UserProfile field in DataField you must set date object to
> > it. Not string.
>
> > On 14 фев, 00:50, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> > > Hmm I seem to have hit another problem just after another!
>
> > > I've got a form that lets user's select the birthday via three
> > > dropdowns (day, month and year). This is all using newforms.
> > > Basically, within my views.py file I have a function that creates new
> > > users - one part of this process is to make sure the three dropdowns
> > > are joined together to create the timestamp so I can insert into the
> > > database.
>
> > > Here is this join:
>
> > > # join date back together
> > > days =
> > > [form.clean_data['dob_year'],form.clean_data['dob_month'],form.clean_data['
> > >  dob_day']]
> > > _dob = "-".join(days)
>
> > > # save user
> > > user =
> > > User.objects.create_user(username=_username,email=_email,password=_password
> > >  )
> > > user.save()
>
> > > # save custom profile
> > > user_profile =
> > > UserProfile(user_id=user.id,gender=_gender,birthday=_dob,living=_location)
> > > user_profile.save()
>
> > > However - what happens is I get this error:
>
> > > AttributeError at /register/
> > > 'unicode' object has no attribute 'strftime'
>
> > > Now I am sure it is referring to the join I am trying to do. I've
> > > tried wrapping unicode() around it but that didn't help either.
>
> > > Any ideas? I've had a look on here but can't see any solutions.
--~--~-~--~~~---~--~~
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: 'unicode' object has no attribute 'strftime'

2008-02-13 Thread Darthmahon

Hi Alex,

Not quite sure what you mean exactly. This is how that field is
structured in my models.py file:

birthday = models.DateField(blank=True)

So it's already set as a datefield, but for some reason it seems as
though my join is converting it into a string and Django doesn't like
that.

By the way, I am using Django 0.96 and MySQL.

On Feb 13, 10:38 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> If birthday UserProfile field in DataField you must set date object to
> it. Not string.
>
> On 14 фев, 00:50, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> > Hmm I seem to have hit another problem just after another!
>
> > I've got a form that lets user's select the birthday via three
> > dropdowns (day, month and year). This is all using newforms.
> > Basically, within my views.py file I have a function that creates new
> > users - one part of this process is to make sure the three dropdowns
> > are joined together to create the timestamp so I can insert into the
> > database.
>
> > Here is this join:
>
> > # join date back together
> > days =
> > [form.clean_data['dob_year'],form.clean_data['dob_month'],form.clean_data[' 
> > dob_day']]
> > _dob = "-".join(days)
>
> > # save user
> > user =
> > User.objects.create_user(username=_username,email=_email,password=_password 
> > )
> > user.save()
>
> > # save custom profile
> > user_profile =
> > UserProfile(user_id=user.id,gender=_gender,birthday=_dob,living=_location)
> > user_profile.save()
>
> > However - what happens is I get this error:
>
> > AttributeError at /register/
> > 'unicode' object has no attribute 'strftime'
>
> > Now I am sure it is referring to the join I am trying to do. I've
> > tried wrapping unicode() around it but that didn't help either.
>
> > Any ideas? I've had a look on here but can't see any solutions.
--~--~-~--~~~---~--~~
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: 'unicode' object has no attribute 'strftime'

2008-02-13 Thread Alex Koshelev

If birthday UserProfile field in DataField you must set date object to
it. Not string.

On 14 фев, 00:50, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hmm I seem to have hit another problem just after another!
>
> I've got a form that lets user's select the birthday via three
> dropdowns (day, month and year). This is all using newforms.
> Basically, within my views.py file I have a function that creates new
> users - one part of this process is to make sure the three dropdowns
> are joined together to create the timestamp so I can insert into the
> database.
>
> Here is this join:
>
> # join date back together
> days =
> [form.clean_data['dob_year'],form.clean_data['dob_month'],form.clean_data['dob_day']]
> _dob = "-".join(days)
>
> # save user
> user =
> User.objects.create_user(username=_username,email=_email,password=_password)
> user.save()
>
> # save custom profile
> user_profile =
> UserProfile(user_id=user.id,gender=_gender,birthday=_dob,living=_location)
> user_profile.save()
>
> However - what happens is I get this error:
>
> AttributeError at /register/
> 'unicode' object has no attribute 'strftime'
>
> Now I am sure it is referring to the join I am trying to do. I've
> tried wrapping unicode() around it but that didn't help either.
>
> Any ideas? I've had a look on here but can't see any solutions.
--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread James Bennett

On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
> So what do you use?

Emacs inside Terminal.



-- 
"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
-~--~~~~--~~--~--~---



Re: Links to images in Blog posts

2008-02-13 Thread Florian Lindner


Am 13.02.2008 um 15:00 schrieb Michael Newman:

>
> Hi Florian;
>
> You might want to look into a separate object for your images and add
> them as either a manytomanyfield in you story object or have them
> edited inline as foreign key objects. Look at the relationships here:
> http://www.djangoproject.com/documentation/model-api/#relationships .
> You would use manytomany if you would like to reuse images in multiple
> stories and foreign key if you want the authors to upload their images
> on the same page as the story or the images should always be tied to
> one and only one story.

Ok, I'll use a ForeignKey. The probability that one image is used in  
more than one article is too low to make the addition effort sensible.

> I recently had a similar issue with how to give the author the ability
> to place the images in an exact place of a story. Here you have a few
> options. You can have a set place for images like a slideshow, you
> could somehow change an admin field to show the absolute url of the
> image in the display, or you could create a custom form field for you
> story object that uses ajax or just javascript to dynamically place
> text that would be replaced by a manager or while the data is cleaned
> on the admin side to put the image into the story. You could probably
> have a middle class also help with that last option, which would be
> the most flexible and simple, but also the most difficult.

Well, I could just create an custom field e.g. MarkdownField that does  
the transformation markdown <> XHTML and also preprocesses the  
markdown code and replaces relative image URLs with absolute ones. One  
problem that comes to my mind is that in order to replace the URLs the  
markdown field needs access to the objects it is in to determine if  
there are any images. Do you know if this is possible?

> Another way that doesn't involve putting the image in the database is
> by using a textedit kit like YUI's or TinyMCE, which uploads images to
> a directory and puts the code in. Of course you won't get the django
> management features with those images.
>
> Hope that helps get you on your way, This was one of the hardest parts
> for me switching from blog applications like wordpress to Django, but
> once you develop a system it will last forever and be considerably
> more flexible.

Do you have any idea if it is possible to modify upload_to in a way  
that it uses the ID of the the object?

Thanks,

Florian

>
>
> On Feb 13, 4:31 am, Florian Lindner <[EMAIL PROTECTED]> wrote:
>> Hello,
>> this is a repost of an mail I sent some days ago. Since no one  
>> replied
>> and I don't think that noone has an opinion about that I dare to post
>> again.
>>
>> I have some problems about my blog which I would like to hear your
>> opinion about.
>>
>> A user should have the possibility to upload image files in an post
>> (which is represented by a Model). Images can be displayed either
>> seperately from the text or can be embedded in the text.
>> If embedded in the text [1] the user does not know the real URL when
>> uploading an image (because he does not necessarily know the value of
>> MEDIA_ROOT) he can't give the real URL. Therefore I somehow need to
>> preprocess the text and replace the relative URL (which could be just
>> the name of the image) with the complete URL.
>> Is this thought correct so far? Or is there a smarter way to achieve
>> it? How would you do it?
>>
>> The place where images are stored is determined by the value of
>> MEDIA_ROOT and upload_to of the FileField. If I want to upload the
>> pictures to "MEDIA_ROOT/blog/p_id" where p_id is the ID of the blog
>> entry containing the FileField. How would I do that?
>>
>> If I user wants to upload n pictures (n > 1): How can I provide him
>> with multiple FileFields. Just creating a dozens of FileField in my
>> model just in case does not seem the way to go for me. Is there a
>> Django solution for a variable number of fields of the same type?
>> Well, I could make just the FileField a seperat model and use a 1:n
>> relationship. Any other ways?
>>
>> Thanks for all your ideas and comments,
>>
>> Florian
>>
>> [1] like that:
>> ![Alt text here](Image URL here "Image title here")
> >


--~--~-~--~~~---~--~~
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: Xcode as Django IDE

2008-02-13 Thread Alex Ezell

Textmate works great for me. I use GetBundle
(http://projects.validcode.net/getbundle) to get the Django bundle
which does syntax completion and highlighting for Django-specific
Python files and Django template HTML.

More info here: http://code.djangoproject.com/wiki/TextMate

/alex

On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote:
>
> Hi Djangonauts.
>
> I was looking around for a good IDE for the Mac and have tried simple
> text editors like Smultron (http://smultron.sourceforge.net/) and full
> featured IDEs like Eclipse with PyDev but I am still not really
> satisfied.
> Simple text editors lack features like code completition or file tree
> navigation and Eclipse on the other hand is a bit slow on the Mac. So
> what do you use? Is it possible or reasonable to use Xcode (the
> "native" Mac IDE)?
>
> Thomas
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Xcode as Django IDE

2008-02-13 Thread zombat

Hi Djangonauts.

I was looking around for a good IDE for the Mac and have tried simple
text editors like Smultron (http://smultron.sourceforge.net/) and full
featured IDEs like Eclipse with PyDev but I am still not really
satisfied.
Simple text editors lack features like code completition or file tree
navigation and Eclipse on the other hand is a bit slow on the Mac. So
what do you use? Is it possible or reasonable to use Xcode (the
"native" Mac IDE)?

Thomas
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Book clarifications Post here

2008-02-13 Thread [EMAIL PROTECTED]

Hi guys and gals I wanted to post something here where as you have
gone through the book things have not been as clear as you had hoped
and wanted to offer some insight to people getting tripped up.  Also
hopefully they will make these changes.

Ill start it off: http://www.djangoproject.com/documentation/0.96/tutorial02/

The bit about uncommenting the line for admin please be more specific
and actually tell people to put it under the urlpatterns as dumb as it
may sound I spent 10 minutes trying to figure out what I was doing
wrong.

Alright feel free to post anything else you find along the way even if
most would think it is pointless much like what I posted.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'unicode' object has no attribute 'strftime'

2008-02-13 Thread Darthmahon

Hmm I seem to have hit another problem just after another!

I've got a form that lets user's select the birthday via three
dropdowns (day, month and year). This is all using newforms.
Basically, within my views.py file I have a function that creates new
users - one part of this process is to make sure the three dropdowns
are joined together to create the timestamp so I can insert into the
database.

Here is this join:

# join date back together
days =
[form.clean_data['dob_year'],form.clean_data['dob_month'],form.clean_data['dob_day']]
_dob = "-".join(days)

# save user
user =
User.objects.create_user(username=_username,email=_email,password=_password)
user.save()

# save custom profile
user_profile =
UserProfile(user_id=user.id,gender=_gender,birthday=_dob,living=_location)
user_profile.save()

However - what happens is I get this error:

AttributeError at /register/
'unicode' object has no attribute 'strftime'

Now I am sure it is referring to the join I am trying to do. I've
tried wrapping unicode() around it but that didn't help either.

Any ideas? I've had a look on here but can't see any solutions.
--~--~-~--~~~---~--~~
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: Setting request.GET when sending an HttpResponse

2008-02-13 Thread Etienne Robillard
I'll try to help ya a little...


> I receive a request via GET and, based on request.GET, I generare a
> result and send a HttpResponse. However, when sending the response,
> I'd like to set additional parameters in the query string.
>
> For example, suppose I receive the following request:
>
>  http://domain.com/myurl/myform/?query=whatever


I believe you got this wrong a little. A HttpResponse object doesn't modify
the query string. That should be done in your form markup,
or even in a javascript file, in case you want to do it programmatically.


> Then, my form will query the database, build the result set and send a
> initial HTTP response. Then the user will (for example) toggle a
> "order by" option. Now, what I would like is to return a HttpResponse
> but ALSO, extend the query string, for example
>
>  http://domain.com/myurl/myform/?query=whatever&orderby=foo
>
> so that on the next request.GET I find the new "orderby" parameter.


Nothing prevent's you to use another view which could then handle
this new POSTed parameter.


>
> This seems a tremendously common and simple problem. However, I'm not
> finding a way to solve it. If I use a HttpResponseRedirect instead of
> an HttpResponse, what I get is a "Found a cyclic link" problem.
>
> Any suggestion?


I suggest you read:
http://www.djangoproject.com/documentation/request_response/

Regards,
Etienne

--~--~-~--~~~---~--~~
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: Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Darthmahon

Hi Julian,

Good thinking - None didn't work but this did:

('','Month',)
(1,'January',)


Thanks! :)

On Feb 13, 8:58 pm, Julien <[EMAIL PROTECTED]> wrote:
> I can't test it myself at the moment, but maybe try setting a None
> value for 'Month':
>
> MONTH_CHOICES=(
>                 (None,'Month',),
>                 (1,'January'),
>                 
>
> On Feb 14, 7:24 am, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I'm using the newforms functionality to create my forms - so the
> > structure is something like this:
>
> > /
> > FORMS.PY
> > /
>
> > class RegisterForm(forms.Form):
>
> >         MONTH_CHOICES=(
> >                 (0,'Month',),
> >                 (1,'January'),
> >                 (2,'February'),
> >                 (3,'March'),
> >                 (4,'April'),
> >                 (5,'May'),
> >                 (6,'June'),
> >                 (7,'July'),
> >                 (8,'August'),
> >                 (9,'September'),
> >                 (10,'October'),
> >                 (11,'November'),
> >                 (12,'December')
> >         )
>
> > dob_month = forms.ChoiceField(choices=MONTH_CHOICES)
>
> > /
> > VIEWS.PY
> > /
>
> > form = RegisterForm(request.POST)
>
> > if form.is_valid():
> >         return done(request)
> > else:
> >         form = RegisterForm()
>
> > /
> > TEMPLATE
> > /
>
> > When is your birthday?
> > {{ form.dob_month }}
>
> > I don't want a user to be able to select the first option (0, Month)
> > but can't figure out how to tell Django that selecting that option is
> > not valid. I can't see a way around this without manually creating the
> > select myself but then I have to do all my own custom validation and
> > it means newforms becomes a bit useless.
>
> > Any ideas? I've seen something about "invalid_choice" but can't find
> > any details on how to use this - hoping someone may have experienced
> > this problem also.
--~--~-~--~~~---~--~~
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: limiting users to one session at a time

2008-02-13 Thread Michael Graz
Thanks for the idea I will give it a try.
Regards

On Feb 10, 2008 11:37 AM, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:

>
>
> On Sun, 2008-02-10 at 11:00 +, Michael Graz wrote:
> > Greetings.  Would like to be able to prevent a user from having two
> > concurrent, active sessions.  For example want to prevent two sessions
> > for a specific login from two different machines or browsers.  I don't
> > see an easy way to deactivate or delete existing sessions for a user
> > upon login, which would seem to be all that is necessary.
> >
> > The django_session object does not have reference to an auth_user.  I
> > could add that so upon login an sql delete could be run against all
> > sessions for a user other than current session.
>
> That's probably the most reasonable sort of approach. Although you don't
> need to change the Session object at all. Make your own model that links
> a session to a user and use that to control things. Hook into the
> post_save signal for the Session object, check if the "created" flag in
> the signal call is True and use that to trigger your search-and-destroy
> mission.
>
> Regards,
> Malcolm
>
> --
> Telepath required. You know where to apply...
> 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: static content permissions

2008-02-13 Thread jonathan . lukens

Hi Michael,

This is actually just about what I had in my httpd.conf, but for some
reason looking at it shook loose the wax in my brain and I realized I
had a broken symlink... so thank you for the help!
Programming is not my day job (as is evident), but I have a project
that i want to get online and so I took an entire week off to work on
it -- so far, three days spent mostly beating my skull against the
wall over stuff like this

On Feb 13, 3:23 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> Hey Jonathan;
>
> You are going to love that setup (I know I do).
>
> Django actually is never aware of media files. It just lets apache
> serve them. To set this up in your apache site configuration you
> should have DocumentRoot set and then for the path of you media file
> have a Location entry with SetHandler None in there. Then put all your
> media in the media directory and apache serves it just like normal.
>
> For example on my ubuntu box I have /etc/apache2/sites-enabled/site
> looking like this:
>
> 
> ServerName foo
> ServerAlias foo.com
> ServerAdmin [EMAIL PROTECTED]
> DocumentRoot /var/www/vhosts/foo.com/
>
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE bar.settings
> PythonDebug On
> PythonInterpreter bar
> PythonPath "['/opt/django']+sys.path"
> 
>
> 
> SetHandler None
> 
>
> 
> SetHandler None
> 
> 
>
> On Feb 13, 2:31 pm, [EMAIL PROTECTED] wrote:
>
> > Forgive my idiocy,
>
> > I have just installed Ubuntu + Apache 2.2 + MySQL + mod_python +
> > django on an old machine and am using it for development.  I am having
> > difficulty getting my stylesheets to render.  If I'm not using the
> > *bad* way of serving the static content, do I still need a view to
> > process the url?  If so, what should it look like?
>
> > Thank you,
> > Jonathan
--~--~-~--~~~---~--~~
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: template UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in position 1393: unexpected code byte

2008-02-13 Thread Steve

Thanks for all the quick replies, fixed it with © and I'm looking
into the utf-8 encoding.
Steve

On Feb 14, 12:56 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Steve napisał(a):
>
> > UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in
> > position 1393: unexpected code byte
> > The string that could not be encoded/decoded was: ight ? 2006
>
> > The part of the static template it is complaining about is the (c)
> > character:
>
> > Copyright (c) 2006-2008 .. 
>
> > How do I get the (c) character translated correctly?
>
> Use character entity © (apply the same to ®, ™ etc.).
>
> --
> Jarek Zgoda
> Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101
>
> "We read Knuth so you don't have to." (Tim Peters)
--~--~-~--~~~---~--~~
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: Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Julien

I can't test it myself at the moment, but maybe try setting a None
value for 'Month':

MONTH_CHOICES=(
(None,'Month',),
(1,'January'),



On Feb 14, 7:24 am, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I'm using the newforms functionality to create my forms - so the
> structure is something like this:
>
> /
> FORMS.PY
> /
>
> class RegisterForm(forms.Form):
>
> MONTH_CHOICES=(
> (0,'Month',),
> (1,'January'),
> (2,'February'),
> (3,'March'),
> (4,'April'),
> (5,'May'),
> (6,'June'),
> (7,'July'),
> (8,'August'),
> (9,'September'),
> (10,'October'),
> (11,'November'),
> (12,'December')
> )
>
> dob_month = forms.ChoiceField(choices=MONTH_CHOICES)
>
> /
> VIEWS.PY
> /
>
> form = RegisterForm(request.POST)
>
> if form.is_valid():
> return done(request)
> else:
> form = RegisterForm()
>
> /
> TEMPLATE
> /
>
> When is your birthday?
> {{ form.dob_month }}
>
> I don't want a user to be able to select the first option (0, Month)
> but can't figure out how to tell Django that selecting that option is
> not valid. I can't see a way around this without manually creating the
> select myself but then I have to do all my own custom validation and
> it means newforms becomes a bit useless.
>
> Any ideas? I've seen something about "invalid_choice" but can't find
> any details on how to use this - hoping someone may have experienced
> this problem also.
--~--~-~--~~~---~--~~
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: create user, using generic.auth

2008-02-13 Thread Michael Newman

Before saving the user you can add all your information after you call
the function. So:
new_user = User.objects.create_user(user name, email, password)
new_user.first_name = 'john'
new_user.last_name = 'doe'
new_user.save()

Note the user isn't actually created until you make the save call. If
you want birthday you should look into the get_profile() function and
a great article by James Bennett on Extending the user model:
http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/

Here is a link to the docs that can be helpful:
http://www.djangoproject.com/documentation/authentication/

Hope that helps, Michael Newman

On Feb 13, 3:17 pm, dall <[EMAIL PROTECTED]> wrote:
> Why in User.objects.create_user(user name, email, password)
>
> I can`t add more data, like birthday, last name, first name ?
>
> Or how to do 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
-~--~~~~--~~--~--~---



Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Darthmahon

Hey,

I'm using the newforms functionality to create my forms - so the
structure is something like this:

/
FORMS.PY
/

class RegisterForm(forms.Form):

MONTH_CHOICES=(
(0,'Month',),
(1,'January'),
(2,'February'),
(3,'March'),
(4,'April'),
(5,'May'),
(6,'June'),
(7,'July'),
(8,'August'),
(9,'September'),
(10,'October'),
(11,'November'),
(12,'December')
)

dob_month = forms.ChoiceField(choices=MONTH_CHOICES)

/
VIEWS.PY
/

form = RegisterForm(request.POST)

if form.is_valid():
return done(request)
else:
form = RegisterForm()

/
TEMPLATE
/

When is your birthday?
{{ form.dob_month }}




I don't want a user to be able to select the first option (0, Month)
but can't figure out how to tell Django that selecting that option is
not valid. I can't see a way around this without manually creating the
select myself but then I have to do all my own custom validation and
it means newforms becomes a bit useless.

Any ideas? I've seen something about "invalid_choice" but can't find
any details on how to use this - hoping someone may have experienced
this problem also.
--~--~-~--~~~---~--~~
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: static content permissions

2008-02-13 Thread Michael Newman

Hey Jonathan;

You are going to love that setup (I know I do).

Django actually is never aware of media files. It just lets apache
serve them. To set this up in your apache site configuration you
should have DocumentRoot set and then for the path of you media file
have a Location entry with SetHandler None in there. Then put all your
media in the media directory and apache serves it just like normal.

For example on my ubuntu box I have /etc/apache2/sites-enabled/site
looking like this:


ServerName foo
ServerAlias foo.com
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /var/www/vhosts/foo.com/


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE bar.settings
PythonDebug On
PythonInterpreter bar
PythonPath "['/opt/django']+sys.path"



SetHandler None



SetHandler None




On Feb 13, 2:31 pm, [EMAIL PROTECTED] wrote:
> Forgive my idiocy,
>
> I have just installed Ubuntu + Apache 2.2 + MySQL + mod_python +
> django on an old machine and am using it for development.  I am having
> difficulty getting my stylesheets to render.  If I'm not using the
> *bad* way of serving the static content, do I still need a view to
> process the url?  If so, what should it look like?
>
> Thank you,
> Jonathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



create user, using generic.auth

2008-02-13 Thread dall

Why in User.objects.create_user(user name, email, password)

I can`t add more data, like birthday, last name, first name ?

Or how to do 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: SQL Join

2008-02-13 Thread Nicolas Steinmetz

Gus a écrit :

> any help would be much appreciated

Maybe this thread will help you (my issue was quite similar)


Nicolas


--~--~-~--~~~---~--~~
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: Issue on joining objects/table

2008-02-13 Thread Nicolas Steinmetz

Malcolm Tredinnick a écrit :

So the solution is :

In views.py :

 user_skill = user.userskill_set.all().select_related()
 results = [{'domain': o.name.domain, 'item': o} for o in user_skill]

(exactly as said by Malcolm)

And in the template :

>{% regroup results by domain as domain_list %}
>{% for d in domain_list %}
>{{ d.grouper }}
>   
>  {% for item in d.list %}
>  ...
>  {% endfor %}
>   
>
>{% endfor %}

The only change I made was :

 {% regroup results|dictsort:"domain.name" by domain as domain_list %}

otherwise, regroup was not always correct.

and a small notice, to access values of the list, it is by using 
item.item. : ex : item.item.name

> That looks, to my eye at least, a bit neater than the original solution,
> too. You *might* (completely untested) be able to get away with making
> your results list be:
> 
> results = list(user_skill)
> results.sort(key=lambda x: x.getattr('domain').name))
> 
> and then grouping by "domain.name", but I'm not 100% certain that will
> work.

I did not test this one - I keep it in mind anyway :)

Thanks a lot for your help Malcom !

Nicolas


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



static content permissions

2008-02-13 Thread jonathan . lukens

Forgive my idiocy,

I have just installed Ubuntu + Apache 2.2 + MySQL + mod_python +
django on an old machine and am using it for development.  I am having
difficulty getting my stylesheets to render.  If I'm not using the
*bad* way of serving the static content, do I still need a view to
process the url?  If so, what should it look like?

Thank you,
Jonathan
--~--~-~--~~~---~--~~
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: Problem starting new project

2008-02-13 Thread Mr. Mister

I forgot to mention, I am using official release 0.96.
--~--~-~--~~~---~--~~
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: Tutorial - How to create online games portal in several hours in Django?

2008-02-13 Thread Jeffar

> One minor thing I noticed while goign through tutorial 2 - you
> probably want to make your slug fields indexed and  (unique=True on
> the attribute definition) so as to avoid clashes with your URLs.
Thanks, you're right. I'm not checking uniques but I should. I'll keep
it in mind when doing tutorial update.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem starting new project

2008-02-13 Thread Mr. Mister

Hi, I have had some problms installing Django in Windows XP. I have
finally got it to work, in a fashion. I can go to the command prompt
and type "django-admin.py startproject mysite" I set path variables,
etc so this command is semi-valid. The only problem is that instead
of
creating a 'mysite' folder in the current directory, it displays a
list of possible commands. startproject is one of those commands, but
no matter whatI do, it won't work.

Thanks for all the 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
-~--~~~~--~~--~--~---



Setting request.GET when sending an HttpResponse

2008-02-13 Thread mario

It seems to me that I'm asking something verys obvious. However I
couln't find and example anywhere for solving my problem. Here it
goes...

I receive a request via GET and, based on request.GET, I generare a
result and send a HttpResponse. However, when sending the response,
I'd like to set additional parameters in the query string.

For example, suppose I receive the following request:

  http://domain.com/myurl/myform/?query=whatever

Then, my form will query the database, build the result set and send a
initial HTTP response. Then the user will (for example) toggle a
"order by" option. Now, what I would like is to return a HttpResponse
but ALSO, extend the query string, for example

  http://domain.com/myurl/myform/?query=whatever&orderby=foo

so that on the next request.GET I find the new "orderby" parameter.

This seems a tremendously common and simple problem. However, I'm not
finding a way to solve it. If I use a HttpResponseRedirect instead of
an HttpResponse, what I get is a "Found a cyclic link" problem.

Any suggestion?

Thanks in advance 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
-~--~~~~--~~--~--~---



FloatField Size on Generic Views

2008-02-13 Thread [EMAIL PROTECTED]

Is there a way to set the "size" attribute of FloatFields in Generic
Views? Currently they're pretty big, and it seems like max_digits was
deprecated in FloatFields with the arrival of DecimalFields.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-13 Thread Aaron Watters

Hi.  As previously mentioned, I'd like someone to try
out using Nucular inside Django.

In our last episode someone wanted Nucular to support
Windoze.  Now it does.  Here is the announcement:
== cut =

ANNOUNCE: NUCULAR Fielded Full Text Indexing, BETA 3

Nucular is a system for creating full text
indices for fielded data. It can be accessed
via a Python API or via a suite of command line
interfaces.

NEWS

Nucular now supports WIN32. Current releases
of Nucular abstract the file system in order
to emulate file system feature missing
on NT file systems which prevented older
versions from running correctly on Windows NT
based systems.

Proximity search added: Current versions of
Nucular allow queries to search for a sequence
of words near each other separated by
no more than a specified number of other words.

Faceted suggestions: Nucular queries now
support faceted suggestions for values for
fields which are related to a query.

Faster index builds: Current releases of
Nucular have completely revamped internal
data structures which build indices much faster
(and query a bit faster also). For example some
builds run more than 8 times faster than
previously.

Read more and download at:

   http://nucular.sourceforge.net

ONLINE DEMOS:

Python source search:
 http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=malodorous+parrot
Mondial geographic text search:
 http://www.xfeedme.com/nucular/mondial.py/go?attr_name=ono
Gutenberg book search:
 http://www.xfeedme.com/nucular/gut.py/go?attr_Comments=immoral+english

BACKGROUND:

Nucular is intended to help store and retrieve
searchable information in a manner somewhat similar
to the way that "www.hotjobs.com" stores and
retrieves job descriptions, for example.

Nucular archives fielded documents and retrieves
them based on field value, field prefix, field
word prefix, or full text word prefix,
word proximity or combinations of these.
Nucular also includes features for determining
values related to a query often called query facets.

FEATURES

Nucular is very light weight. Updates and accesses
do not require any server process or other system
support such as shared memory locking.

Nucular supports concurrency. Arbitrary concurrent
updates and accesses by multiple processes or threads
are supported, with no possible locking issues.

Nucular supports document threading in the
manner of USENET replies. Built in semantics allows
"follow ups" to messages to match patterns that
match the "original" messages.

Nucular indexes and retrieves data quickly.

I hope you like.
   -- Aaron Watters

===
It's humbling to think that when Mozart was my age
he'd been dead for 5 years.  -- Tom Lehrer

--~--~-~--~~~---~--~~
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 Success Story

2008-02-13 Thread Jacob Kaplan-Moss

On 2/12/08, Ben <[EMAIL PROTECTED]> wrote:
> If you'd like to read about the recent success of a summer project
> involving Django, read on.

Thanks, Ben!

Jacob

--~--~-~--~~~---~--~~
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 with SQLAlchemy?

2008-02-13 Thread Etienne Robillard
Looks like they have resumed development, and looking forward on using
Elixir.
I guess that's not totally a bad idea... ;)

http://code.google.com/p/django-sqlalchemy/source/browse/trunk/django_sqlalchemy/models/base.py

Regards,
Etienne

On Feb 13, 2008 12:21 PM, Michael Hipp <[EMAIL PROTECTED]> wrote:

>
> I've been reading stuff like this:
>
> http://groups.google.com/group/django-developers/browse_thread/thread/5149e1c60dc65bff/a177bb34cfde1ec7
>
> And a zillion others on a Google search of 'django sqlalchemy'.
>
> What's the status?
>
> Thanks,
> Michael
>
> >
>

--~--~-~--~~~---~--~~
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: Tutorial - How to create online games portal in several hours in Django?

2008-02-13 Thread NickJ

I've just had a skim through the first few tutorials and it looks like
an excellent beginners tutorial, great stuff. I especially like the
demo site running with admin access, so users can see the final
result.

One minor thing I noticed while goign through tutorial 2 - you
probably want to make your slug fields indexed and  (unique=True on
the attribute definition) so as to avoid clashes with your URLs.

On Feb 13, 3:13 pm, Jeffar <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I only want to inform all Django users that just begin this beautiful
> journey, that I created simple toturial describing how to create
> simple online games portal in several hours. It shows many Django
> elements in simple and condensed way. It may not be very interesting
> for Django experts.
>
> The tutorial summary is on my 
> blog:http://jonca.vdl.pl/blog/2008/02/11/online-games-portal-django-summary/
> I also started a demo application onhttp://g4a.jonca.vdl.pl/. More
> info about it is in summary. You can use this demo to convince someone
> to use Django.
>
> Rafał Jońca
--~--~-~--~~~---~--~~
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 make a simple employee attendance management system using Django?

2008-02-13 Thread Tim Chase

> Manual imput (e.g. a form for employee id and password) would 
> not be too hard, just watch out for employees punching their 
> late friends in. Swipe card or biometrics might get a bit more
>  hairy, I know nothing about this but I am pretty sure this 
> could be done. From what I have seen, a lot of the entry-level
>  equipment is geared towards Windows, so setting up an 
> affordable solution on Linux may take some work. Anyone else 
> have insight on this?

most USB card-readers (or PS/2 that get in-lined with your 
keyboard) can be configured to act as a "keyboard wedge", as if 
the user just typed the content of the card.  This usually 
assumes a single-track or two-track card setup.  Similarly, 
bar-codes can be used, with 1-D barcodes just regurgitating the 
contained number, as if typed.

More details at a recent post on the topic:

http://groups.google.com/group/django-users/msg/fb00f650abe523ec

RS-232 serial readers require drivers with a little more smarts 
in order to act as a keyboard wedge.

-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
-~--~~~~--~~--~--~---



Django with SQLAlchemy?

2008-02-13 Thread Michael Hipp

I've been reading stuff like this:
http://groups.google.com/group/django-developers/browse_thread/thread/5149e1c60dc65bff/a177bb34cfde1ec7

And a zillion others on a Google search of 'django sqlalchemy'.

What's the status?

Thanks,
Michael

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Tutorial - How to create online games portal in several hours in Django?

2008-02-13 Thread Jeffar

Hello,

I only want to inform all Django users that just begin this beautiful
journey, that I created simple toturial describing how to create
simple online games portal in several hours. It shows many Django
elements in simple and condensed way. It may not be very interesting
for Django experts.

The tutorial summary is on my blog:
http://jonca.vdl.pl/blog/2008/02/11/online-games-portal-django-summary/
I also started a demo application on http://g4a.jonca.vdl.pl/. More
info about it is in summary. You can use this demo to convince someone
to use Django.

Rafał Jońca


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



سكس سعودي سكس سعودي سكس سعودي سكس سكس SEX SEX sex sex سكس سكس SEX SEX sex sex سكس سعودي سكس سعودي سكس سعودي سكس سكس SEX SEX sex sex سكس سكس SEX SEX sex sex

2008-02-13 Thread سميره
سكس سعودي سكس سعودي سكس سعودي  سكس سكس  SEX SEX sex sex  سكس سكس  SEX
SEX sex sex
http://www.66rb.net
فتاه تبحث عن سكس
http://www.forex.zw2j.com
http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
فتاه تبحث عن شاب
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.66rb.net/
فتاه تبحث عن فتاه
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن شاب
http://www.groups-goole.l7n6rb.com/sex-free.html


http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
SEX SEX sex sex سكس سكس  SEX SEX sex sex
فتاه تبحث عن شاب
http://www.66rb.net/


 عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


   عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربيعاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعودياتعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


خليجي الفنانات عاريات الجمالعاريه احلى
سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتيعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعوديعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربيعاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتيعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة

سكس سكس  SEX SEX sex sex
http://www.66rb.net
فتاه تبحث عن سكس
http://www.forex.zw2j.com
http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
فتاه تبحث عن شاب
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.66rb.net/
فتاه تبحث عن فتاه
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن شاب
http://www.groups-goole.l7n6rb.com/sex-free.html


http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
SEX SEX sex sex سكس سكس  SEX SEX sex sex
فتاه تبحث عن شاب
http://www.66rb.net/


 عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا ا

سكس سعودي سكس سعودي سكس سعودي سكس سكس SEX SEX sex sex سكس سكس SEX SEX sex sex سكس سعودي سكس سعودي سكس سعودي سكس سكس SEX SEX sex sex سكس سكس SEX SEX sex sex

2008-02-13 Thread سميره
سكس سعودي سكس سعودي سكس سعودي  سكس سكس  SEX SEX sex sex  سكس سكس  SEX
SEX sex sex
http://www.66rb.net
فتاه تبحث عن سكس
http://www.forex.zw2j.com
http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
فتاه تبحث عن شاب
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.66rb.net/
فتاه تبحث عن فتاه
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن شاب
http://www.groups-goole.l7n6rb.com/sex-free.html


http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
SEX SEX sex sex سكس سكس  SEX SEX sex sex
فتاه تبحث عن شاب
http://www.66rb.net/


 عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


   عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربيعاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعودياتعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


خليجي الفنانات عاريات الجمالعاريه احلى
سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتيعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعوديعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربيعاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة


سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتي
سكس سعودي سكس سعودي سكس سعودي
سكس عرب سكس عربي
سكس خليجي سكس امراتي سكس كويتيعاريه احلى سعودية تعارف
كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا الراقصة

سكس سكس  SEX SEX sex sex
http://www.66rb.net
فتاه تبحث عن سكس
http://www.forex.zw2j.com
http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
فتاه تبحث عن شاب
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.66rb.net/
فتاه تبحث عن فتاه
SEX SEX sex sex سكس سكس  SEX SEX sex sex
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن شاب
http://www.groups-goole.l7n6rb.com/sex-free.html


http://www.66rb.net/e3lan/e3lan.html
http://www.groups-goole.l7n6rb.com/sex-free.html
تعارف جنسي للبالغين
http://www.groups-goole.l7n6rb.com/sex-free.html
شاب يبحث عن فتاه
http://t3arf.zw2j.com/
SEX SEX sex sex سكس سكس  SEX SEX sex sex
فتاه تبحث عن شاب
http://www.66rb.net/


 عاريه احلى سعودية تعارف كويتي
زب
الفنانة سعودي للبنات شباب نساء جنسيه
طيز خليعة عربيات أجمل صورة
فتيات
ملابس سيكس النيك قروب اريد سعوديات
خليجي الفنانات عاريات الجمال
خليجيات
الممثلة الكس فضايح مص اليسا ا

Re: How to make a simple employee attendance management system using Django?

2008-02-13 Thread kevinski

>i have been asked to make a simple application that stores
>the "in-time" and "out-time" of  employees everyday

Manual imput (e.g. a form for employee id and password) would not be
too hard, just watch out for employees punching their late friends in.
Swipe card or biometrics might get a bit more hairy, I know nothing
about this but I am pretty sure this could be done. From what I have
seen, a lot of the entry-level equipment is geared towards Windows, so
setting up an affordable solution on Linux may take some work. Anyone
else have insight on this?

>the application should also have the features to show the reports such as
>details of a particular employee, activity during a stated period and
>so on...

Not hard with some mildly complex custom views.
http://www.djangoproject.com/documentation/db-api/ will help you learn
how to write them.
The admin interface will be great for helping managers edit time
entries if employees forget to punch in or out.

>till now i have started working on django and am going through its
>online documentation, its telling me how to built a simple poll
>website. i am a beginner for django and am not able to relate this poll-website
>with my project.

The tutorial will give you a great starting point and teach you the
basic foundation for building an app, however for a project of this
scope you will need to dig deeper. Django has a pretty awesome set of
add in components such as forms, authentication, and built in admin
interface. All of these components put together will save you gobs of
time when developing this sort of app.  I use Django primarily for
business app development and could see Django lending itself very well
to an initiative of this sort.

Good Luck!
Kevin


--~--~-~--~~~---~--~~
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 admin and Django registration

2008-02-13 Thread Michael Newman

I am exploring this further in the morning and I am wondering if the
issue is the fact that django.contrib.auth.views uses the oldform
methods. Could this be what is throwing this error? Is there or are
there plans for converting django.contrib.auth.forms to new forms? If
I spent time doing that would it be time well spent?

On Feb 12, 11:41 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> It took a couple of days, but I finally got all my projects switched
> to new forms admin. It is so powerful. I cannot wait to see wait to
> see what kinds of things I will be ablt to accomplish.
>
> That being said, of course, I need to switch some of the snippets of
> code that I barrowed from people smarter than me. One such person is
> Jame Bennett and django-registration has been an invaluable tool. One
> of the sites I switched uses that code, and I went into models and
> tried my hardest to find and replace all the code that has changed.
>
> The admin works fine database looks good and the shell seems to be in
> order too on the simple tests that I run. I am just having one error
> that I just can't figure out (thus I am still at work at 11:30). Here
> is the error I am getting on any registration page:
> URI:'/registration/registration'
> Location:   '/'
> Directory:  None
> Filename:   '/var/www/vhosts/development/registration'
> PathInfo:   '/registration'
>
> Phase:  'PythonHandler'
> Handler:'django.core.handlers.modpython'
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
> 1537, in HandlerDispatch
> default=default_handler, arg=req, silent=hlist.silent)
>
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
> 1229, in _process_target
> result = _execute_target(config, req, object, arg)
>
>   File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line
> 1128, in _execute_target
> result = object(arg)
>
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 188, in handler
> return ModPythonHandler()(req)
>
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> modpython.py", line 161, in __call__
> response = self.get_response(request)
>
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 64, in get_response
> response = middleware_method(request)
>
>   File "/usr/lib/python2.5/site-packages/django/middleware/common.py",
> line 57, in process_request
> urlresolvers.resolve(request.path)
>
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 292, in resolve
> return get_resolver(urlconf).resolve(path)
>
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 233, in resolve
> sub_match = pattern.resolve(new_path)
>
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 231, in resolve
> for pattern in self.urlconf_module.urlpatterns:
>
>   File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py",
> line 255, in _get_urlconf_module
> raise ImproperlyConfigured, "Error while importing URLconf %r: %s"
> % (self.urlconf_name, e)
>
> ImproperlyConfigured: Error while importing URLconf
> 'registration.urls': cannot import name UserCreationForm
>
> Any one who has any insight as to what this error means or experience
> with django-registration in newforms admin and would care to share it,
> I would be very grateful. I found this 
> tickethttp://code.djangoproject.com/ticket/6572
> , but I assume it is my code and not a bug. Thanks in advance.
>
> Michael Newman
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Paginator confuse

2008-02-13 Thread Henhiskan

Hi fellows,
Am very confused about the paginator implementation.
I am using 0.95 version and I implemented a generic view using
list_detail.object_list and works
very good. Basically that I have is :
url.py:
requests_list = {
'queryset' :  Request.objects.all(),
'template_name': 'admin/req_list.html',
'paginate_by' : 1,
}
urlpatterns = patterns('',
   (r'^admin/req_list/$', list_detail.object_list,
requests_list),
   )
Doing that,  in the template I call for {% object_list %} to get the
objects.
Also I had notice the has_previous, has_next, pages vars that can be
useful. But the thing
is that am trying to do a Paginator Tag (the same that is used in
admin view), to do that I should use something like: {% for page_num
in pages_numbers %} , and the pages_numbers should be come from
range(pages) and generic view doesn't implement :(

I hear that you can get page_number doing a hack on the generic view,
but I don't want to do that.
And I found an implementation_   http://code.djangoproject.com/wiki/PaginatorTag
and
then I found another with some enhancements  
http://www.djangosnippets.org/snippets/73/
But in both codes I don't see the object that had been returned to the
view, only the pages information.

So the questions, how is the correct way to implement paginator in
0.96?
Those codes can works by itself, or they need that a generic view
(object_list) be implemented too?
 After extending the template, I need to do a change on settings.py
and url.py or is just called from some view with render_to_response ?


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: filter fields that have a value

2008-02-13 Thread Martin

that didn't work too, because it selects only those articles, that
have the first video (video in model Video, with id=1) attached. i
have figured it out that i have to use dictinct().. now it works like
it's supposed to work ;)

thanks anyway,
enjoy


martin

On Feb 13, 3:13 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> The problem is you are filtering the video attribute of your articles
> and thus returning 3. Try Article.objects.filter(video=True) I think
> that should work.
>

--~--~-~--~~~---~--~~
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: Weird caching issue

2008-02-13 Thread [EMAIL PROTECTED]

Django version is .96, but I'm not sure about the exact build. I know
maxlength is still max_length in the build I'm using, if that helps. I
know there's some way to check the exact build, but I don't know how.

What I've got going is a legacy php site that's drawing the latest
forum posts over via curl. Up until today, it was picking up the forum
feed, but today I wrote a simple view and template (which gave me some
extra flexibility anyway, and the php on the other end doesn't have to
parse the RSS, so that's a couple of advantages).

Here's the view:
def latest_snippet(request):
topics = Topic.objects.all().order_by('-topic_modification_date')
[0:5]
for i in topics:
posts = i.topic_posts
i.pagination_max = (posts/20)+1
if posts%20 == 0:
i.pagination_max = posts/20
for post in i.post_set.all()[0:1]:
i.fpost = post
return render_to_response('forum/snippet.html', {
'topics': topics,
})

Yes, I know... it's not very good code. I'm not a very good coder --
but I'm working on it.

Template is nothing special. Just builds an unordered list from
topics.

The php on the other end is nothing special either. It just grabs the
snippet the template creates and pulls it over.
http://classicmotorsports.net/forum/snippet/';
 if( function_exists('curl_init') ) { // CURL is available
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$feed);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$rdata = curl_exec ($ch);
 } elseif( function_exists('file_get_contents') ) {
 $rdata = file_get_contents($feed);
 }
echo $rdata;
?>

The caching appears to work fine until that external site calls for
that feed. Then it all goes sideways. The site caching itself appears
fine. I'm 98% sure it's somehow related to that external call.

Since it was working off the feed, at first I thought that's where the
problem lie, so I created the new view and template. Either way, with
memcached it just proxy errors, and the external site fails loading
the snippet.

With locmem I got the arcane error I posted on the group.
I've been looking at never_cache, and just not worrying about caching
that one view, but haven't figured out how to implement it.

Using CACHE_BACKEND = 'file:///home/grmadmin/webapps/django/classic/
cache'

I don't get an error. So maybe it's somehow based on memory caching?


--~--~-~--~~~---~--~~
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: filter fields that have a value

2008-02-13 Thread Michael Newman

The problem is you are filtering the video attribute of your articles
and thus returning 3. Try Article.objects.filter(video=True) I think
that should work.

On Feb 13, 7:04 am, Martin <[EMAIL PROTECTED]> wrote:
> hello,
>
> i'm struggling with ManyToMany fields (Rajesh helped me a lot;) and
> have another question. My model Article, has ManyToMany relation with
> Video model (for storing only youtube videos).
>
> class Article(models.Model):
> video = models.ManyToManyField(Video, blank=True, null=True)
>
> class Video(models.Model):
> url = models.CharField(max_length=300)
> name = models.CharField(max_length=300)
>
> Then i add 3 videos to an Article. Since not all articles have videos,
> i want to filter out those that have it.
> Filter looks like this:
>
> Article.objects.filter(video__isnull=False)
>
> So here is the problem.. let's say i have 5 articles in my DB and only
> one has 3 videos.. this filter doesn't return an article that has
> videos, but rather returns 3x the same article name.. probably,
> because of 3 added videos to it.
> so my question here is: is this the right way to check, if article has
> videos (Article.objects.filter(video__isnull=False))? if this the
> right way, what is (should i add costum method in my model)?
>
> I would appreciate any help,
>
> Martin
--~--~-~--~~~---~--~~
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: Links to images in Blog posts

2008-02-13 Thread Michael Newman

Hi Florian;

You might want to look into a separate object for your images and add
them as either a manytomanyfield in you story object or have them
edited inline as foreign key objects. Look at the relationships here:
http://www.djangoproject.com/documentation/model-api/#relationships .
You would use manytomany if you would like to reuse images in multiple
stories and foreign key if you want the authors to upload their images
on the same page as the story or the images should always be tied to
one and only one story.

I recently had a similar issue with how to give the author the ability
to place the images in an exact place of a story. Here you have a few
options. You can have a set place for images like a slideshow, you
could somehow change an admin field to show the absolute url of the
image in the display, or you could create a custom form field for you
story object that uses ajax or just javascript to dynamically place
text that would be replaced by a manager or while the data is cleaned
on the admin side to put the image into the story. You could probably
have a middle class also help with that last option, which would be
the most flexible and simple, but also the most difficult.

Another way that doesn't involve putting the image in the database is
by using a textedit kit like YUI's or TinyMCE, which uploads images to
a directory and puts the code in. Of course you won't get the django
management features with those images.

Hope that helps get you on your way, This was one of the hardest parts
for me switching from blog applications like wordpress to Django, but
once you develop a system it will last forever and be considerably
more flexible.

Michael Newman

On Feb 13, 4:31 am, Florian Lindner <[EMAIL PROTECTED]> wrote:
> Hello,
> this is a repost of an mail I sent some days ago. Since no one replied
> and I don't think that noone has an opinion about that I dare to post
> again.
>
> I have some problems about my blog which I would like to hear your
> opinion about.
>
> A user should have the possibility to upload image files in an post
> (which is represented by a Model). Images can be displayed either
> seperately from the text or can be embedded in the text.
> If embedded in the text [1] the user does not know the real URL when
> uploading an image (because he does not necessarily know the value of
> MEDIA_ROOT) he can't give the real URL. Therefore I somehow need to
> preprocess the text and replace the relative URL (which could be just
> the name of the image) with the complete URL.
> Is this thought correct so far? Or is there a smarter way to achieve
> it? How would you do it?
>
> The place where images are stored is determined by the value of
> MEDIA_ROOT and upload_to of the FileField. If I want to upload the
> pictures to "MEDIA_ROOT/blog/p_id" where p_id is the ID of the blog
> entry containing the FileField. How would I do that?
>
> If I user wants to upload n pictures (n > 1): How can I provide him
> with multiple FileFields. Just creating a dozens of FileField in my
> model just in case does not seem the way to go for me. Is there a
> Django solution for a variable number of fields of the same type?
> Well, I could make just the FileField a seperat model and use a 1:n
> relationship. Any other ways?
>
> Thanks for all your ideas and comments,
>
> Florian
>
> [1] like that:
> ![Alt text here](Image URL here "Image title here")
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Using the sites-system with a twist - is it possible?

2008-02-13 Thread Johan Liseborn

Hi all,

I am trying to figure out if I can use Django's sites-system in a
small experiment I am conducting. Please bear with me, as I am still
struggling to fully understand the sites-system. I am using the svn
version of Django (currently rev 7106, I believe).

I would like to build a site published on *one* address (e.g.
example.com) where users can register for something like a "master
account" and several "normal accounts" and get their own little
sandbox to handle their data (this would be similar to a site, but it
would not have its own domain name; let's call this a
"pseudo-domain").

The idea, of course, is to handle data for multiple pseudo-domains in
the same database, while still disallowing people from one
pseudo-domain access to the data of another pseudo-domain. This would
be useful for a whole suite of software-as-a-service deployments; e.g.
if I where to offer a service of "Family Accounting" (just a silly
example), a family would setup a master account (the "administrator")
and several normal accounts, and then they could happily start
entering their earnings and spendings, resting assured that no one
outside their pseudo-domain would see their accounting status.

As far as I can tell, the Django site-system relies on the different
sites having different domains, while my requirement seems to indicate
that the "site" (or pseudo-domain) should be decided by the logged in
user rather than the domain name, so I am a bit pessimistic that I can
accomplish what I say above, even though the two use cases seems very
similar data-handling-wise; please tell me I am wrong... :-)

Also, is there a way to play with the sites-system using runserver? It
seems you need to have multiple settings-files (which I guess would be
simple using e.g. Apache and a bunch of virtual hosts), but it seems I
cannot do that with runserver.


Kind Regards,

johan

--~--~-~--~~~---~--~~
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 Admin Page Media Path

2008-02-13 Thread [EMAIL PROTECTED]

thanks, my problem has been solved.

On Feb 13, 2:33 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Feb 13, 2008 8:24 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi Karen:
>
> > it's running on production(0.96).
>
> > and the django project path is:
> > /home/xxd/Desktop/Django-0.96.1/django/bin/project
>
> > I'd like to move the admin page media path from
> > /usr/lib/python2.5/site-packages/django/contrib/admin/media
> > to
> > /home/xxd/Desktop/Django-0.96.1/django/bin/projec/media/admin_media
>
> Running in production under apache/mod_python?  Or something else?
>
>
>
> > so that i tried to use the command
> > python manage.py --adminmedia='/home/xxd/Desktop/Django-0.96.1/django/
> > bin/projec/media/admin_media/'
> > but it does not work.
>
> That command is missing "runserver" before the --adminmedia part.  But
> unless you are running your production site using the development server (
> manage.py runserver), this command isn't going to help you at all.  If you
> want to change your production server setup we first need to know what it is
> -- apache/mod_python or something else?
>
>
>
> > Thanks for reply
>
> > by the way, there is the --adminmedia option for development version?
>
> I'm not sure what you are asking here?
>
> Karen
>
>
>
> > On Feb 13, 1:51 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > > On Feb 13, 2008 5:41 AM, [EMAIL PROTECTED] <
> > [EMAIL PROTECTED]>
> > > wrote:
>
> > > > Hello everyone!
> > > > I'd like to change the Admin Page media path for my website which is
> > > > based on Django.
>
> > > Are you running this site in production (apache, perhaps?) or
> > development
> > > (using the built-in development server)?
>
> > > > However, i tried that command below:
> > > > manage.py --adminmedia='/home/media/'
>
> > > --adminmedia is an option to the runserver command, so is only used when
> > you
> > > are running in development.  That particular command you quote has no
> > > subcommand at all, so yes, that doesn't work at all.  (Actually
> > providing
> > > the output from the command would be more helpful to people trying to
> > help
> > > than simply saying it doesn't work at all.)
>
> > > > but it does not work at all, so i have to edit the css or to add new
> > > > javascript code into:
> > > > /usr/lib/python2.5/site-packages/django/contrib/admin/media
> > > > and obviously that's not good enough :)
>
> > > > So does anyone know that how can i change my Django Adminpage Media
> > > > Path?
>
> > > Depends on whether you are running development or production, so give us
> > > some more details on your setup and someone can probably help.
>
> > > 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: transaction.commit_manually

2008-02-13 Thread Ariel Mauricio Nunez Gomez
I hit the same wall when writing a loaddata variant to load json on
geodjango.
I couldn't find a solution either. :(

I hope someone can give us light in this regard.

Ariel.


On Feb 12, 2008 5:34 PM, Jeremy Dunck <[EMAIL PROTECTED]> wrote:

>
> Are people using the transaction.commit_manually decorator?
>
> I thought I understood it, but just learned that I don't.
>
> I'm using the transaction middleware and that's good for most of my
> purposes.
>
> I have another function called from lots of different views, and
> within that function, I wanted to isolate the general transaction
> condition from the connection/queries I need to run from that
> function.
>
> The goal here is to have a function that can run successfully when the
> calling view (or anything else in the request cycle) had a SQL error.
> Or vice versa, if an error occurs in this function, I'd like to
> isolate it from the calling view's functionality.
>
> Anyway, I thought commit_manually set up a nested transaction, but
> apparently it doesn't.
>
> So, if you're using it, can you explain how it's been useful to you?
> I'd like to use it correctly.  :)
>
>  -Jeremy
>
> >
>

--~--~-~--~~~---~--~~
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 Admin Page Media Path

2008-02-13 Thread Karen Tracey
On Feb 13, 2008 8:24 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

>
> Hi Karen:
>
> it's running on production(0.96).
>
> and the django project path is:
> /home/xxd/Desktop/Django-0.96.1/django/bin/project
>
> I'd like to move the admin page media path from
> /usr/lib/python2.5/site-packages/django/contrib/admin/media
> to
> /home/xxd/Desktop/Django-0.96.1/django/bin/projec/media/admin_media
>

Running in production under apache/mod_python?  Or something else?


>
> so that i tried to use the command
> python manage.py --adminmedia='/home/xxd/Desktop/Django-0.96.1/django/
> bin/projec/media/admin_media/'
> but it does not work.
>

That command is missing "runserver" before the --adminmedia part.  But
unless you are running your production site using the development server (
manage.py runserver), this command isn't going to help you at all.  If you
want to change your production server setup we first need to know what it is
-- apache/mod_python or something else?


>
> Thanks for reply
>
> by the way, there is the --adminmedia option for development version?


I'm not sure what you are asking here?

Karen


>
>
> On Feb 13, 1:51 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Feb 13, 2008 5:41 AM, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]>
> > wrote:
> >
> > > Hello everyone!
> > > I'd like to change the Admin Page media path for my website which is
> > > based on Django.
> >
> > Are you running this site in production (apache, perhaps?) or
> development
> > (using the built-in development server)?
> >
> > > However, i tried that command below:
> > > manage.py --adminmedia='/home/media/'
> >
> > --adminmedia is an option to the runserver command, so is only used when
> you
> > are running in development.  That particular command you quote has no
> > subcommand at all, so yes, that doesn't work at all.  (Actually
> providing
> > the output from the command would be more helpful to people trying to
> help
> > than simply saying it doesn't work at all.)
> >
> > > but it does not work at all, so i have to edit the css or to add new
> > > javascript code into:
> > > /usr/lib/python2.5/site-packages/django/contrib/admin/media
> > > and obviously that's not good enough :)
> >
> > > So does anyone know that how can i change my Django Adminpage Media
> > > Path?
> >
> > Depends on whether you are running development or production, so give us
> > some more details on your setup and someone can probably help.
> >
> > 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: Django Admin Page Media Path

2008-02-13 Thread [EMAIL PROTECTED]

Hi Karen:

it's running on production(0.96).

and the django project path is:
/home/xxd/Desktop/Django-0.96.1/django/bin/project

I'd like to move the admin page media path from
/usr/lib/python2.5/site-packages/django/contrib/admin/media
to
/home/xxd/Desktop/Django-0.96.1/django/bin/projec/media/admin_media

so that i tried to use the command
python manage.py --adminmedia='/home/xxd/Desktop/Django-0.96.1/django/
bin/projec/media/admin_media/'
but it does not work.

Thanks for reply

by the way, there is the --adminmedia option for development version?

On Feb 13, 1:51 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Feb 13, 2008 5:41 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>
> > Hello everyone!
> > I'd like to change the Admin Page media path for my website which is
> > based on Django.
>
> Are you running this site in production (apache, perhaps?) or development
> (using the built-in development server)?
>
> > However, i tried that command below:
> > manage.py --adminmedia='/home/media/'
>
> --adminmedia is an option to the runserver command, so is only used when you
> are running in development.  That particular command you quote has no
> subcommand at all, so yes, that doesn't work at all.  (Actually providing
> the output from the command would be more helpful to people trying to help
> than simply saying it doesn't work at all.)
>
> > but it does not work at all, so i have to edit the css or to add new
> > javascript code into:
> > /usr/lib/python2.5/site-packages/django/contrib/admin/media
> > and obviously that's not good enough :)
>
> > So does anyone know that how can i change my Django Adminpage Media
> > Path?
>
> Depends on whether you are running development or production, so give us
> some more details on your setup and someone can probably help.
>
> 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: OR lookups

2008-02-13 Thread Julien

Maybe a quick mention in the docs saying: "Warning, this might not
work in such and such case. But it is worked on and should be
eventually fixed, see the queryset-refactor branch."

I have to say that I spent quite some time trying to find out what was
wrong with my code, as I fully trusted the docs (and so should we). A
quick mention like that would have saved me quite some time and
frustration ;)

On Feb 13, 9:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-02-13 at 00:27 -0800, [EMAIL PROTECTED] wrote:
> > Perhaps the current documentation should be updated to reflect that
> > this is not working. Its quite frustrating to have documentation that
> > describes something as working when it is not.
>
> > On Feb 12, 1:20 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> > wrote:
> > > On Tue, 2008-02-12 at 00:56 -0800, Julien wrote:
> > > > Thanks a lot for the tips! I think I'll go for the custom merging in
> > > > Python.
>
> > > > One stupid question. Is there any estimation as to when queryset-
> > > > refactor might be merged to trunk? I know it's hard to answer, but
> > > > should it be more like 1 month, 6 month, 1 year away?  :)
> > > > The wiki says it's pretty unstable, so I guess it won't happen before
> > > > a while...
>
> > > Hopefully pretty soon. We're in the home stretch now and soon I'll be
> > > asking for volunteers to test it.
>
> Since the majority of OR lookups work, this isn't worth doing. It's a
> better use of our time to fix the problems.
>
> Regards,
> Malcolm
>
> --
> Honk if you love peace and quiet.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: Persistent data (other than sessions)

2008-02-13 Thread mickey ristroph

I just got it working using the global variable (the first of your
suggestions). I did not know about Python's global statement, but that
did the trick. I just had to say:


final_graph = None

def graph_search(request):
   global final_graph
   if not final_graph:
 final_graph = build_graph()
   result = search_graph(final_graph, some_parameters_from_request)
   return render_to_response('template.html',{'result': result})


Thanks again, Dan!

On Feb 13, 6:42 am, mickey ristroph <[EMAIL PROTECTED]> wrote:
> Dan-
>
> Thanks a lot for the ideas.
>
> I tried the first suggestion, but get an UnboundLocalError, local
> variable 'graph' referenced before assignment. Not sure how to fix
> this.
>
> I also tried the following:
>
>local_data = threading.local()
> local_data.__dict__.setdefault('graph', None)
> if not local_data.graph:
> local_data.graph = build_graph()
>
> But the graph is still rebuilt every time. This occurs through
> mod_python and FastCGI. I guess there is a seperate thread handling
> each request, so there is no persistence.
>
> I just wanted to give you an update on what I was trying. Thanks again
> for the suggestions. I'll post again when I figure it out.
>
> -Mickey
>
> On Feb 1, 4:16 am, Dan Fairs <[EMAIL PROTECTED]> wrote:
>
> > > Is there anyway I can make g persistent? In other words, I want to
> > > build it once, and then search that copy for each additional request.
>
> > If this thing doesn't change, then you could build it once and then
> > stick it in a module-level variable. Something like:
>
> > final_graph = None
>
> > def graph_search(request):
> >if not final_graph:
> >  final_graph = build_graph()
> >result = search_graph(final_graph, some_parameters_from_request)
> >return render_to_response('template.html',{'result': result})
>
> > Note that this is a *very* naive implementation - you'll need some
> > locking around final_graph access to prevent race conditions. You
> > might want to consider using a thread-local storage. You'll also need
> > to unset this module-level variable (again with locking) if your
> > underlying graph data changes.
>
> > Cheers,
> > Dan
>
> > --
> > Dan Fairs <[EMAIL PROTECTED]> |http://www.stereoplex.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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Admin Page Media Path

2008-02-13 Thread Karen Tracey
On Feb 13, 2008 5:41 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

> Hello everyone!
> I'd like to change the Admin Page media path for my website which is
> based on Django.


Are you running this site in production (apache, perhaps?) or development
(using the built-in development server)?


> However, i tried that command below:
> manage.py --adminmedia='/home/media/'


--adminmedia is an option to the runserver command, so is only used when you
are running in development.  That particular command you quote has no
subcommand at all, so yes, that doesn't work at all.  (Actually providing
the output from the command would be more helpful to people trying to help
than simply saying it doesn't work at all.)


> but it does not work at all, so i have to edit the css or to add new
> javascript code into:
> /usr/lib/python2.5/site-packages/django/contrib/admin/media
> and obviously that's not good enough :)
>
> So does anyone know that how can i change my Django Adminpage Media
> Path?
>
>
Depends on whether you are running development or production, so give us
some more details on your setup and someone can probably help.

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: Persistent data (other than sessions)

2008-02-13 Thread mickey ristroph

Dan-

Thanks a lot for the ideas.

I tried the first suggestion, but get an UnboundLocalError, local
variable 'graph' referenced before assignment. Not sure how to fix
this.

I also tried the following:

   local_data = threading.local()
local_data.__dict__.setdefault('graph', None)
if not local_data.graph:
local_data.graph = build_graph()

But the graph is still rebuilt every time. This occurs through
mod_python and FastCGI. I guess there is a seperate thread handling
each request, so there is no persistence.

I just wanted to give you an update on what I was trying. Thanks again
for the suggestions. I'll post again when I figure it out.

-Mickey

On Feb 1, 4:16 am, Dan Fairs <[EMAIL PROTECTED]> wrote:
> > Is there anyway I can make g persistent? In other words, I want to
> > build it once, and then search that copy for each additional request.
>
> If this thing doesn't change, then you could build it once and then
> stick it in a module-level variable. Something like:
>
> final_graph = None
>
> def graph_search(request):
>if not final_graph:
>  final_graph = build_graph()
>result = search_graph(final_graph, some_parameters_from_request)
>return render_to_response('template.html',{'result': result})
>
> Note that this is a *very* naive implementation - you'll need some
> locking around final_graph access to prevent race conditions. You
> might want to consider using a thread-local storage. You'll also need
> to unset this module-level variable (again with locking) if your
> underlying graph data changes.
>
> Cheers,
> Dan
>
> --
> Dan Fairs <[EMAIL PROTECTED]> |http://www.stereoplex.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 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: SQL Join

2008-02-13 Thread J. Clifford Dyer

The type field on Membership rules out m2m.  There's a patch in the
works (6095) to address this, and it could use testing, if you'd like to
try it out.

Alternatively, set up a many to one from membership to user, and from
membership to group, and call the backrefs "groups" and "users"
respectively.

User.groups.group.all() gives you the groups associated with the user
table.
Group.users.user.all() gives you the users associated with the group
table.

It looks like Message should have a foreign key to Membership rather
than separate ones to User and Group, if I'm reading your intentions
correctly.

Cheers,
Cliff



On Tue, 2008-02-12 at 23:48 -0600, Alex Ezell wrote:
> This doesn't answer your question directly, but wouldn't many-to-many
> fields help a bit here?
> 
> http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships
> 
> Sorry if you've already thought about this and dismissed it.
> 
> /alex
> 
> On Feb 12, 2008 11:41 PM, Gus <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> > I have something like:
> >
> > Class User
> >  id
> >
> > Class Group
> >  id
> >
> > Class Membership
> >  id
> >  group fk
> >  user fk
> >  type char1
> >
> > Class Message
> >  id
> >  group fk
> >  user fk
> >
> > I'm a little confused about how to do this join from the django db
> > api:
> >
> > select message.* from message, membership
> >  where message.group_id = membership.group_id
> >  AND message.user_id = membership.user_id
> >  AND membership.type <> 'B'
> >
> > I basically want all the messages where the related membership type is
> > not 'B'...
> >
> > any help would be much appreciated
> >
> > >
> >
> 
> > 


--~--~-~--~~~---~--~~
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: InspectDB showing up error

2008-02-13 Thread Karen Tracey
On Feb 13, 2008 5:39 AM, Sairam Krishnamurthy <[EMAIL PROTECTED]> wrote:

> Thanks Malcolmn,
>
> This issue was discussed already in this group. I saw that after posting
> the message. It had a fix.
>
>
> http://groups.google.com/group/django-developers/browse_thread/thread/2a5d168c19c5774/0d8a0b5b878ab4ab?lnk=gst&q=inspectdb+error#0d8a0b5b878ab4ab
>

The ticket referenced in that discussion (
http://code.djangoproject.com/ticket/2591) was fixed in July.  That is after
the 0.96 release of Django so in order to get it you will need to be running
with an SVN checkout, not the 0.96 release.  Are you?  If you are then there
may be another manifestation of the problem that needs to be fixed.  If you
are running with 0.96 or earlier, then you will need to switch to something
more recent in order to get the fix.

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
-~--~~~~--~~--~--~---



filter fields that have a value

2008-02-13 Thread Martin

hello,

i'm struggling with ManyToMany fields (Rajesh helped me a lot;) and
have another question. My model Article, has ManyToMany relation with
Video model (for storing only youtube videos).

class Article(models.Model):
video = models.ManyToManyField(Video, blank=True, null=True)

class Video(models.Model):
url = models.CharField(max_length=300)
name = models.CharField(max_length=300)

Then i add 3 videos to an Article. Since not all articles have videos,
i want to filter out those that have it.
Filter looks like this:

Article.objects.filter(video__isnull=False)

So here is the problem.. let's say i have 5 articles in my DB and only
one has 3 videos.. this filter doesn't return an article that has
videos, but rather returns 3x the same article name.. probably,
because of 3 added videos to it.
so my question here is: is this the right way to check, if article has
videos (Article.objects.filter(video__isnull=False))? if this the
right way, what is (should i add costum method in my model)?

I would appreciate any help,

Martin
--~--~-~--~~~---~--~~
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: template UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in position 1393: unexpected code byte

2008-02-13 Thread Jarek Zgoda

Steve napisał(a):

> UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in
> position 1393: unexpected code byte
> The string that could not be encoded/decoded was: ight ? 2006
> 
> The part of the static template it is complaining about is the (c)
> character:
> 
> Copyright (c) 2006-2008 .. 
> 
> How do I get the (c) character translated correctly?

Use character entity © (apply the same to ®, ™ etc.).

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~-~--~~~---~--~~
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: template UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in position 1393: unexpected code byte

2008-02-13 Thread J. Clifford Dyer

0xA9 is the codepoint for the copyright symbol, but in UTF-8, characters
above 0x7F are not encoded with their codepoint value.  That means your
documents are probably encoded in ISO-8859-1 or ISO-8859-15.  So as per
Malcolm's advice, you should either re-save your templates in UTF-8, or
tell Django to expect ISO-8859-1 or -15, depending on your needs.

Cheers,
Cliff

On Tue, 2008-02-12 at 16:18 -0800, Steve wrote:
> Hi,
> I get this error:
> UnicodeDecodeError at / 'utf8' codec can't decode byte 0xa9 in
> position 1393: unexpected code byte
> The string that could not be encoded/decoded was: ight � 2006
> 
> The part of the static template it is complaining about is the ©
> character:
> 
> Copyright © 2006-2008 .. 
> 
> How do I get the © character translated correctly?
> 
> Thanks
> Steve
> > 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django Admin Page Media Path

2008-02-13 Thread [EMAIL PROTECTED]

Hello everyone!
I'd like to change the Admin Page media path for my website which is
based on Django.

However, i tried that command below:
manage.py --adminmedia='/home/media/'
but it does not work at all, so i have to edit the css or to add new
javascript code into:
/usr/lib/python2.5/site-packages/django/contrib/admin/media
and obviously that's not good enough :)

So does anyone know that how can i change my Django Adminpage Media
Path?

Thanks

xxd
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >