Non ForeignKey field type as

2008-07-07 Thread [EMAIL PROTECTED]

Hello,

I'm building my first Django project and was wanting to know how to
add a  field type to the admin page. I would like the
Details.project_type field to be displayed as a select box but it's
not a foreign key, how do I go about this?

Thanks,

Jason

from django.db import models

class Project(models.Model):
client = models.CharField(max_length=30)
add_date = models.DateTimeField('date added')
class Meta:
ordering = ['-add_date']
def __unicode__(self):
return self.client
class Admin:
fields = (
('Client', {'fields': ('client',)}),
('Date Added', {'fields': ('add_date',)}),
)
pass

class Details(models.Model):
project = models.ForeignKey(Project)
project_type = models.CharField(max_length=30)# displayed as

title = models.CharField(max_length=50)
blurb = models.TextField()
builder = models.CharField(max_length=50)
photography = models.CharField(max_length=100)
interior_designer = models.CharField(max_length=50)
def __unicode__(self):
return self.title

class Image(models.Model):
name = models.CharField(max_length=30)
def __unicode__(self):
return self.name
--~--~-~--~~~---~--~~
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 validators against model fields

2008-07-07 Thread Malcolm Tredinnick


On Mon, 2008-07-07 at 21:34 -0700, Ayaz Ahmed Khan wrote:
> I have a model with a CharField against which I have defined a
> validator, thus:
> 
> class Info(models.Model):
> text = models.CharField(validator_list=[validators.isOnlyDigits])
> 
> When using a ModelForm of that Model in a view, Django fails to apply
> the validators.isOnlyDigits validation check.  If model is edited from
> admin, however, the specified extra validator is applied, and works.
> I don't know what I am doing wrong or missing out on.  Any clues would
> be really appreciated.
> 
> I am using the trunk build from svn of Django.  Thanks.

Django does not do any model field validation by default at the moment.
Admin does it using an old system (essentially, oldforms and Add- and
ChangeManipulators) that is being removed. We are adding more coherent
model field validation prior to 1.0. This is ticket #6845 and it's
actively work in progress (I reviewed it in detail over the weekend and
Honza is going to be working on the patch at the EuroPython sprint this
coming weekend).

For now, just do the validation manually in your model's save() method.
It's not ideal, but that's the way things are for the time being.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 validators against model fields

2008-07-07 Thread Ayaz Ahmed Khan

I have a model with a CharField against which I have defined a
validator, thus:

class Info(models.Model):
text = models.CharField(validator_list=[validators.isOnlyDigits])

When using a ModelForm of that Model in a view, Django fails to apply
the validators.isOnlyDigits validation check.  If model is edited from
admin, however, the specified extra validator is applied, and works.
I don't know what I am doing wrong or missing out on.  Any clues would
be really appreciated.

I am using the trunk build from svn of Django.  Thanks.

--
Ayaz Ahmed Khan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



querying an object

2008-07-07 Thread Adi

I have two models

class Meet(models.Model):
  submitted=models.BooleanField(default=False)

class MeetParticipationSession(models.Model):
  meet=models.ForeignKey(Meet)
  submitted=models.BooleanField(default=False)

question 1: How do i find Meet objects that don't have a MeetSession
pointing to them. In SQL I would do it as follows:
select a.* from meet_meet a where a.id not in (select distinct
b.meet_id from meet_meetparticipationsession b)

question 2: How do I find all the meets that have been submitted minus
those for which there is a meet participation session  that has been
submitted.

Thanks,

-Adi
--~--~-~--~~~---~--~~
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: asynchronous operations

2008-07-07 Thread Joseph Heck

Look into using a queue system of some form. Django-queue-service
(http://django-queue-service.googlecode.com/) was developed to enable
this but there's similiar mechanisms in use through many sites. Either
developed internally, or using heavier-duty queuing mechanisms.

-joe

On Mon, Jul 7, 2008 at 12:02 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Certain events require another operation to run. But it doesn't need
> to happen immediately.
>
> I'm curious what people use for message passing / job queuing.
>
> Right now, I run cronjobs that run routine background processes, but
> also some operations which should really be event driving.
>
> I was thinking that a piece of middleware could record a call to make
> (and objects / parameters to pass) AFTER the view returned. This way,
> you wouldn't need to schedule another process, and the job could
> benefit from the full context.
>
> Can anyone scope this task for me? How hard would it be to make such a
> middleware module? Where is a good place to start in writing a
> middleware module?
>
> Thanks,
> Ivan
> tipjoy.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: Calendar of Events

2008-07-07 Thread bedros

I was looking for the same thing and found the following

http://www.3captus.com/download/django_calendar

have not  tried it yet, but there's a demo on the same website.


On Jul 7, 6:34 pm, Mario <[EMAIL PROTECTED]> wrote:
> Thank you. I managed to install the event calendar model in Django. I
> can add the events and event categories and display using the default
> templates.
>
> My next question is ~ how do I display the calendar assuming I'm using
> the default templatetag that came with the application?  I added {%
> load load event_tags %} in my base.html. What am I missing? I want to
> display the calendar i.e. July 2008
>
> Thank you for your patience.
>
> Respectfully yours,
>
> Goober
>
> On Jul 7, 8:15 pm, Rob Hudson <[EMAIL PROTECTED]> wrote:
>
> > Google is your friend:http://code.google.com/p/django-event-calendar/
>
> > On Jul 7, 2:13 pm, Mario <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I’m a NOOB and I was wondering if there are any calendars of event
> > > model that will allow a user to click on a specific date with the
> > > associated listing of events. Any suggestions or recommendations are
> > > appreciated.
>
> > > Thank you.
> > > Goober
--~--~-~--~~~---~--~~
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: "ColorField"?

2008-07-07 Thread Leaf

Also note - when I say this, I'm talking about something that can plug
in to the admin interface. Just clearing that up.

Regards,
Leaf
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



"ColorField"?

2008-07-07 Thread Leaf

Does anyone know if there is such thing as a ColorField - something
that stores a hex value and has a JavaScript-powered color picker
beside it? If there is, where can I get it? If there isn't, how would
I go about writing one?

Regards,
Leaf
--~--~-~--~~~---~--~~
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: root() takes exactly 3 arguments (2 given)

2008-07-07 Thread Juanjo Conti

furby escribió:
[...]
> admin.site.root() takes 3 arguments: self, request, url.  There is no
> way to specify arguments in urls.py, so I have no idea how to fix
> this.  Any help would be appreciated.  Thanks.
> 

Yes there is. You can use regex groups:

(r'^admin/(.*)', site1.root),

The string that matches .* will be passed as an extra arg.

Or named groups:

(r'^admin/(?P.*)', site1.root),

Additionaly, you can pass extra args: 
http://www.djangoproject.com/documentation/url_dispatch/#passing-extra-options-to-view-functions

Juanjo
-- 
mi blog: http://www.juanjoconti.com.ar

--~--~-~--~~~---~--~~
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: root() takes exactly 3 arguments (2 given)

2008-07-07 Thread Arien

On Mon, Jul 7, 2008 at 6:31 PM, furby <[EMAIL PROTECTED]> wrote:
>
> here's my urls.py:
> *
>  1 from django.conf.urls.defaults import *
>  2 from django.contrib import admin
>  3 from wizcal.app.models import site1
>  4
>  5 urlpatterns = patterns('',
>  6 # Example:
>  7 # (r'^wizcal/', include('wizcal.foo.urls')),
>  8
>  9 # Uncomment this for admin:
> 10  (r'^admin/.*', site1.root),
> 11 )
> *
>
> admin.site.root() takes 3 arguments: self, request, url.  There is no
> way to specify arguments in urls.py, so I have no idea how to fix
> this.

You want to capture the part of the path that' s "inside" your admin site:

  (r'^admin/(.*)', site1.root)

This way the view gets its three arguments.


Arien

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



runserver with manage.py works but doesn't work with django-admin.py

2008-07-07 Thread Daehee

so it's odd that my new project works with "python manage.py
runserver" but gives me an error when i do "django-admin.py
runserver." how is this possible? btw the error is below:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/
django-admin.py", line 5, in 
management.execute_from_command_line()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/__init__.py", line 263,
in execute_from_command_line
utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/__init__.py", line 219,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/base.py", line 77, in
run_from_argv
self.execute(*args, **options.__dict__)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/core/management/base.py", line 86, in
execute
translation.activate('en-us')
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/translation/__init__.py", line
73, in activate
return real_activate(language)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/translation/__init__.py", line
43, in delayed_loader
return g['real_%s' % caller](*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/translation/trans_real.py", line
220, in activate
_active[currentThread()] = translation(language)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/translation/trans_real.py", line
209, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/utils/translation/trans_real.py", line
192, in _fetch
app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]),
appname[p+1:])
ImportError: No module named whatever

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



newforms-admin: root() takes exactly 3 arguments (2 given)

2008-07-07 Thread furby

has anyone else seen this?

*
TypeError at /admin/
root() takes exactly 3 arguments (2 given)

Request Method: GET
Request URL:http://www.wizcal.com/admin/
Exception Type: TypeError
Exception Value:root() takes exactly 3 arguments (2 given)
*

here's my urls.py:
*
  1 from django.conf.urls.defaults import *
  2 from django.contrib import admin
  3 from wizcal.app.models import site1
  4
  5 urlpatterns = patterns('',
  6 # Example:
  7 # (r'^wizcal/', include('wizcal.foo.urls')),
  8
  9 # Uncomment this for admin:
 10  (r'^admin/.*', site1.root),
 11 )
*

admin.site.root() takes 3 arguments: self, request, url.  There is no
way to specify arguments in urls.py, so I have no idea how to fix
this.  Any help would be appreciated.  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
-~--~~~~--~~--~--~---



What's the best way to simulate a request?

2008-07-07 Thread Andrew

Here's the situation:

I'm creating an RESTful internal API as an app in our project. Our
'main' app (we'll call it main) is a client of the API app. Since
we're building the API piece by piece as we use it, the emphasis on
all of this is simple simple simple -- with our eye on eventually
opening up pieces of the API to the public.

The general flow looks like:
request => main app handling => API client => API logic.

Because right now both of the apps live in the same project and are
being served from the same boxes (and the API won't be running on a
separate machine for a while), I figured, hey, why not just fake an
HttpRequest from the main app logic and pass it over to API? That way,
we don't need to worry about exposing the internal URLs, we don't need
to worry about authentication right now, it'll be simple.

Right now the API client I've written takes an HTTP method, path, and
params, uses resolve(path, api.urls) to get the view, and then calls
the view using a fake HttpRequest that I populate myself.

The one problem is that I'm finding it much harder to fake the
HttpRequests than I thought -- namely because the RESTful handlers on
the API side are expecting things like request._get_post_and_files()
to be present.

So, my thoughts:
a) Continue using the lightweight API "client" I've written, but
instead of building a HttpRequest, fake a WSGIRequest instead (with
the _minimum_ data needed)
b) Patch the django test client to deal with PUT and DELETE and use
that as our API client
c) Import the API urls.py into the main urls.py and call the API
methods by generating actual HTTP requests

I'm not crazy about c) since it requires more infrastructure work now.

Any thoughts?

--~--~-~--~~~---~--~~
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: Calendar of Events

2008-07-07 Thread Mario

Thank you. I managed to install the event calendar model in Django. I
can add the events and event categories and display using the default
templates.

My next question is ~ how do I display the calendar assuming I'm using
the default templatetag that came with the application?  I added {%
load load event_tags %} in my base.html. What am I missing? I want to
display the calendar i.e. July 2008

Thank you for your patience.

Respectfully yours,

Goober


On Jul 7, 8:15 pm, Rob Hudson <[EMAIL PROTECTED]> wrote:
> Google is your friend:http://code.google.com/p/django-event-calendar/
>
> On Jul 7, 2:13 pm, Mario <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I’m a NOOB and I was wondering if there are any calendars of event
> > model that will allow a user to click on a specific date with the
> > associated listing of events. Any suggestions or recommendations are
> > appreciated.
>
> > Thank you.
> > Goober
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



getting a manytomany field in date based archive index

2008-07-07 Thread mccomas . chris

Hey,

I have date based generic views, in the archive_index view I'm
displaying the most recent blog entries, I'm trying to get the
category for each, which is a ManyToMany field.

{% for entry in latest %}

{{ entry.title }}
{{ entry.body }}
Category: {% for categories in entry.get_category_list %}
{{ category.title }}{% endfor %}

{% endfor %}

It's not displaying the category info, I also tried
latest.get_category_list and the same thing.

Thanks Chris
--~--~-~--~~~---~--~~
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: Calendar of Events

2008-07-07 Thread Rob Hudson

Google is your friend:
http://code.google.com/p/django-event-calendar/

On Jul 7, 2:13 pm, Mario <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I’m a NOOB and I was wondering if there are any calendars of event
> model that will allow a user to click on a specific date with the
> associated listing of events. Any suggestions or recommendations are
> appreciated.
>
> Thank you.
> Goober
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



string indices must be integers error in admin - don't know where to start debugging

2008-07-07 Thread Jon Loyens

Hi everyone,

I've got a problem and I don't even know where to start debugging
it... there seems to be a difference between the way my app is
behaving between my local environment and my deployment environment.
Hopefully you guys can give me some idea where to start.

I've written a small PR application that along with a story, publishes
pictures and other files.  I've written models that look like this
(this is all written on the trunk):

class Story(models.Model):
title = models.CharField(max_length=100)
date = models.DateField()
slug = models.SlugField()
published = models.BooleanField()
body = models.TextField()

class Meta:
verbose_name_plural = "stories"
ordering = ['-date']
pass

def __str__(self):
return self.title.encode("utf-8")

class Admin:
list_display = ('title','date','slug',)
pass

class Picture(models.Model):
image = models.ImageField(upload_to="photos")
date = models.DateField()
title = models.CharField(max_length=100, core=True)
caption = models.CharField(max_length=100, blank=True)
story = models.ForeignKey(Story, edit_inline=models.STACKED)

def __str__(self):
return self.title.encode("utf-8")

class Meta:
ordering = ['-date']
pass


class Downloads(models.Model):
media = models.FileField(upload_to="downloads")
date = models.DateField()
title = models.CharField(max_length=100, core=True)
story = models.ForeignKey(Story, edit_inline=models.STACKED)

def __str__(self):
return self.title.encode("utf-8")

class Meta:
verbose_name_plural = "downloads"
ordering = ['-date']
pass

This works great locally on my machine.  However, when I deploy on
WebFaction (again using a django instance built from the trunk),
everything appears to be fine until I edit a Story object in the Admin
UI.  When I try and save any edits (no matter what field I edit), I
get this error:

Traceback:
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/core/
handlers/base.py" in get_response
  82. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/contrib/
admin/views/decorators.py" in _checklogin
  62. return view_func(request, *args, **kwargs)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/views/
decorators/cache.py" in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/contrib/
admin/views/main.py" in change_stage
  338. new_object = manipulator.save(new_data)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/db/
models/manipulators.py" in save
  207. f.save_file(rel_new_data,
new_rel_obj, self.change and old_rel_obj or None, old_rel_obj is not
None, rel=True)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/db/
models/fields/__init__.py" in save_file
  933. FileField.save_file(self, new_data, new_object,
original_object, change, rel, save)
File "/home/myaccount/webapps/mysite_site/lib/python2.5/django/db/
models/fields/__init__.py" in save_file
  847. file_name = file['filename']

Exception Type: TypeError at /admin/pr/story/1/
Exception Value: string indices must be integers

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



URL templatetag with URL naming not working

2008-07-07 Thread Kimus Linuxus
hi,

My named URLs using the URL templatetag are not working when I try it in
the apache with mod_python. If I try manage.py runserver it works fine.

tough in the home page even with apache also works fine the templatetag.

using reverse() from shell works fine also.


My testing site is here: http://dev.zlabs.org/ and the code is here:
http://code.google.com/p/django-blocks/


need some help or a clue.


thank you

kimus



--~--~-~--~~~---~--~~
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: Inserting html into a page dynamically

2008-07-07 Thread Peter Herndon

Django is an excellent framework for developing web applications, but
it doesn't do away with the need for JavaScript.  In your case, I
would very much use JavaScript to make the HTML dynamic.  I've done
much the same, though on a smaller scale, in my own apps.

Django gives you a very easy means of getting data in and out of a web
page, via the ORM, the views and templates, and URLconf, but you still
need JavaScript to do the kinds of things you're describing.  However,
if you need your AJAX call to return some information dynamically
calculated by the server, retrieved from a database, or something like
that, you can write your AJAX to call a Django view.  You would write
that view to do the calculations required, and return the data as XML
or JSON.

---Peter Herndon

On Mon, Jul 7, 2008 at 4:48 PM, Bear <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I'm new with Django and I can't figure out a method to do what I want,
> that is to say inserting html dynamically in my page (I'm not very
> good in english so I'll do my best to explain it with an example)
>
> Let's say the goal of the page is to let the user build a
> "storyboard". A storyboard is just a succession of many elements that
> the user can chose to add by clicking on links. When the user comes on
> the page, it's empty. There are a few links to add elements to the
> storyboard.
>
> An element can be just a title (as a charfield) or it can be a more
> complex thing (combination of image and textfield etc..). So in order
> to help the user to build his storyboard, I already have those
> elements in templates (pre-built forms in fact that could be just html
> code in my database). The user just needs to click on a link and here
> it is, it adds the html code of the element in the page.
>
> The thing is that each time the user clicks on a link, I want the page
> to keep its appearence. If the user wants to add 3 titles, 4 image
> fields, and a textfield, he just clicks on the related links, and then
> he can fill in all the forms. I also want the user to be able to
> manage each element separately. Save or delete..
>
> I just can't figure out how to do this. How do I tell Django to add
> some stuff in a page like that ?
> In ajax I'd just have a view to load an element that would be called
> as the user clicks on a link, and then get back the html code of the
> element and add it into my page wherever I want. But without ajax, I
> really don't know.
>
> If someone could understand my problem and help me it would be great.
>
> Thx.
>
> Bibi
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Inserting html into a page dynamically

2008-07-07 Thread Mike Caldwell
Why not just use AJAX, and then have a save button to submit and save in
your database.

On Mon, Jul 7, 2008 at 2:48 PM, Bear <[EMAIL PROTECTED]> wrote:

>
> Hi
>
> I'm new with Django and I can't figure out a method to do what I want,
> that is to say inserting html dynamically in my page (I'm not very
> good in english so I'll do my best to explain it with an example)
>
> ...
>
> I just can't figure out how to do this. How do I tell Django to add
> some stuff in a page like that ?
> In ajax I'd just have a view to load an element that would be called
> as the user clicks on a link, and then get back the html code of the
> element and add it into my page wherever I want. But without ajax, I
> really don't know.
>
> If someone could understand my problem and help me it would be great.
>
> Thx.
>
> Bibi
>
>
>
> >
>

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



Calendar of Events

2008-07-07 Thread Mario

Hello,

I’m a NOOB and I was wondering if there are any calendars of event
model that will allow a user to click on a specific date with the
associated listing of events. Any suggestions or recommendations are
appreciated.

Thank you.
Goober

--~--~-~--~~~---~--~~
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: looking to override some admin save features

2008-07-07 Thread Peter Herndon

Bumping doesn't help, and just makes you look impatient.  If you want
a more immediate answer, log in to the #django IRC channel on
freenode.

Aside from that, it sounds like you want the newforms-admin branch.
Search for that on the wiki.

---Peter Herndon



On 7/7/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> bump.
>
> On Jul 7, 3:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>> a brief description of what I am trying to do:
>>
>> developing a project where I would like to keep django intact allowing
>> for seamless SVN updates of django.  However, I need to add a bit of
>> functionality in the saves of a few admin functions.  Basically I just
>> need to audit some actions (modifying of users, etc).  Is there an
>> easy way to do this?  I am pretty new to django and python so my
>> apologies if this is an obvious question.
> >
>

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



Inserting html into a page dynamically

2008-07-07 Thread Bear

Hi

I'm new with Django and I can't figure out a method to do what I want,
that is to say inserting html dynamically in my page (I'm not very
good in english so I'll do my best to explain it with an example)

Let's say the goal of the page is to let the user build a
"storyboard". A storyboard is just a succession of many elements that
the user can chose to add by clicking on links. When the user comes on
the page, it's empty. There are a few links to add elements to the
storyboard.

An element can be just a title (as a charfield) or it can be a more
complex thing (combination of image and textfield etc..). So in order
to help the user to build his storyboard, I already have those
elements in templates (pre-built forms in fact that could be just html
code in my database). The user just needs to click on a link and here
it is, it adds the html code of the element in the page.

The thing is that each time the user clicks on a link, I want the page
to keep its appearence. If the user wants to add 3 titles, 4 image
fields, and a textfield, he just clicks on the related links, and then
he can fill in all the forms. I also want the user to be able to
manage each element separately. Save or delete..

I just can't figure out how to do this. How do I tell Django to add
some stuff in a page like that ?
In ajax I'd just have a view to load an element that would be called
as the user clicks on a link, and then get back the html code of the
element and add it into my page wherever I want. But without ajax, I
really don't know.

If someone could understand my problem and help me it would be great.

Thx.

Bibi



--~--~-~--~~~---~--~~
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: looking to override some admin save features

2008-07-07 Thread Karen Tracey
On Mon, Jul 7, 2008 at 3:46 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

>
> bump.
>

Your original post was less than an hour before your "bump"!  Your question
is also pretty vague.  People might be more likely to try to help if you
give a specific example of what you need to do, what you have tried, and how
it is not quite doing what you'd like.  I'd suggest checking out the
newforms-admin branch (a little searching on the Django project site will
bring up information on it).  That would be where to start for customizing
admin since it has much better capabilities than old admin.

Karen


>
> On Jul 7, 3:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > a brief description of what I am trying to do:
> >
> > developing a project where I would like to keep django intact allowing
> > for seamless SVN updates of django.  However, I need to add a bit of
> > functionality in the saves of a few admin functions.  Basically I just
> > need to audit some actions (modifying of users, etc).  Is there an
> > easy way to do this?  I am pretty new to django and python so my
> > apologies if this is an obvious question.
> >
>

--~--~-~--~~~---~--~~
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: ForeignKey with 0 meaning Null

2008-07-07 Thread rui
Nick,

Maybe only your print isn´t working.
Look at this class:

http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py#L982

If you really want to check if it is working, do:

fp = open("/writable/path/to/log.txt", "w")

class ForeignKeyWithZeros(models.ForeignKey):
   """
   A ForeignKey, but when the id is 0 the relation is considered to be NULL

   Use with null=True
   """
   def __get__(self, instance, *args, **kwargs):
   # never gets called
   fp.write("Instance %r " % instance)

   def to_python(self, value):
   # never gets called
   fp.write("to_python %r" % value)

   def __del__(self):
   fp.close()

It´s justa guess. Not sure if it´s going to work.
Cheers
--
Rui


On Mon, Jul 7, 2008 at 4:14 PM, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>
> I'm adapting a legacy database for use with Django and I've come
> across a problem I haven't been able to solve!
>
> The database has ForeignKey fields which are sometimes 0, meaning
> there is no related row in the other table.  If this database used
> NULL instead of 0 then I could use ForeignKey(Other, null=True) and
> all would work fine, but it doesn't and I can't change it.
>
> I've tried lots of different ways of making an adaptor to change the 0
> into a None when read from the database but I haven't made it work (or
> even get called!) yet - can anyone give me a clue?
>
> I'm trying to subclass ForeignKey but none of the methods I override
> (except __init__) seem to ever get called!
>
> Eg ...
>
> class ForeignKeyWithZeros(models.ForeignKey):
>"""
>A ForeignKey, but when the id is 0 the relation is considered to be NULL
>
>Use with null=True
>"""
>def __get__(self, instance, *args, **kwargs):
># never gets called
>print "Instance %r " % instance
>
>def to_python(self, value):
># never gets called
>print "to_python %r" % value
>
> I'm using svn of few days ago.
>
> Thanks
>
> Nick
> --
> Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
>
> >
>

--~--~-~--~~~---~--~~
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: looking to override some admin save features

2008-07-07 Thread [EMAIL PROTECTED]

bump.

On Jul 7, 3:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> a brief description of what I am trying to do:
>
> developing a project where I would like to keep django intact allowing
> for seamless SVN updates of django.  However, I need to add a bit of
> functionality in the saves of a few admin functions.  Basically I just
> need to audit some actions (modifying of users, etc).  Is there an
> easy way to do this?  I am pretty new to django and python so my
> apologies if this is an obvious question.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ForeignKey with 0 meaning Null

2008-07-07 Thread Nick Craig-Wood

I'm adapting a legacy database for use with Django and I've come
across a problem I haven't been able to solve!

The database has ForeignKey fields which are sometimes 0, meaning
there is no related row in the other table.  If this database used
NULL instead of 0 then I could use ForeignKey(Other, null=True) and
all would work fine, but it doesn't and I can't change it.

I've tried lots of different ways of making an adaptor to change the 0
into a None when read from the database but I haven't made it work (or
even get called!) yet - can anyone give me a clue?

I'm trying to subclass ForeignKey but none of the methods I override
(except __init__) seem to ever get called!

Eg ...

class ForeignKeyWithZeros(models.ForeignKey):
"""
A ForeignKey, but when the id is 0 the relation is considered to be NULL

Use with null=True
"""
def __get__(self, instance, *args, **kwargs):
# never gets called
print "Instance %r " % instance

def to_python(self, value):
# never gets called
print "to_python %r" % value

I'm using svn of few days ago.

Thanks

Nick
-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick

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



looking to override some admin save features

2008-07-07 Thread [EMAIL PROTECTED]

a brief description of what I am trying to do:

developing a project where I would like to keep django intact allowing
for seamless SVN updates of django.  However, I need to add a bit of
functionality in the saves of a few admin functions.  Basically I just
need to audit some actions (modifying of users, etc).  Is there an
easy way to do this?  I am pretty new to django and python so my
apologies if this is an obvious question.
--~--~-~--~~~---~--~~
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: Unexplainable syntax error

2008-07-07 Thread Daniel Ellison

Errors like that usually indicate errors further up in your code. if
you have pasted line 10 properly, you're just missing a closing
parenthesis.

On Jul 7, 2:43 pm, Leaf <[EMAIL PROTECTED]> wrote:
> After resolving the URLConf problem, I wrote some views without
> templates to make sure that I had the syntax right. When I tried to
> visit localhost:8000/styles/css/classic-b-and-w/ again, I recieved the
> error "SyntaxError at /styles/css/classic-b-and-w/ - invalid syntax
> (views.py, line 12)". The lines in question are (from the
> aforementioned views.py):
>
> (12) def test_page(request, stylename):
> (13)ow_my_style = get_object_or_404(Style, Slug=stylename)
> (14)return render_to_response('templates/testpage.html', {title:
> ow_my_style.Style_Name, slug: ow_my_style.Slug,
> author:ow_my_style.Author})
>
> I don't see why Python has a problem with it, because it passed a
> nearly identical line (line 8):
>
> (8) def css_generate(request, stylename):
> (9)you_cant_handle_my_style = get_object_or_404(Style,
> Slug=stylename)
> (10)return render_to_response('templates/genstyle.css', {style:
> you_cant_handle_my_style}
>
> This one has me really confused. Does anyone know what could have
> happened here?
>
> Regards,
> Leaf
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



asynchronous operations

2008-07-07 Thread [EMAIL PROTECTED]

Certain events require another operation to run. But it doesn't need
to happen immediately.

I'm curious what people use for message passing / job queuing.

Right now, I run cronjobs that run routine background processes, but
also some operations which should really be event driving.

I was thinking that a piece of middleware could record a call to make
(and objects / parameters to pass) AFTER the view returned. This way,
you wouldn't need to schedule another process, and the job could
benefit from the full context.

Can anyone scope this task for me? How hard would it be to make such a
middleware module? Where is a good place to start in writing a
middleware module?

Thanks,
Ivan
tipjoy.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: Unexplainable syntax error

2008-07-07 Thread Karen Tracey
On Mon, Jul 7, 2008 at 2:43 PM, Leaf <[EMAIL PROTECTED]> wrote:

>
> After resolving the URLConf problem, I wrote some views without
> templates to make sure that I had the syntax right. When I tried to
> visit localhost:8000/styles/css/classic-b-and-w/ again, I recieved the
> error "SyntaxError at /styles/css/classic-b-and-w/ - invalid syntax
> (views.py, line 12)". The lines in question are (from the
> aforementioned views.py):
>
> (12) def test_page(request, stylename):
> (13)ow_my_style = get_object_or_404(Style, Slug=stylename)
> (14)return render_to_response('templates/testpage.html', {title:
> ow_my_style.Style_Name, slug: ow_my_style.Slug,
> author:ow_my_style.Author})
>
> I don't see why Python has a problem with it, because it passed a
> nearly identical line (line 8):
>
> (8) def css_generate(request, stylename):
> (9)you_cant_handle_my_style = get_object_or_404(Style,
> Slug=stylename)
> (10)return render_to_response('templates/genstyle.css', {style:
> you_cant_handle_my_style}
>
> This one has me really confused. Does anyone know what could have
> happened here?


Looks like you are missing a close paren on line 10.  Syntax errors  are
often reported on lines following the one where the actual error is,
particularly when it is something missing.  The parser doesn't see a problem
until it encounters something unexpected instead of whatever it is looking
for.

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: Approvation by superuser

2008-07-07 Thread bruno desthuilliers



Haku a écrit :
> Hello!
> I'm a big django superfan, i just love it!
>
> I'm trying to find a solution to my problem, but no luck or (maybe)
> I'm too dumb to find it by myself. Anyway, what if i need to set up
> some kind of "superuser approval system"?
>
> For example, I want my publisher to write and article, which will be
> stored in the db as "unapproved" and than I want my superuser to read
> it and approve if it's good, so it can be viewed on the site only
> AFTER the approval stuff.

IOW, you want a publishing workflow.

> Any suggestion (if not solution ;-) ) would be greatly appreciated!

You can either implement your own project-specific workflow, or have a
look here:
http://code.djangoproject.com/wiki/GoFlow


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



Unexplainable syntax error

2008-07-07 Thread Leaf

After resolving the URLConf problem, I wrote some views without
templates to make sure that I had the syntax right. When I tried to
visit localhost:8000/styles/css/classic-b-and-w/ again, I recieved the
error "SyntaxError at /styles/css/classic-b-and-w/ - invalid syntax
(views.py, line 12)". The lines in question are (from the
aforementioned views.py):

(12) def test_page(request, stylename):
(13)ow_my_style = get_object_or_404(Style, Slug=stylename)
(14)return render_to_response('templates/testpage.html', {title:
ow_my_style.Style_Name, slug: ow_my_style.Slug,
author:ow_my_style.Author})

I don't see why Python has a problem with it, because it passed a
nearly identical line (line 8):

(8) def css_generate(request, stylename):
(9)you_cant_handle_my_style = get_object_or_404(Style,
Slug=stylename)
(10)return render_to_response('templates/genstyle.css', {style:
you_cant_handle_my_style}

This one has me really confused. Does anyone know what could have
happened here?

Regards,
Leaf
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



common problem: set author, update date on save

2008-07-07 Thread felix

I'm using newforms-admin

This is a very common situation:

on saving a Post
wish to set the author to be request.user
wish to set created_on and updated_on
perhaps wish to set request ip address

but it is actually the form object that does the saving.

but IMO none of these things are on the form or should be and aren't
the domain of the form itself (which is an interaction with a user on
a webpage and is principally about input validation).
they are the domain of the admin class (which handles the crud-life of
the object which is what is happening here)

I would suggest:

ModelAdmin

def save_add(self, request, model, form, formsets,
post_url_continue):
...
new_object = form.save(commit=False)
self.will_save(new_object,request)
new_object.save()
form.save_m2m()

   def will_save(obj,request):
pass


so that our ModelAdmin subclasses can just implement

def will_save(obj,request):
  obj.author = request.user
  obj.last_modified = datetime.datetime.now()
  obj.last_IP = request.IP






btw.  I've looked through many solutions for this (eg.
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser ) and
various tricks involving hidden fields or setting the author field to
be not required so as not to disturb the form.
--~--~-~--~~~---~--~~
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: Field class: Difference between blank and null

2008-07-07 Thread Karen Tracey
On Mon, Jul 7, 2008 at 1:49 PM, Fernando Rodríguez <[EMAIL PROTECTED]>
wrote:

>
> Hi,
>
> I want one on my models to have an optional field. After checking the
> code in the Field class, there are two promising params to __init__():
> blank=False, null=False
>
> What's the difference between both and which one should I use?
>
> Thanks! :-)


It's in the docs:

http://www.djangoproject.com/documentation/model-api/#null

and following.

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: Field class: Difference between blank and null

2008-07-07 Thread phillc

blank will store a string as a string with nothing in it
null will store a string as null

you should use blank

http://www.djangoproject.com/documentation/model-api/#null
says you shouldnt use null unless you have a specific reason to

On Jul 7, 1:49 pm, Fernando Rodríguez <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want one on my models to have an optional field. After checking the
> code in the Field class, there are two promising params to __init__():
> blank=False, null=False
>
> What's the difference between both and which one should I use?
>
> 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: Still unable to log into the admin interface

2008-07-07 Thread Fernando Rodríguez

El lun, 07-07-2008 a las 17:55 +0100, Chris Hoeppner escribió:
> Yeah, the book makes you comment those, but makes you uncomment them  
> again in the next (or the next) chapter =)

I guess that's what happens when you're in a hurry and start skipping
what you shouldn't. Serves me well. ;-)



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



Field class: Difference between blank and null

2008-07-07 Thread Fernando Rodríguez

Hi,

I want one on my models to have an optional field. After checking the
code in the Field class, there are two promising params to __init__():
blank=False, null=False

What's the difference between both and which one should I use?

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: Extending the user system

2008-07-07 Thread mccomas . chris

thanks you guys.

one more quick question. i have a field in User is_student, it's a
Boolean field.

in my course model i want to setup a field so that many students can
be added to that course, using a manytomany (since courses have
multiple students and students have multiple courses). how can i set
it so that on the course admin page it only displays fields from user
where is_student is true?

On Jul 7, 1:19 pm, brydon <[EMAIL PROTECTED]> wrote:
> As well, you may need to consider a signal for User.post_save that
> creates, or saves, a user profile when a User is touched.
>
> http://code.djangoproject.com/wiki/Signals
>
> On Jul 7, 12:04 pm, Alessandro <[EMAIL PROTECTED]> wrote:
>
> > 2008/7/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> > >  yes, but when i do that it doesn't show up anywhere in the admin. i'm
> > >  not getting any errors and running it in development mode right now.
>
> > >  class UserProfile(models.Model):
> > >         url = models.URLField()
> > >         home_address = models.TextField()
> > >         phone_numer = models.PhoneNumberField()
> > >         user = models.ForeignKey(User, unique=True)
>
> > >  then in settings:
>
> > >  AUTH_PROFILE_MODULE = 'mccms.UserProfile'
>
> > You will have another class in admin.
>
> > If you want to see the UserProfile data in your user admin interface
> > you must do this:
>
> > user = models.ForeignKey(User, unique=True,
> > edit_inline=models.STACKED, num_in_admin=1,min_num_in_admin=1,
> > max_num_in_admin=1,num_extra_on_change=0)
>
> > and you MUST have one field on UserProfile with core=True. It cannot
> > be user, or it will create problems.
> > maybe you want to do:
>
> > url = models.URLField(core=True)
>
> > if the url is empty, it will delete UserProfile.
> > --
> > Alessandro Ronchi
> > Skype: aronchihttp://www.alessandroronchi.net
>
> > SOASI Soc.Coop. -www.soasi.com
> > Sviluppo Software e Sistemi Open Source
> > Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
> > Tel.: +39 0543 798985 - Fax: +39 0543 579928
>
> > Rispetta l'ambiente: se non ti è necessario, non stampare questa mail
--~--~-~--~~~---~--~~
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: pluggable django ticketing app?

2008-07-07 Thread Nikolay Panov

I've just asked about Django HelpDesk application in django-russian
(http://groups.google.com/group/django-russian/) googlegroup. It
works!

Regards,
 Nikolay.


On Mon, Jul 7, 2008 at 21:27, chefsmart <[EMAIL PROTECTED]> wrote:
>
> May I know how you found out about this software?
>
> On Jul 7, 9:12 pm, "Nikolay Panov" <[EMAIL PROTECTED]> wrote:
>> At the moment I trying to adapthttp://www.jutdahelpdesk.com/for ours project.
>>
>> Regards,
>>  Nikolay.
>>
>> On Sun, Jul 6, 2008 at 09:05, chefsmart <[EMAIL PROTECTED]> wrote:
>>
>> > Does anyone know of a pluggable django ticketing app? Something like
>> > the apps used by webhosts for online support?
> >
>

--~--~-~--~~~---~--~~
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: my form "didn't return an HttpResponse object."

2008-07-07 Thread rui

Remember to always _return_ a HttpResponse from your view.

def myview(request):
  return HttpResponse("Hello World")

or

def myotherview(request):
 return render_to_response("mytemplate.html", locals())

Cheers and good luck.
-- 
Rui


On Mon, Jul 7, 2008 at 12:14 PM, Malcolm Tredinnick
<[EMAIL PROTECTED]> wrote:
>
>
> On Mon, 2008-07-07 at 08:10 -0700, joshuajonah wrote:
>> I'm not sure where I'm going wrong here. I have a form, when i submit
>> it, even blank if gives me this error. I have tried changing it to
>> POST and then back to a GET submit, but it still doesn't get the
>> response.
>>
>> Here's the debug page with bonus GET vars too! (this way both POST and
>> GET vars are being sent):
>> http://www.hftvnetwork.com/ProductInventory/?first_name=_name==_number=_address===_of_stores=_size=_traffic=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10=_blank_11=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10==Submit
>>
>> my form tag is like this: 
>>
>> Any ideas?
>
> The error has nothing to do with your form. It's saying that the view
> function did not return an HttpResponse object. So have a look at the
> view function involved and fix that problem.
>
> Regards,
> Malcolm
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Approvation by superuser

2008-07-07 Thread Evert

> I'm trying to find a solution to my problem, but no luck or (maybe)
> I'm too dumb to find it by myself. Anyway, what if i need to set up
> some kind of "superuser approval system"?
>
> For example, I want my publisher to write and article, which will be
> stored in the db as "unapproved" and than I want my superuser to read
> it and approve if it's good, so it can be viewed on the site only
> AFTER the approval stuff.
>
> Any suggestion (if not solution ;-) ) would be greatly appreciated!

Cannot you just add an extra column to your Article model, that sets a
flag 'approved'. Could be a boolean field, or a small integer field
(in case you want to have more than two options, like 'unapproved',
'under consideration', 'approved'). Use the 'choices' option to limit
the options to just the relevant values.

Or did I miss the point of your question?

  Evert

--~--~-~--~~~---~--~~
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: pluggable django ticketing app?

2008-07-07 Thread chefsmart

May I know how you found out about this software?

On Jul 7, 9:12 pm, "Nikolay Panov" <[EMAIL PROTECTED]> wrote:
> At the moment I trying to adapthttp://www.jutdahelpdesk.com/for ours project.
>
> Regards,
>  Nikolay.
>
> On Sun, Jul 6, 2008 at 09:05, chefsmart <[EMAIL PROTECTED]> wrote:
>
> > Does anyone know of a pluggable django ticketing app? Something like
> > the apps used by webhosts for online support?
--~--~-~--~~~---~--~~
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: Extending the user system

2008-07-07 Thread brydon

As well, you may need to consider a signal for User.post_save that
creates, or saves, a user profile when a User is touched.

http://code.djangoproject.com/wiki/Signals




On Jul 7, 12:04 pm, Alessandro <[EMAIL PROTECTED]> wrote:
> 2008/7/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
>
> >  yes, but when i do that it doesn't show up anywhere in the admin. i'm
> >  not getting any errors and running it in development mode right now.
>
> >  class UserProfile(models.Model):
> >         url = models.URLField()
> >         home_address = models.TextField()
> >         phone_numer = models.PhoneNumberField()
> >         user = models.ForeignKey(User, unique=True)
>
> >  then in settings:
>
> >  AUTH_PROFILE_MODULE = 'mccms.UserProfile'
>
> You will have another class in admin.
>
> If you want to see the UserProfile data in your user admin interface
> you must do this:
>
> user = models.ForeignKey(User, unique=True,
> edit_inline=models.STACKED, num_in_admin=1,min_num_in_admin=1,
> max_num_in_admin=1,num_extra_on_change=0)
>
> and you MUST have one field on UserProfile with core=True. It cannot
> be user, or it will create problems.
> maybe you want to do:
>
> url = models.URLField(core=True)
>
> if the url is empty, it will delete UserProfile.
> --
> Alessandro Ronchi
> Skype: aronchihttp://www.alessandroronchi.net
>
> SOASI Soc.Coop. -www.soasi.com
> Sviluppo Software e Sistemi Open Source
> Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
> Tel.: +39 0543 798985 - Fax: +39 0543 579928
>
> Rispetta l'ambiente: se non ti è necessario, non stampare questa mail
--~--~-~--~~~---~--~~
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: tweaking auth, making usernames unique within a company

2008-07-07 Thread brydon

Yes!

The idea being using dynamic subdomains as the entry point into a mult-
tenant application. Each tenant, or company, should have their own
unique sets of usernames.

Any suggestions on how you'd do that without hacking User? username is
set to "unique=True" so the only thing I can see is that we generate a
fake username for User that's never exposed or used programmatically.
That seems like an uglier workaround than modifying the base User
though.

brydon






On Jul 7, 12:50 pm, felix <[EMAIL PROTECTED]> wrote:
> do you mean that you want someone to be able to have a duplicate
> username as long as they are at a different company ?
>
> if so, why ?  maybe that requirement should just be worked around.
>
> but there is certainly a way to do it without hacking User.
>
> -f;lix
>
> On Jul 7, 4:58 pm, brydon <[EMAIL PROTECTED]> wrote:
>
> > Ok, no responses.let's try this another way
>
> > Is there a way to swap out the model class that represents User?
> > brydon
>
> > On Jul 4, 3:24 pm, brydon <[EMAIL PROTECTED]> wrote:
>
> > > Hey,
>
> > > I'm assuming I can always fork auth and modify the User class
> > > directly, however, I'd prefer to avoid that.
>
> > > I'd like to add a new model class called Company. Data and users
> > > within a company are mutually exclusive. I'd therefore like to allow
> > > usernames to be unique in the context of a Company.
>
> > > If I hacked auth.User then I'd be doing something like...
>
> > > unique_together = (("username", "company"),)
>
> > > For now, the user's company is available through their profile,
> > > User.get_profile().company.
>
> > > Any thoughts how to accomplish this without forking auth??
>
> > > thanks,
> > > brydon
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Project Management App

2008-07-07 Thread Chris Hoeppner

Hey there!

I wonder if anyone knows if there's an app resembling ActiveCollab (or  
Basecamp, for illustration's sake) that I could plug into a django  
project.

If not, would it be a worthy project with an audience?

Chris

--~--~-~--~~~---~--~~
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: pluggable django ticketing app?

2008-07-07 Thread chefsmart

Those are some good recommendations. Thanks. Currently checking out
these suggestions.

On Jul 6, 10:05 am, chefsmart <[EMAIL PROTECTED]> wrote:
> Does anyone know of a pluggable django ticketing app? Something like
> the apps used by webhosts for online support?
--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread Chris Hoeppner

Yeah, the book makes you comment those, but makes you uncomment them  
again in the next (or the next) chapter =)

On 07/07/2008, at 17:44, Fernando Rodríguez wrote:

>
> El lun, 07-07-2008 a las 12:30 -0400, Karen Tracey escribió:
>
>
>
>>
>>   [snip]
>>
>>   MIDDLEWARE_CLASSES = [] #(
>>  #'django.middleware.common.CommonMiddleware',
>>  #'django.contrib.sessions.middleware.SessionMiddleware',
>>  #'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  #'django.middleware.doc.XViewMiddleware',
>>   #)
>>
>> This is a problem.  Un-comment these, because Admin needs them.
>>
>> [snip]
>>
>>
>>   INSTALLED_APPS = (
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  #'django.contrib.sessions',
>>  #'django.contrib.sites',
>>  'django.contrib.admin',
>>  'mysite.books',
>>
>>
>> Admin is also going to need django.contrib.sessions.
>
>
> Thanks Karen.  I remember commenting out those entries, and I remember
> being instructed to do so (in the book, I believe) because they were
> "not necessary for the time being" :-P
>
>
> I'll see if I can find the exact page (if it was indeed in the book  
> and
> not on some webpage) and notify the authors.
>
> Thanks again. :-)
>
>
>
> >


--~--~-~--~~~---~--~~
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: tweaking auth, making usernames unique within a company

2008-07-07 Thread felix


do you mean that you want someone to be able to have a duplicate
username as long as they are at a different company ?

if so, why ?  maybe that requirement should just be worked around.

but there is certainly a way to do it without hacking User.

-f;lix



On Jul 7, 4:58 pm, brydon <[EMAIL PROTECTED]> wrote:
> Ok, no responses.let's try this another way
>
> Is there a way to swap out the model class that represents User?
> brydon
>
> On Jul 4, 3:24 pm, brydon <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I'm assuming I can always fork auth and modify the User class
> > directly, however, I'd prefer to avoid that.
>
> > I'd like to add a new model class called Company. Data and users
> > within a company are mutually exclusive. I'd therefore like to allow
> > usernames to be unique in the context of a Company.
>
> > If I hacked auth.User then I'd be doing something like...
>
> > unique_together = (("username", "company"),)
>
> > For now, the user's company is available through their profile,
> > User.get_profile().company.
>
> > Any thoughts how to accomplish this without forking auth??
>
> > thanks,
> > brydon
--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread Fernando Rodríguez

El lun, 07-07-2008 a las 12:30 -0400, Karen Tracey escribió:



> 
> [snip]
> 
> MIDDLEWARE_CLASSES = [] #(
>#'django.middleware.common.CommonMiddleware',
>#'django.contrib.sessions.middleware.SessionMiddleware',
>#'django.contrib.auth.middleware.AuthenticationMiddleware',
>#'django.middleware.doc.XViewMiddleware',
> #)
> 
> This is a problem.  Un-comment these, because Admin needs them.
>  
> [snip]
>  
> 
> INSTALLED_APPS = (
>'django.contrib.auth',
>'django.contrib.contenttypes',
>#'django.contrib.sessions',
>#'django.contrib.sites',
>'django.contrib.admin',
>'mysite.books',
> 
> 
> Admin is also going to need django.contrib.sessions.  


Thanks Karen.  I remember commenting out those entries, and I remember
being instructed to do so (in the book, I believe) because they were
"not necessary for the time being" :-P  


I'll see if I can find the exact page (if it was indeed in the book and
not on some webpage) and notify the authors.

Thanks again. :-)



--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread Karen Tracey
On Mon, Jul 7, 2008 at 12:13 PM, Fernando Rodríguez <[EMAIL PROTECTED]>
wrote:

>
> El lun, 07-07-2008 a las 07:02 -0700, urukay escribió:
> >
> > never faced this kind of problem before :S..maybe if u write down or
> upload
> > somewhere ur settings.py file
>
> Here it is:
>
> [snip]
>
> MIDDLEWARE_CLASSES = [] #(
>#'django.middleware.common.CommonMiddleware',
>#'django.contrib.sessions.middleware.SessionMiddleware',
>#'django.contrib.auth.middleware.AuthenticationMiddleware',
>#'django.middleware.doc.XViewMiddleware',
> #)
>

This is a problem.  Un-comment these, because Admin needs them.

[snip]


>
> INSTALLED_APPS = (
>'django.contrib.auth',
>'django.contrib.contenttypes',
>#'django.contrib.sessions',
>#'django.contrib.sites',
>'django.contrib.admin',
>'mysite.books',
>

Admin is also going to need django.contrib.sessions.

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: Still unable to log into the admin interface

2008-07-07 Thread Fernando Rodríguez

El lun, 07-07-2008 a las 07:02 -0700, urukay escribió:
> 
> never faced this kind of problem before :S..maybe if u write down or upload
> somewhere ur settings.py file

Here it is:

---
# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', '[EMAIL PROTECTED]'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'   # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = '/home/fernando/django/mysite/mysite.db' #
Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not
used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. Choices can be found here:
#
http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'Europe/Madrid'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com;
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to
use a
# trailing slash.
# Examples: "http://foo.com/media/;, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '-(9w4cdl*tficf75ijbx-uu8&[EMAIL PROTECTED]($nsp5b'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = [] #(
#'django.middleware.common.CommonMiddleware',
#'django.contrib.sessions.middleware.SessionMiddleware',
#'django.contrib.auth.middleware.AuthenticationMiddleware',
#'django.middleware.doc.XViewMiddleware',
#)

TEMPLATE_CONTEXT_PROCESSORS = ['django.core.context_processors.auth']

ROOT_URLCONF = 'mysite.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/home/fernando/django/mysite/templates/',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
#'django.contrib.sessions', 
#'django.contrib.sites',
'django.contrib.admin',
'mysite.books',

)



--~--~-~--~~~---~--~~
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: pluggable django ticketing app?

2008-07-07 Thread Nikolay Panov

At the moment I trying to adapt http://www.jutdahelpdesk.com/ for ours project.

Regards,
 Nikolay.


On Sun, Jul 6, 2008 at 09:05, chefsmart <[EMAIL PROTECTED]> wrote:
>
> Does anyone know of a pluggable django ticketing app? Something like
> the apps used by webhosts for online support?
> >
>

--~--~-~--~~~---~--~~
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: pluggable django ticketing app?

2008-07-07 Thread Peter Herndon

Hi all,

The Django-NYC users' group is working on an issue tracker, at
http://code.google.com/p/django-issues.  If you are interested in
contributing, please let me know, and I'll add you to the committers.

Please see the django-nyc google discussion group for some additional
context on the app.  It was started both to scratch an itch, and as a
training exercise for our new-to-Django members.

Thanks,

---Peter Herndon
http://spookypony.com



On 7/6/08, Milan Andric <[EMAIL PROTECTED]> wrote:
>
> On Sun, Jul 6, 2008 at 12:05 AM, chefsmart <[EMAIL PROTECTED]> wrote:
>>
>> Does anyone know of a pluggable django ticketing app? Something like
>> the apps used by webhosts for online support?
>
> I have yet to see something available for Django that does
> ticketing/issue tracking.  But I may have missed it, hopefully someone
> on this list can enlighten the both of us.  But in the Python world
> setting up Trac to integrate Django authentication was not too ugly.
> Here's the Trac module I used with the 0.12 (i think) version of Trac.
>
> http://trac-hacks.swapoff.org/attachment/wiki/DjangoAuthIntegration/djangoauth_1.py
> http://trac-hacks.org/wiki/DjangoAuthIntegration
>
> But I have heard at least a handful of people interested in developing
> this kind of app, me included, but my queue is backlogged as usual.
>
> --
> Milan
>
> >
>

--~--~-~--~~~---~--~~
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: Extending the user system

2008-07-07 Thread Alessandro
2008/7/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>  yes, but when i do that it doesn't show up anywhere in the admin. i'm
>  not getting any errors and running it in development mode right now.
>
>  class UserProfile(models.Model):
> url = models.URLField()
> home_address = models.TextField()
> phone_numer = models.PhoneNumberField()
> user = models.ForeignKey(User, unique=True)
>
>  then in settings:
>
>  AUTH_PROFILE_MODULE = 'mccms.UserProfile'

You will have another class in admin.

If you want to see the UserProfile data in your user admin interface
you must do this:

user = models.ForeignKey(User, unique=True,
edit_inline=models.STACKED, num_in_admin=1,min_num_in_admin=1,
max_num_in_admin=1,num_extra_on_change=0)

and you MUST have one field on UserProfile with core=True. It cannot
be user, or it will create problems.
maybe you want to do:

url = models.URLField(core=True)

if the url is empty, it will delete UserProfile.
-- 
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net

SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928

Rispetta l'ambiente: se non ti è necessario, non stampare questa mail

--~--~-~--~~~---~--~~
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: Extending the user system

2008-07-07 Thread mccomas . chris

yes, but when i do that it doesn't show up anywhere in the admin. i'm
not getting any errors and running it in development mode right now.

class UserProfile(models.Model):
url = models.URLField()
home_address = models.TextField()
phone_numer = models.PhoneNumberField()
user = models.ForeignKey(User, unique=True)

then in settings:

AUTH_PROFILE_MODULE = 'mccms.UserProfile'

On Jul 7, 10:52 am, brydon <[EMAIL PROTECTED]> wrote:
> Have you already read about extending the user system through creating
> your own AUTH_PROFILE_MODULE?
>
> http://www.djangoproject.com/documentation/authentication/#storing-ad...
>
> brydon
>
> On Jul 7, 10:27 am, [EMAIL PROTECTED] wrote:
>
> > Would it be proper to use the django admin/user system and just extend
> > it to have staff bios, etc?
>
> > We're going to have it setup that our faculty will have admin access,
> > with limited permissions to login and upload some class lectures (ppt
> > files), edit their class info, etc. Since they'll already be in the
> > database for that, what would be the best way to expand that info to
> > include some other biographical information that'll be displayed
> > publicly on the site (bio, certifications, awards, education, etc).
>
> > I was thinking of creating a new model with the "extra" needed info
> > and linking it to user via foreign key, would that be the best way 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: my form "didn't return an HttpResponse object."

2008-07-07 Thread Malcolm Tredinnick


On Mon, 2008-07-07 at 08:10 -0700, joshuajonah wrote:
> I'm not sure where I'm going wrong here. I have a form, when i submit
> it, even blank if gives me this error. I have tried changing it to
> POST and then back to a GET submit, but it still doesn't get the
> response.
> 
> Here's the debug page with bonus GET vars too! (this way both POST and
> GET vars are being sent):
> http://www.hftvnetwork.com/ProductInventory/?first_name=_name==_number=_address===_of_stores=_size=_traffic=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10=_blank_11=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10==Submit
> 
> my form tag is like this: 
> 
> Any ideas?

The error has nothing to do with your form. It's saying that the view
function did not return an HttpResponse object. So have a look at the
view function involved and fix that problem.

Regards,
Malcolm



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



my form "didn't return an HttpResponse object."

2008-07-07 Thread joshuajonah

I'm not sure where I'm going wrong here. I have a form, when i submit
it, even blank if gives me this error. I have tried changing it to
POST and then back to a GET submit, but it still doesn't get the
response.

Here's the debug page with bonus GET vars too! (this way both POST and
GET vars are being sent):
http://www.hftvnetwork.com/ProductInventory/?first_name=_name==_number=_address===_of_stores=_size=_traffic=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10=_blank_11=_blank_0=_blank_1=_blank_2=_blank_3=_blank_4=_blank_5=_blank_6=_blank_7=_blank_8=_blank_9=_blank_10==Submit

my form tag is like this: 

Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: tweaking auth, making usernames unique within a company

2008-07-07 Thread brydon

Ok, no responses.let's try this another way

Is there a way to swap out the model class that represents User?
brydon



On Jul 4, 3:24 pm, brydon <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I'm assuming I can always fork auth and modify the User class
> directly, however, I'd prefer to avoid that.
>
> I'd like to add a new model class called Company. Data and users
> within a company are mutually exclusive. I'd therefore like to allow
> usernames to be unique in the context of a Company.
>
> If I hacked auth.User then I'd be doing something like...
>
> unique_together = (("username", "company"),)
>
> For now, the user's company is available through their profile,
> User.get_profile().company.
>
> Any thoughts how to accomplish this without forking auth??
>
> thanks,
> brydon
--~--~-~--~~~---~--~~
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: Extending the user system

2008-07-07 Thread brydon

Have you already read about extending the user system through creating
your own AUTH_PROFILE_MODULE?

http://www.djangoproject.com/documentation/authentication/#storing-additional-information-about-users

brydon





On Jul 7, 10:27 am, [EMAIL PROTECTED] wrote:
> Would it be proper to use the django admin/user system and just extend
> it to have staff bios, etc?
>
> We're going to have it setup that our faculty will have admin access,
> with limited permissions to login and upload some class lectures (ppt
> files), edit their class info, etc. Since they'll already be in the
> database for that, what would be the best way to expand that info to
> include some other biographical information that'll be displayed
> publicly on the site (bio, certifications, awards, education, etc).
>
> I was thinking of creating a new model with the "extra" needed info
> and linking it to user via foreign key, would that be the best way 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: Error in URL configuration

2008-07-07 Thread Eric Abrahamsen

Hi Leaf,

The error message you want is the one just below the one you cited in  
your email. Namely this:

Exception Value: Error while importing URLconf 'dj_styles.urls': No  
module named details.urls.default

If you look in your dj_styles/urls.py, it looks like you've got this  
line:

from django.conf.DETAILS.urls.default import *

Which of course isn't right: there's no 'details' module. Take  
'details' out and try it again, it ought to work.


Eric

On Jul 7, 2008, at 10:31 PM, Leaf wrote:

>
> I received an error when I tried to access my "Dj Styles" program over
> the dev server. To make sure that my URLConf worked properly, I typed
> in the address localhost:8000/styles/css/classic-b-and-w/, in an
> attempt to get a View Does Not Exist error to confirm that I properly
> configured the URLS. Instead, I got a page with the title
> "ImproperlyConfigured at /styles/css/classic-b-and-w/. To make the
> URLConf, I copied the URLConf that dbsettings used in both the main
> urls.py and in dbsettings/urls.py.
>
> There are details at http://dpaste.com/hold/61127/ (lines 3-14 are the
> main urls.py in my project root, lines 18-23 is dbsettings/urls.py,
> lines 27-32 are dj_styles/urls.py, and lines 36-69 are the traceback
> returned from the error screen). Does anyone know why this result
> would be given?
>
> Regards,
> Leaf
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error in URL configuration

2008-07-07 Thread Matthias Kestenholz

On Mon, 2008-07-07 at 07:31 -0700, Leaf wrote:
> I received an error when I tried to access my "Dj Styles" program over
> the dev server. To make sure that my URLConf worked properly, I typed
> in the address localhost:8000/styles/css/classic-b-and-w/, in an
> attempt to get a View Does Not Exist error to confirm that I properly
> configured the URLS. Instead, I got a page with the title
> "ImproperlyConfigured at /styles/css/classic-b-and-w/. To make the
> URLConf, I copied the URLConf that dbsettings used in both the main
> urls.py and in dbsettings/urls.py.
> 
> There are details at http://dpaste.com/hold/61127/ (lines 3-14 are the
> main urls.py in my project root, lines 18-23 is dbsettings/urls.py,
> lines 27-32 are dj_styles/urls.py, and lines 36-69 are the traceback
> returned from the error screen). Does anyone know why this result
> would be given?

Sure.

firstsite/dj_styles/urls.py:

from django.conf.details.urls.default import *
 ^^^

That's plain wrong. And the Exception Value tells you that:
"No module named details.urls.default"

Just leave the 'details.' part away, as you did in all other urls.py fragments.


--~--~-~--~~~---~--~~
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: Usability: stripping white space from form fields

2008-07-07 Thread Norman Harman

Karen Tracey wrote:
> On Fri, Jul 4, 2008 at 3:51 AM, Greg Fuller <[EMAIL PROTECTED] 
> > wrote:
> 
> I want to mention what I consider to be a usability issue with Django
> forms.  It has to do with there being no option to strip  leading and
> trailing whitespace from CharFields, URLFields, EmailFields, etc.
> Ticket #4969 was to address this issue but was closed with as a
> 'wontfix', and I have seen other discussions on this issue.
> 
> 
> I think you mean #4960 (http://code.djangoproject.com/ticket/4960), not 
> #4969.  There is also another ticket opened for this, #6362 
> (http://code.djangoproject.com/ticket/6362) which is in design decision 
> needed.
> 
> I agree that an option to strip leading/trailing wihtespace from form 
> fields would be useful, and is probably more often than not the behavior 
> that is desired by default. 
> 
> Karen

It's easier and quicker to locally extend Django.

Here's the start of my forms extension.  It has all the form goodness I 
want and in my forms.py I do a

from myforms import *


from django import newforms as forms
from django.newforms import ModelForm
from django.newforms.models import ModelChoiceField, 
ModelMultipleChoiceField
from django.contrib.localflavor.us.forms import USPhoneNumberField
from django.newforms.fields import *
from django.newforms.widgets import *
import django.newforms.fields
import django.newforms.widgets
__all__ = ["StrippedCharField",]
__all__.extend(["forms", "ModelForm", "ModelChoiceField", 
"ModelMultipleChoiceField", "USPhoneNumberField"])
__all__.extend(django.newforms.fields.__all__)
__all__.extend(django.newforms.widgets.__all__)


class StrippedCharField(CharField):
 """Newforms CharField that strips trailing and leading spaces."""
 def clean(self, value):
 if value is not None:
 value = value.strip()
 return super(StrippedCharField, self).clean(value)


-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

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



Error in URL configuration

2008-07-07 Thread Leaf

I received an error when I tried to access my "Dj Styles" program over
the dev server. To make sure that my URLConf worked properly, I typed
in the address localhost:8000/styles/css/classic-b-and-w/, in an
attempt to get a View Does Not Exist error to confirm that I properly
configured the URLS. Instead, I got a page with the title
"ImproperlyConfigured at /styles/css/classic-b-and-w/. To make the
URLConf, I copied the URLConf that dbsettings used in both the main
urls.py and in dbsettings/urls.py.

There are details at http://dpaste.com/hold/61127/ (lines 3-14 are the
main urls.py in my project root, lines 18-23 is dbsettings/urls.py,
lines 27-32 are dj_styles/urls.py, and lines 36-69 are the traceback
returned from the error screen). Does anyone know why this result
would be given?

Regards,
Leaf
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Extending the user system

2008-07-07 Thread mccomas . chris

Would it be proper to use the django admin/user system and just extend
it to have staff bios, etc?

We're going to have it setup that our faculty will have admin access,
with limited permissions to login and upload some class lectures (ppt
files), edit their class info, etc. Since they'll already be in the
database for that, what would be the best way to expand that info to
include some other biographical information that'll be displayed
publicly on the site (bio, certifications, awards, education, etc).

I was thinking of creating a new model with the "extra" needed info
and linking it to user via foreign key, would that be the best way 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
-~--~~~~--~~--~--~---



Djangonauts in Bucks County PA (or surrounding areas)

2008-07-07 Thread djworth

Hi Fellow Djangonauts,

We are trying to form a local users group for Django users in Bucks
County PA (or surrounding areas).  I wanted to post a message to this
group to see if could drum up some interest.  At the moment we are
thinking of monthly meetings on evenings and/or weekends.

If you would like to join our group please sign up at the link below.

http://djangonautsinbucks.groupomatic.com

Thanks,
  Dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: permalink with multiple generic views

2008-07-07 Thread mccomas . chris

thanks!

On Jul 7, 9:32 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-07-07 at 06:28 -0700, [EMAIL PROTECTED] wrote:
> > i found a post from a while back that basically said if you're using
> > the same generic view type with two different urls you couldn't use
> > the permalink decorator, is that still the case with the SVN release?
>
> > we have our normal news table for the school's news, but we also have
> > students blogging and i'm using date_based.generic_views with both.
>
> Use the
>
>         url()
>
> form in your patterns() call and use the "name" (fourth argument) to
> name each pattern uniquely. 
> Seehttp://www.djangoproject.com/documentation/url_dispatch/#urlfor
> details.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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 with mail

2008-07-07 Thread Ramdas S
I just did that. You are right!

Thanks

On Mon, Jul 7, 2008 at 7:24 PM, Rajesh Dhawan <[EMAIL PROTECTED]>
wrote:

>
> Hi,
>
> On Jul 7, 5:58 am, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> > I do not have an SMTP server on myserver.
> >
> > But the mail settings (SMTP settings) is absolutely right, since it works
> > perfectly of my laptop and of another server.
>
> It looks like a DNS resolution problem on your server. Are you able to
> "ping" your SMTP host by name from your server? Perhaps try using an
> IP address for settings.SMTP_HOST instead of a host name.
>
> -Rajesh D
>
> >
>


-- 
Ramdas S
+91 9342 583 065
My Personal Blog: http://ramdas.diqtech.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: Simple object creation in postgresql with django views code...

2008-07-07 Thread RossGK

Oops - posted too quickly - the lack of change to the DB is actually a
more recent manifestation.

From the code posted, the 'not working' issue was just that the print
statements wouldn't yield any output on the console at all.   I guess
when django has trouble with the code it ignores it and moves on.
There was no traceback though either, making debugging a bit tough.

R.

On Jul 7, 10:14 am, RossGK <[EMAIL PROTECTED]> wrote:
> Sorry - the issue is that no change occurs to the database - I am
> using pgAdminIII to inspect the database, and so can see if an entry
> gets created in my table.
--~--~-~--~~~---~--~~
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: Simple object creation in postgresql with django views code...

2008-07-07 Thread RossGK


Sorry - the issue is that no change occurs to the database - I am
using pgAdminIII to inspect the database, and so can see if an entry
gets created in my table.

Here's the dbpart of the settings.py file seems pretty featureless...

DATABASE_ENGINE = 'postgresql_psycopg2'   #
'postgresql_psycopg2'
DATABASE_NAME = 'myName'  # Or path to database file if
using sqlite3.
DATABASE_USER = 'postgres' # Not used with sqlite3.
DATABASE_PASSWORD = 'password' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.

Didn't see any traceback.   I'll keep plugging away at this. No doubt
newbie issues in there somewhere, but the behaviour just seems to be
inconsistent so far.

I wondering if case handling is a particular challenge.  My table has
mixed case fields and I've seem some discussions about challenges
around that in postgresql.   Any guidance about good practices for
case?  Should I use all lowercase all the time, or is the Django
interface able to manage that effectively?

On Jul 4, 6:26 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
>
> What are the symptoms of a and b "not working"? Does nothing happen,
> do you get a traceback, what?
>
> The more details, the better. It might also help to post the db part
> of your settings.py file.
>
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Get an absolute URL including host

2008-07-07 Thread Rajesh Dhawan

Hi Florian,

Florian Lindner wrote:
> Hello,
>
> how can I get an absolute URL including a hostname (e.g. 
> http://www.example.org/dir/doc.html)
>   in a template. I have an object which get_absolute_url I can use but
> what is the best way of getting the hostname in the template?

Here's a documented way to do this if you use the built-in Sites
application:

http://www.djangoproject.com/documentation/sites/#getting-the-current-domain-for-full-urls

-Rajesh D
--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread Karen Tracey
On Mon, Jul 7, 2008 at 7:04 AM, Fernando Rodríguez <[EMAIL PROTECTED]>
wrote:

>
> Hi,
>
> I followed the advice I got here, and added
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.admin
>
> to settings.py and included the following pattern to urlsp.py:
> (r'^admin/', include('django.contrib.admin.urls')),
>
> I also included
> from django.contrib.auth.models import User from
> django.contrib.contenttypes.models import ContentType
> in mymodels.py.
>
> BTW, I'm using the books example from "the definitve guide to
> django" (chapter 6).
>
> Whenever I try to access the admin app (localhost:8000/admin/) I get
> this error page:
>
>
> 
> AttributeError at /admin/
> 'WSGIRequest' object has no attribute 'user'
>  Request Method:
> GET
>Request URL:
> http://localhost:8000/admin/
>  Exception Type:
> AttributeError
>  Exception Value:
> 'WSGIRequest' object has no
> attribute 'user'
>Exception Location:
> /var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py
> in _checklogin, line 49
>
>
> Traceback (most recent call last):
> File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in
> get_response
>  77. response = callback(request, *callback_args, **callback_kwargs)
> File
> "/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py"
> in _checklogin
>  49. if request.user.is_authenticated() and request.user.is_staff:
>
>  AttributeError at /admin/
>  'WSGIRequest' object has no attribute 'user'
>
>
> ---
>
> What am I STILL doing wrong?
>
> Thanks in advance!
>

Adding the user to the reequest object is done by the authentication
middleware:

http://www.djangoproject.com/documentation/middleware/#django-contrib-auth-middleware-authenticationmiddleware

so it sounds like you are missing at least that (and possibly the session
middleware) from your MIDDLEWARE_CLASSES spec in settings.py.

I find it surprising the book does not cover these things (though these
should have been there by default when you ran startproject, so maybe what I
find surprising is that they are not there already in your config).

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: Still unable to log into the admin interface

2008-07-07 Thread urukay


never faced this kind of problem before :S..maybe if u write down or upload
somewhere ur settings.py file


Fernando Rodríguez wrote:
> 
> 
> El lun, 07-07-2008 a las 04:24 -0700, urukay escribió:
>> 
>> did u create user during SYNCDB?
> 
> yes and i got no errors.
> 
>> 
>> 
>> Fernando Rodríguez wrote:
>> > 
>> > 
>> > Hi,
>> > 
>> > I followed the advice I got here, and added 
>> > django.contrib.auth
>> > django.contrib.contenttypes
>> > django.contrib.admin 
>> > 
>> > to settings.py and included the following pattern to urlsp.py:
>> > (r'^admin/', include('django.contrib.admin.urls')),
>> > 
>> > I also included 
>> > from django.contrib.auth.models import User from
>> > django.contrib.contenttypes.models import ContentType
>> > in mymodels.py.
>> > 
>> > BTW, I'm using the books example from "the definitve guide to
>> > django" (chapter 6).
>> > 
>> > Whenever I try to access the admin app (localhost:8000/admin/) I get
>> > this error page:
>> > 
>> >
>> 
>> > AttributeError at /admin/
>> > 'WSGIRequest' object has no attribute 'user'
>> >   Request Method:
>> > GET
>> > Request URL:
>> > http://localhost:8000/admin/
>> >   Exception Type:
>> > AttributeError
>> >   Exception Value:
>> > 'WSGIRequest' object has no
>> > attribute 'user'
>> > Exception Location:
>> >
>> /var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py
>> > in _checklogin, line 49
>> > 
>> > 
>> > Traceback (most recent call last):
>> > File "/var/lib/python-support/python2.5/django/core/handlers/base.py"
>> in
>> > get_response
>> >   77. response = callback(request, *callback_args, **callback_kwargs)
>> > File
>> >
>> "/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py"
>> > in _checklogin
>> >   49. if request.user.is_authenticated() and request.user.is_staff:
>> > 
>> >   AttributeError at /admin/
>> >   'WSGIRequest' object has no attribute 'user' 
>> > 
>> >
>> ---
>> > 
>> > What am I STILL doing wrong?
>> > 
>> > Thanks in advance!
>> > 
>> > 
>> > 
>> > 
>> > > 
>> > 
>> > 
>> 
> 
> 
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Still-unable-to-log-into-the-admin-interface-tp18314289p18317449.html
Sent from the django-users mailing list archive at Nabble.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: problem with mail

2008-07-07 Thread Rajesh Dhawan

Hi,

On Jul 7, 5:58 am, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> I do not have an SMTP server on myserver.
>
> But the mail settings (SMTP settings) is absolutely right, since it works
> perfectly of my laptop and of another server.

It looks like a DNS resolution problem on your server. Are you able to
"ping" your SMTP host by name from your server? Perhaps try using an
IP address for settings.SMTP_HOST instead of a host name.

-Rajesh D

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



Approvation by superuser

2008-07-07 Thread Haku

Hello!
I'm a big django superfan, i just love it!

I'm trying to find a solution to my problem, but no luck or (maybe)
I'm too dumb to find it by myself. Anyway, what if i need to set up
some kind of "superuser approval system"?

For example, I want my publisher to write and article, which will be
stored in the db as "unapproved" and than I want my superuser to read
it and approve if it's good, so it can be viewed on the site only
AFTER the approval stuff.

Any suggestion (if not solution ;-) ) would be greatly appreciated!

Thanks again, sorry for my italian-english, and keep on the great
work!

Alessio
--~--~-~--~~~---~--~~
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: custom manager method example return a queryset instead of a list

2008-07-07 Thread Rajesh Dhawan

Hi Christopher,

> In the example 
> http://www.djangoproject.com/documentation/model-api/#manager-names
> there custom method with_counts() returns a list
> How do i get it to return a queryset

See the entry_count example in the DB API in this section:

http://www.djangoproject.com/documentation/db-api/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none

Perhaps you will be able to use that instead of a full custom query.

-Rajesh D
--~--~-~--~~~---~--~~
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: permalink with multiple generic views

2008-07-07 Thread Malcolm Tredinnick


On Mon, 2008-07-07 at 06:28 -0700, [EMAIL PROTECTED] wrote:
> i found a post from a while back that basically said if you're using
> the same generic view type with two different urls you couldn't use
> the permalink decorator, is that still the case with the SVN release?
> 
> we have our normal news table for the school's news, but we also have
> students blogging and i'm using date_based.generic_views with both.

Use the

url()

form in your patterns() call and use the "name" (fourth argument) to
name each pattern uniquely. See
http://www.djangoproject.com/documentation/url_dispatch/#url for
details.

Regards,
Malcolm



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



permalink with multiple generic views

2008-07-07 Thread mccomas . chris

i found a post from a while back that basically said if you're using
the same generic view type with two different urls you couldn't use
the permalink decorator, is that still the case with the SVN release?

we have our normal news table for the school's news, but we also have
students blogging and i'm using date_based.generic_views with both.
--~--~-~--~~~---~--~~
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: MediaTemple Containers

2008-07-07 Thread mccomas . chris

I have one of the beta Django containers on MT, and I also have an
account on WebFaction, I love MT, but they're severely lacking with
the Django containers, IMO. WebFaction is amazing compared to MT if
you plan to use shared hosting

On Jul 7, 6:20 am, Niall McCormack <[EMAIL PROTECTED]>
wrote:
> Yeah, I've tried contacting sales but they're a bit cagey too. I  
> wonder if they're waiting for the 1.0 release
>
> On 4 Jul 2008, at 07:30, j.gosier wrote:
>
>
>
> > I'm not sure, I just submitted a support ticket the other day asking
> > (mt) the very same question and they were mum on it.
>
> > On Jun 30, 5:56 am, Niall McCormack <[EMAIL PROTECTED]>
> > wrote:
> >> Hi there,
>
> >> Does anyone know when the Media Temple Grid ServiceDjangoContainers
> >> are going to launch?
>
> >> I'm considering transfering my hosting form Dreamhost to Media
> >> Temple, but want to make use ofDjangofrom day 1...
>
> >> Any info would be grand!
>
> >> Cheers
> >> Niall
--~--~-~--~~~---~--~~
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 seperate view file into different files

2008-07-07 Thread Matthias Kestenholz

On Mon, 2008-07-07 at 06:00 -0700, laspal wrote:
> Hi,
> I have a app called crm in which I have (model.py, views.py ,
> forms.py, urls.py and __init__.py)
> 
> Now the problem is my code has become too big to handle in 1 file.
> So I wanted to know how can I separate  my views.py into multiples
> files.
> My models is as follows:
> Industry:
> Deals:
> 
> 
> So I wanted to create file like Industry.py, Deals.py so that my
> views.py  size will get reduce..
> Do I have to make changes to urls.py ???
> Where should I import all these files?? I just want to do it for my
> views.py files only.

That's easy:

- create a folder views with an empty __init__.py file inside.
- split your old views.py into smaller files and delete views.py
- modify your URLconf entries. You need something like
'crm.views.industry.my_view' instead of 'crm.views.my_view'

You don't need to change anything else.


--~--~-~--~~~---~--~~
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.contrib.comments and "dynamic vars"

2008-07-07 Thread Matthias Kestenholz

On Mon, 2008-07-07 at 15:08 +0200, Matthias Kestenholz wrote:
> On Mon, 2008-07-07 at 05:57 -0700, Aljosa Mohorovic wrote:
> > when using django.contrib.comments how can i use dynamic vars?
> > in current page context i have object_type="news.News" and
> > object_id="2" so i would like to do something like  {%
> > get_comment_count for object_type object_id as comment_count %}
> > 
> > couldn't find any info on
> > http://code.djangoproject.com/wiki/Tutorials#DjangosCommentsFrameworkdjango.contrib.comments
> 
> Just copy the code for get_comment_count and create your own tag from it
> with support for the features you need.
> 
> You'll need this:

http://www.djangoproject.com/documentation/templates_python/#passing-template-variables-to-the-tag

(sorry for the double mail, my hands are a bit slow today)


--~--~-~--~~~---~--~~
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.contrib.comments and "dynamic vars"

2008-07-07 Thread Matthias Kestenholz

On Mon, 2008-07-07 at 05:57 -0700, Aljosa Mohorovic wrote:
> when using django.contrib.comments how can i use dynamic vars?
> in current page context i have object_type="news.News" and
> object_id="2" so i would like to do something like  {%
> get_comment_count for object_type object_id as comment_count %}
> 
> couldn't find any info on
> http://code.djangoproject.com/wiki/Tutorials#DjangosCommentsFrameworkdjango.contrib.comments

Just copy the code for get_comment_count and create your own tag from it
with support for the features you need.

You'll need this:


--~--~-~--~~~---~--~~
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 seperate view file into different files

2008-07-07 Thread laspal

Hi,
I have a app called crm in which I have (model.py, views.py ,
forms.py, urls.py and __init__.py)

Now the problem is my code has become too big to handle in 1 file.
So I wanted to know how can I separate  my views.py into multiples
files.
My models is as follows:
Industry:
Deals:


So I wanted to create file like Industry.py, Deals.py so that my
views.py  size will get reduce..
Do I have to make changes to urls.py ???
Where should I import all these files?? I just want to do it for my
views.py files only.

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



django.contrib.comments and "dynamic vars"

2008-07-07 Thread Aljosa Mohorovic

when using django.contrib.comments how can i use dynamic vars?
in current page context i have object_type="news.News" and
object_id="2" so i would like to do something like  {%
get_comment_count for object_type object_id as comment_count %}

couldn't find any info on
http://code.djangoproject.com/wiki/Tutorials#DjangosCommentsFrameworkdjango.contrib.comments

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



custom manager method example return a queryset instead of a list

2008-07-07 Thread Christopher Clarke

Hi Guys
In the example 
http://www.djangoproject.com/documentation/model-api/#manager-names
there custom method with_counts() returns a list
How do i get it to return a queryset
Regards
Chris

--~--~-~--~~~---~--~~
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: ImageField error

2008-07-07 Thread Molly

Milan,

Thanks a lot, that fixed my problem :)

Molly


On Jul 7, 12:49 am, "Milan Andric" <[EMAIL PROTECTED]> wrote:
> On Sun, Jul 6, 2008 at 3:12 PM, Molly <[EMAIL PROTECTED]> wrote:
>
> > Millan,
>
> > I'm doing this in dev environment with the built in webserver. No it's
> > not a mod_python error.
>
> > I'm using the static setup and I can get to it fine when I upload my
> > photo.
> > The problem is when I click the photo it seems to be pointing to
> > somewhere else.
>
> > In my models:
> > ==
> > photo = models.ImageField("Photograph", upload_to='images/uploaded',
> > blank=True,null=True)
> > ==
>
> > if i manually go to /images/uploaded my photo is there, but the link
> > in the admin site seems to be wrong.
>
> > this is the link, it's adding all of the extra information:
> > ==
> >http://127.0.0.1:8000/admin/base/incident/1/media/images/uploaded/DCP...
> > ==
>
> What do you have for MEDIA_URL in your settings.py file?  Should be
> something like MEDIA_URL='/media/', my guess is you are missing a
> leading slash.  If you can paste your settings.py and model that would
> help,http://dpaste.com.
>
> --
> Milan
--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread Fernando Rodríguez

El lun, 07-07-2008 a las 04:24 -0700, urukay escribió:
> 
> did u create user during SYNCDB?

yes and i got no errors.

> 
> 
> Fernando Rodríguez wrote:
> > 
> > 
> > Hi,
> > 
> > I followed the advice I got here, and added 
> > django.contrib.auth
> > django.contrib.contenttypes
> > django.contrib.admin 
> > 
> > to settings.py and included the following pattern to urlsp.py:
> > (r'^admin/', include('django.contrib.admin.urls')),
> > 
> > I also included 
> > from django.contrib.auth.models import User from
> > django.contrib.contenttypes.models import ContentType
> > in mymodels.py.
> > 
> > BTW, I'm using the books example from "the definitve guide to
> > django" (chapter 6).
> > 
> > Whenever I try to access the admin app (localhost:8000/admin/) I get
> > this error page:
> > 
> > 
> > AttributeError at /admin/
> > 'WSGIRequest' object has no attribute 'user'
> >   Request Method:
> > GET
> > Request URL:
> > http://localhost:8000/admin/
> >   Exception Type:
> > AttributeError
> >   Exception Value:
> > 'WSGIRequest' object has no
> > attribute 'user'
> > Exception Location:
> > /var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py
> > in _checklogin, line 49
> > 
> > 
> > Traceback (most recent call last):
> > File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in
> > get_response
> >   77. response = callback(request, *callback_args, **callback_kwargs)
> > File
> > "/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py"
> > in _checklogin
> >   49. if request.user.is_authenticated() and request.user.is_staff:
> > 
> >   AttributeError at /admin/
> >   'WSGIRequest' object has no attribute 'user' 
> > 
> > ---
> > 
> > What am I STILL doing wrong?
> > 
> > Thanks in advance!
> > 
> > 
> > 
> > 
> > > 
> > 
> > 
> 



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



newforms-admin, forms.ModelForm, formtools.preview

2008-07-07 Thread d-rave

Has anyone successfully got formtools.preview working with
forms.ModelForm so that the form fields are populated from the model.

If so, do you have an example??

--~--~-~--~~~---~--~~
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: Still unable to log into the admin interface

2008-07-07 Thread urukay


did u create user during SYNCDB?


Fernando Rodríguez wrote:
> 
> 
> Hi,
> 
> I followed the advice I got here, and added 
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.admin 
> 
> to settings.py and included the following pattern to urlsp.py:
> (r'^admin/', include('django.contrib.admin.urls')),
> 
> I also included 
> from django.contrib.auth.models import User from
> django.contrib.contenttypes.models import ContentType
> in mymodels.py.
> 
> BTW, I'm using the books example from "the definitve guide to
> django" (chapter 6).
> 
> Whenever I try to access the admin app (localhost:8000/admin/) I get
> this error page:
> 
> 
> AttributeError at /admin/
> 'WSGIRequest' object has no attribute 'user'
>   Request Method:
> GET
> Request URL:
> http://localhost:8000/admin/
>   Exception Type:
> AttributeError
>   Exception Value:
> 'WSGIRequest' object has no
> attribute 'user'
> Exception Location:
> /var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py
> in _checklogin, line 49
> 
> 
> Traceback (most recent call last):
> File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in
> get_response
>   77. response = callback(request, *callback_args, **callback_kwargs)
> File
> "/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py"
> in _checklogin
>   49. if request.user.is_authenticated() and request.user.is_staff:
> 
>   AttributeError at /admin/
>   'WSGIRequest' object has no attribute 'user' 
> 
> ---
> 
> What am I STILL doing wrong?
> 
> Thanks in advance!
> 
> 
> 
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Still-unable-to-log-into-the-admin-interface-tp18314289p18314586.html
Sent from the django-users mailing list archive at Nabble.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: Foreign Key problem

2008-07-07 Thread rui
blog.id dosen´t do the trick ?

Smith, you should look at ManyToMany relationships. These wiil make
you models more readable and easy to deal with.

Give a look here:

http://www.djangoproject.com/documentation/model-api/

Cheers
--
Rui


On Mon, Jul 7, 2008 at 8:07 AM, smith <[EMAIL PROTECTED]> wrote:
>
> hi
> As I am new to django I am having a lots of problem..
> So my query is:
>
> class Blog(models.Model):
>name = models.CharField(maxlength=100)
>
> class Entry(models.Model):
>blog = models.ForeignKey(Blog)
>headline = models.CharField(maxlength=255)
>
> class  content(models.Model):
>  name = models.CharField(maxlength=60)
>  industry = models.ForeignKey(Blog )
>
> So my question is how to get blog id from Entry field.??
> I mean I want to get all content in my Entry view function from blog..
>
> view function:
>
> def Entry(request, entryid):
>
>
>Entry = Entry.objects.get(id=entryid)
>
>blog = entry.blog
>
> I know blog will give me the correct value but I need the id so that I
> can iterate over it to get list of content associated to blog in entry
> view.
>
>
> thanks in advance..
>
> >
>

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



Foreign Key problem

2008-07-07 Thread smith

hi
As I am new to django I am having a lots of problem..
So my query is:

class Blog(models.Model):
name = models.CharField(maxlength=100)

class Entry(models.Model):
blog = models.ForeignKey(Blog)
headline = models.CharField(maxlength=255)

class  content(models.Model):
 name = models.CharField(maxlength=60)
 industry = models.ForeignKey(Blog )

So my question is how to get blog id from Entry field.??
I mean I want to get all content in my Entry view function from blog..

view function:

def Entry(request, entryid):


Entry = Entry.objects.get(id=entryid)

blog = entry.blog

I know blog will give me the correct value but I need the id so that I
can iterate over it to get list of content associated to blog in entry
view.


thanks in advance..

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



Still unable to log into the admin interface

2008-07-07 Thread Fernando Rodríguez

Hi,

I followed the advice I got here, and added 
django.contrib.auth
django.contrib.contenttypes
django.contrib.admin 

to settings.py and included the following pattern to urlsp.py:
(r'^admin/', include('django.contrib.admin.urls')),

I also included 
from django.contrib.auth.models import User from
django.contrib.contenttypes.models import ContentType
in mymodels.py.

BTW, I'm using the books example from "the definitve guide to
django" (chapter 6).

Whenever I try to access the admin app (localhost:8000/admin/) I get
this error page:


AttributeError at /admin/
'WSGIRequest' object has no attribute 'user'
  Request Method:
GET
Request URL:
http://localhost:8000/admin/
  Exception Type:
AttributeError
  Exception Value:
'WSGIRequest' object has no
attribute 'user'
Exception Location:
/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py in 
_checklogin, line 49


Traceback (most recent call last):
File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in
get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File
"/var/lib/python-support/python2.5/django/contrib/admin/views/decorators.py" in 
_checklogin
  49. if request.user.is_authenticated() and request.user.is_staff:

  AttributeError at /admin/
  'WSGIRequest' object has no attribute 'user' 

---

What am I STILL doing wrong?

Thanks in advance!




--~--~-~--~~~---~--~~
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: MediaTemple Containers

2008-07-07 Thread Niall McCormack

Yeah, I've tried contacting sales but they're a bit cagey too. I  
wonder if they're waiting for the 1.0 release

On 4 Jul 2008, at 07:30, j.gosier wrote:

>
> I'm not sure, I just submitted a support ticket the other day asking
> (mt) the very same question and they were mum on it.
>
>
>
> On Jun 30, 5:56 am, Niall McCormack <[EMAIL PROTECTED]>
> wrote:
>> Hi there,
>>
>> Does anyone know when the Media Temple Grid ServiceDjangoContainers
>> are going to launch?
>>
>> I'm considering transfering my hosting form Dreamhost to Media
>> Temple, but want to make use ofDjangofrom day 1...
>>
>> Any info would be grand!
>>
>> Cheers
>> Niall
>
> >


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

2008-07-07 Thread Ramdas S
I do not have an SMTP server on myserver.

But the mail settings (SMTP settings) is absolutely right, since it works
perfectly of my laptop and of another server.



On Mon, Jul 7, 2008 at 2:13 PM, Alaa Salman <[EMAIL PROTECTED]> wrote:

>
>
>
> On Jul 7, 10:49 am, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have this curious error that has been bothering me on a new server.
> This
> > is a simple program that sends out an email using an smtp server hosted
> > elsewhere.
> >
> > This sowks perfectly on my desktop with same mail settings, but fails
> with
> > this error on server
> >
> > http://dpaste.com/61070/
> >
> > Any suggestions
>
> Please always use a title so that people can know what your email or
> question is about.
>
> Now, for your problem, are you sure you have an smtp server set up on
> the machine? If its not on the machine, are you sure that you're
> defining the smtp host properly?
> >
>


-- 
Ramdas S
+91 9342 583 065
My Personal Blog: http://ramdas.diqtech.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: sidebar app

2008-07-07 Thread Mat

With regards to putting it in just the base.html file, look into inclusion
tags


http://www.djangoproject.com/documentation/templates_python/#inclusion-tags

Not used them before but I think they are what you need. I've used similar
things in other frameworks and they save a bunch of code and but rarely to
developers ever find/use them!

Mat

-Original Message-
From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Alaa Salman
Sent: 07 July 2008 09:41
To: Django users
Subject: Re: sidebar app




On Jul 7, 10:34 am, keegan3d <[EMAIL PROTECTED]> wrote:
> I am trying to create a sidebar and an running into some trouble. I
> have 2 problems:
>
> My model is pretty straight forward. I have categories and links under
> the categories.
>
> class Catagory(models.Model):
>         name = models.CharField(max_length=200)
>
>         ...
>
> class Link(models.Model):
>         catagory = models.ForeignKey(Catagory)
>         name = models.CharField(max_length=200)
>         url = models.CharField(max_length=200)
>         icon =
models.ImageField(upload_to=('upload/sidebar/icon/%Y/%m/%d'),
> blank=True)
>         newWin = models.BooleanField('Open in new window?')
>
>         ...
>
> The first problem I am trying to solve is how to format my template so
> that the appropriate links are under each category.
>
> It looks like "regroup" is the way to go, but I am not sure how to
> format the data in my view class so that "regroup" will work. Because
> the data is in two classes.
>
> The second problem I am having is I cant see a good way to use this
> app in all my web pages to populate the sidebar. Can you do an include
> of a view?

It doesn't matter how many classes your models are in. Just do a join
query to get the links with their associated categories, and send the
queryset to the template. Then regroup will work with that. Check out
the docs for regroup, it is really very simple. You basically just
tell it which of the fields will it group by.

You can define a custom tag if you want and use it in your templates,
or in your base template if they share one. Also, depending on your
specific scenario, i think you can use the include template tag and
include a template that defines this side bar in your other template
pages. Again, this is explain well in the docs.



--~--~-~--~~~---~--~~
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: Logout when Leaving

2008-07-07 Thread Christopher

Not sure how I missed that :)

Thanks

On Jul 7, 11:22 am, rui <[EMAIL PROTECTED]> wrote:
> I think the option: SESSION_EXPIRE_AT_BROWSER_CLOSE on settings.py
> would help you.
> Give it a try.
>
> More information on this 
> here:http://www.djangoproject.com/documentation/sessions/
>
> --
> The world is just awesome. Boom De Yada!
>
> On Mon, Jul 7, 2008 at 6:17 AM, Christopher <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to automatically log a user out when leaving the
> > website?
>
> > At the moment when the user logs in and leaved the site and comes back
> > the user is still logged in.
>
> > What is the best way to overcome this?  I want the user to have to log
> > in each time they come to the website.
>
> > Thanks for 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
-~--~~~~--~~--~--~---



Re: Logout when Leaving

2008-07-07 Thread rui

I think the option: SESSION_EXPIRE_AT_BROWSER_CLOSE on settings.py
would help you.
Give it a try.

More information on this here:
http://www.djangoproject.com/documentation/sessions/

--
The world is just awesome. Boom De Yada!


On Mon, Jul 7, 2008 at 6:17 AM, Christopher <[EMAIL PROTECTED]> wrote:
>
> Is there a way to automatically log a user out when leaving the
> website?
>
> At the moment when the user logs in and leaved the site and comes back
> the user is still logged in.
>
> What is the best way to overcome this?  I want the user to have to log
> in each time they come to the website.
>
> Thanks for 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
-~--~~~~--~~--~--~---



Logout when Leaving

2008-07-07 Thread Christopher

Is there a way to automatically log a user out when leaving the
website?

At the moment when the user logs in and leaved the site and comes back
the user is still logged in.

What is the best way to overcome this?  I want the user to have to log
in each time they come to the website.

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



Re: Syntax error: "can't assign to operator"

2008-07-07 Thread bruno desthuilliers


On 5 juil, 04:33, Leaf <[EMAIL PROTECTED]> wrote:
> Okay. I'll run a quick find-and-replace to set all my identifiers to
> use underscores instead of hyphens. I'm not that familiar with Python,
> so I assumed that it would recognize hyphens as a seperator and not a
> minus sign.

There are very few programming languages that allow hyphens or other
special chars in identifiers.

(snip)
> > > class Style(models.Model):
> > > Style-Name = models.CharField("Style Name", Max_length = 32,
> > > Default = "Styles Upon Styles", Help_text = "A user-friendly name for
> > > the style.")

And while we're at it, the naming conventions in Python are
"all_lower_with_underscore" for anything else than class names.
--~--~-~--~~~---~--~~
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:

2008-07-07 Thread Alaa Salman



On Jul 7, 10:49 am, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have this curious error that has been bothering me on a new server. This
> is a simple program that sends out an email using an smtp server hosted
> elsewhere.
>
> This sowks perfectly on my desktop with same mail settings, but fails with
> this error on server
>
> http://dpaste.com/61070/
>
> Any suggestions

Please always use a title so that people can know what your email or
question is about.

Now, for your problem, are you sure you have an smtp server set up on
the machine? If its not on the machine, are you sure that you're
defining the smtp host properly?
--~--~-~--~~~---~--~~
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   >