Re: Localize URLs

2009-03-12 Thread Dougal Matthews

You may want to consider trying django-cms. They support these feature
I believe. Of nothing else you could have a noesy at their code.

http://django-cms.org/

Dougal

On 12/03/2009, Bastien  wrote:
>
> Hello Django users,
>
> I've been scratching my head trying to find a solution to have URLs
> translated in various languages. So the typical 'about' would be
> translated in 'a propos' in french and whatever other languages, like
> all the static content. I also need to provide the user a way to write
> flatpages (and other types of dynamic content) with a unique URL so
> something like 'http://www.mysite.com/news/christmas_party' would
> translate to 'http://www.mysite.com/nouvelles/fete_de_noel' in french.
> I think you see what I mean.
>
> I couldn't find anything googling and although I understand the
> readability argument I don't know if it's a good idea technically
> speaking. Any help, point of view, documentation, already exisiting
> app would be welcome.
>
> Thanks
>
> >
>

-- 
Sent from my mobile device

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Localize URLs

2009-03-12 Thread Dougal Matthews
OH yeah, Make sure you look at the cms2 branch in SVN. It's wy
better!<http://trac.django-cms.org/trac/browser/branches/django-cms2>
http://trac.django-cms.org/trac/browser/branches/django-cms2
Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/12 Bastien 

>
> Thanks Dougal, I think you're right about django-cms supporting this
> feature, I'm going to dive in their code.
>
> Bastien
>
> On Mar 12, 2:40 pm, Dougal Matthews  wrote:
> > You may want to consider trying django-cms. They support these feature
> > I believe. Of nothing else you could have a noesy at their code.
> >
> > http://django-cms.org/
> >
> > Dougal
> >
> > On 12/03/2009, Bastien  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hello Django users,
> >
> > > I've been scratching my head trying to find a solution to have URLs
> > > translated in various languages. So the typical 'about' would be
> > > translated in 'a propos' in french and whatever other languages, like
> > > all the static content. I also need to provide the user a way to write
> > > flatpages (and other types of dynamic content) with a unique URL so
> > > something like 'http://www.mysite.com/news/christmas_party'would
> > > translate to 'http://www.mysite.com/nouvelles/fete_de_noel'in french.
> > > I think you see what I mean.
> >
> > > I couldn't find anything googling and although I understand the
> > > readability argument I don't know if it's a good idea technically
> > > speaking. Any help, point of view, documentation, already exisiting
> > > app would be welcome.
> >
> > > Thanks
> >
> > --
> > Sent from my mobile device
> >
> > ---
> > Dougal Matthews - @d0ugalhttp://www.dougalmatthews.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Where do we put our templates?

2009-03-14 Thread Dougal Matthews
You can put them where you want but generally they go inside the application
folder that uses that template.

You may find this an interesting/helpful read;
http://www.djangobook.com/en/2.0/chapter04/

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/14 Joshua Partogi 

>
> Dear all,
>
> As I am still new to django, I have a question about the best practice
> for placing templates. Do we put it inside the project folder or under
> webserver directory?
>
> Best regards,
>
> --
> If you can't believe in God the chances are your God is too small.
>
> Read my blog: http://joshuajava.wordpress.com/
> Follow me on twitter: http://twitter.com/jpartogi
>
> >
>

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



Re: Strip empty lines in rendered templates?

2009-03-15 Thread Dougal Matthews
Something like this might be able to help you?

http://www.davidcramer.net/code/369/spaceless-html-in-django.html
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/15 Benjamin Buch 

>
> Hi,
>
> is there a way to tighten up the output that Django renders?
> Especially, remove the empty lines?
>
> This template code:
>
> 
> {% for entry in entries %}
> {{ entry.title }}
> {% endfor %}
> 
>
> looks like this when rendered:
>
> 
>
> Title 1
>
> Title 1
>
> Title 1
>
> 
>
> I stumbled upon this middleware,
> http://code.djangoproject.com/wiki/StripWhitespaceMiddleware,
> but the discussion around it is somewhat dated,
> and even the author states that there are some problems with it.
> http://code.djangoproject.com/wiki/ContributedMiddleware
>
> Is there any other way to handle it?
>
> benjamin
>
> >
>

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



Re: Vanity urls: Eg mysite.com//....

2009-03-15 Thread Dougal Matthews
Hi,
I've used a similar approach once - works fine. Although, you might want to
sacrifice such a short url for something that is easier to read/understand
that 'u' and 'g'.

Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/15 ldm999 

>
> I'm using Django Auth and would like to include username in my urls.
> So, eg, I might have urls like the following:
>
> - mysite.com/tom/books/moby-dick
> - mysite.com/dick/books/moby-dick
> - mysite.com/harry/books/catch-22
>
> To further complicate things, I'd like to support groups too. So that
> first url param could be a group name (eg seattle-reading-club)
>
> So now I'm thinking of using a letter to designate if the url is for a
> user or a group. Something like:
>
> - mysite.com/u/tom/books/moby-dick
> - mysite.com/g/seattle-reading-group/moby-dick
>
> Anyone else done something like this? Any problems with this approach?
> >
>

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



Re: Where do we put our templates?

2009-03-15 Thread Dougal Matthews
Correct, basically as long as Python can access it your all good. Just put
it somewhere that makes sense.
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/15 Joshua Partogi 

>
> Thanks Doug.
>
> I kinda get the gist now. It seems that template is parsed internally
> by django so it doesn't matter where I put it, which is quite contrary
> to static files like js/css/images.
>
> Kind regards,
>
> On Mar 15, 12:25 am, Dougal Matthews  wrote:
> > You can put them where you want but generally they go inside the
> application
> > folder that uses that template.
> >
> > You may find this an interesting/helpful read;
> http://www.djangobook.com/en/2.0/chapter04/
>
> >
>

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



Re: latitude/longitude field type

2009-03-16 Thread Dougal Matthews
That looks very cool for me and quite useful but I don't think the
django-googlemap supports the DMS format.
Also its not Django 1.0 ready.

Sergio, Don't you just want to create a custom field with a regular
expression validator for DMS?

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/16 Javier Santana 

>
> GLatLng looks a good start:
> http://django-googlemap.googlecode.com/svn/trunk/geo/googlemap/models.py
>
> On Sun, Mar 15, 2009 at 11:32 PM, Sergio  wrote:
> >
> > Hello,
> >
> > I'm working on field validation for latitude and longitude. I need to
> > validate them according to the DMS (degree, minutes, seconds) format.
> > I was wondering if there is already a django field model extension for
> > this. I know about geodjango, but that is too much for my needs.
> >
> > Cheers, Sergio
> > >
> >
>
> >
>

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



Re: Simple sites framework question

2009-03-16 Thread Dougal Matthews
I think these are the relevant docs you need;
http://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/16 bax...@gretschpages.com 

>
> In my model, I've got
>
>sites = models.ManyToManyField(Site)
>
> In a signal, I want to check which site(s) that model has been
> assigned to, not which site their currently on. I need something like
>
> if instance.sites.id == 1:
>   do stuff
>
> Of course, that doesn't work. How do I do 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Strip empty lines in rendered templates?

2009-03-16 Thread Dougal Matthews
You could adapt that middlewear to make it only stop blank lines I'm sure.
I use it for one website and its only used in the production version, in my
settings for the dev version it doesn't include that middlewear so it
doesn't effect any front end development.

Only thing to be aware of is it messes up some tags, like  and


Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/16 Benjamin Buch 

>
> Thank you for your replies!
>
> What I essentially want to do is:
> 1: Keep the template output readable for the frontend coder I'm
> working with
> 2: Keep the templates readable for me.
>
> @Dougal:
> I think the solution you suggested is great when someone wants to keep
> the size of the rendered template to a minimum.
> But as it strips really all whitespace, all linebreaks and everything,
> the result is perfectly machine readable
> but nothing that would make my frontend coder be happy.
>
> @Tim:
> This solution would give me the desired output, but the templates get
> less readable for me this way.
>
> What I figured out:
>
> I gave the StripWhitespaceMiddleware I mentioned a try,
> and it works reasonably well.
> It just strips empty lines but keeps the indentation the tags have in
> the template,
> so you've got reasonable control over how the rendered templates look
> like.
>
> The downsides I see so far are:
> - You can't add empty lines to structure the rendered template
> - Multiline output from template variables are not indented (e.g.
> something like {{ entry.body|markdown }})
>
> I have no solution for the add-empty-line-problem,
> but I wrote a template tag that indents the output of a multiline
> variable.
> It's not perfect (it destroys all indentation that is output by
> markdown..) but it works for me:
>
> class IndentNode(Node):
> def __init__(self, nodelist, indent_level):
> self.indent_level = indent_level
> self.nodelist = nodelist
>
> def render(self, context):
> rendered = self.nodelist.render(context)
> lines = rendered.split('\n')
> for i in range(len(lines)):
> if lines[i]:
> lines[i] = ' ' * int(self.indent_level) +
> lines[i].strip(' ')
> rendered = ''
> for line in lines:
> rendered += line + '\n'
> return rendered
>
> def do_indent(parser, token):
> bits = token.contents.split()
> try:
> indent_level = bits[1]
> except IndexError:
> indent_level = 0
> nodelist = parser.parse(('endindent',))
> parser.delete_first_token()
> return IndentNode(nodelist, indent_level)
>
> You would use it like this:
>
> {% indent 8 %}
> {{ entry.body|markdown }}
> {% endindent %}
>
> An other solution I tried but rejected was to use Beatiful Soups
> 'prettify'-method in a middleware:
>
> class BeautifulSoupMiddleware:
> def process_response(self, request, response):
> new_content = BeautifulSoup(response.content).prettify()
> response.content = new_content
> return response
>
> But the output was a little to shaky, so I can't recommend it.
>
>
> benjamin
>
>
>
>
>
> >
>

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



Re: Port in use Error

2009-03-16 Thread Dougal Matthews
It means another program is using the port you are trying to use. Do you
have another server running? or skype by any chance?
If you can still view the website in the browser, its not a problem. If you
can't you should use another port or close the program using the same port.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/16 TP 

>
> After creating a new project, when running manage.py i get the
> following:
>
>
> Validating models...
> 0 errors found
>
> Django version 1.0.2 final, using settings 'mylu.settings'
> Development server is running at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Error: That port is already in use.
>
>
>
> Despite saying 0 errors at the top, is this still a problem?
>
> >
>

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



Re: User, Auth, Group

2009-03-17 Thread Dougal Matthews
The permission system doesn't understand the concept of users 'owning'
things. Therefore, the permissions apply to everything. Can all, can change
any or can delete any.
This is something you need to implement yourself. You can do things to
filter the admin so they only see models they edited. I wrote an example of
that here;
http://blog.dougalmatthews.com/2008/10/filter-the-django-modeladmin-set/

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/17 Bro 

>
> Hi,
>
> I am using the User model with additional information. This model is
> called : MyUser.
> I try to use permission with group in admin but I have 'can add', 'can
> change', 'can delete'.
> When I give a 'can change' permission, a MyUser login, he can change
> every MyUser.
>
> My question is how do I give to MyUser the permission to only change
> his data ?
>
> Thanks by 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User, Auth, Group

2009-03-17 Thread Dougal Matthews
Indeed, the admin doesn't really enforce this. The admin is for trusted
users and thus the filter just helps people out but isn't for security.
You would be better building your custom admin I think. If you start using
model forms etc. its not really that hard.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/17 Bro 

>
> Thanks for your help, it works and filter nicely.
>
> But if in the url I change de ID from /1/ to /2/,
> I can access to others MyUser and modify everythings.
> The auth module can't be used for this kind of authentification ?
>
> If I have to implement myself, should I implement this outside the
> admin part ?
>
> Thanks
>
> Bro
>
> On Mar 17, 12:56 pm, Dougal Matthews  wrote:
> > The permission system doesn't understand the concept of users 'owning'
> > things. Therefore, the permissions apply to everything. Can all, can
> change
> > any or can delete any.
> > This is something you need to implement yourself. You can do things to
> > filter the admin so they only see models they edited. I wrote an example
> of
> > that here;
> http://blog.dougalmatthews.com/2008/10/filter-the-django-modeladmin-set/
> >
> > Dougal
> >
> > ---
> > Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/
> >
> > 2009/3/17 Bro 
> >
> >
> >
> > > Hi,
> >
> > > I am using the User model with additional information. This model is
> > > called : MyUser.
> > > I try to use permission with group in admin but I have 'can add', 'can
> > > change', 'can delete'.
> > > When I give a 'can change' permission, a MyUser login, he can change
> > > every MyUser.
> >
> > > My question is how do I give to MyUser the permission to only change
> > > his data ?
> >
> > > Thanks by 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Setting up Facebook Connect for your test environment

2009-03-17 Thread Dougal Matthews
I don't really know much about Facebook Connect... but I assume the
xd_reciever is called by Facebook? As in they make requests to it?
Well then they will need access to it so localhost wont work. If you have
set up your network to allow it, they could access you via your IP address?
http://123.123.123.123/xd_reciever/ ? However, you will need to make the
django dev server viewable externally (other than from the localhost) - I'm
not sure how/if you can do that.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/17 Roboto 

>
> Hey guys,
>
> I'm trying to get facebook connect to work on my django site.  I've
> hit a little snag where I imagine many of you just walked passed, but
> I'm clueless right now.
>
> My runserver runs on localhost:8000  --- but when I setup facebook
> connect the app is looking for http:///xd_receiver
>
> Any ideas how I jump this hurdle?
>
> Thanks
>
> Actual error message below
> Invalid Argument
>
> The Facebook Connect cross-domain receiver URL (http://localhost:8000/
> xd_receiver.htm#fname=_opener&%7B%22t%22%3A3%2C%22h%22%3A
> %22fbCancelLogin%22%2C%22sid%22%3A%220.982%22%7D) must have the
> application's Connect URL (http://www.) as a prefix. You can
> configure the Connect URL in the Application Settings Editor.
> >
>

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



Re: Username Blacklist

2009-03-17 Thread Dougal Matthews
and that would just to be too easy!
You could use subdomains for the other parts of the site? would also be an
easy/clean solution.

or just have the other pages above the users in the url conf and register
the other usernames yourself so nobody else can and they wont be viewable
anyway.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/17 Andrew Turner 

>
> 2009/3/17 P M :
> > why don't you use
> > ABSOLUTE_URL_OVERRIDES = {
> >'auth.user': lambda o: "/user/%s/" % o.username,
> > }
> >
> > so username will not collide with application name !!!
> > Greetings.
> > Puneet
>
> Because I wanted the user's home page to be of the form
> http://mydomain.com/username !!
>
> >
>

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



Re: Model inheritance vs. User.get_profile()

2009-03-17 Thread Dougal Matthews
get_profile is newer than model inheritance I believe.
Working with profile is how everybody seems to be doing it, so follow the
trend and it'll make every bodies lives easier ;)

If you really want to read more about it, there is loads of chatter on the
subject so to avoid reppetition;
http://www.google.co.uk/search?q=django+extending+user (granted, lots of it
is old)

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/17 ntoll 

>
> Guys,
>
> Asking for advice here.
>
> What is the best way to extend the User class in
> django.contrib.auth.models...?
>
> I could either inherit the class for my own model and add fields /
> methods or use get_profile(). Now, whilst I realise that get_profile()
> is the official advice it seems a tad out-of-date now that there is
> model inheritance (for which get_profile() provided a means of
> overcoming).
>
> Pros/cons of each method? To my mind inheriting from User class is
> more elegant... but would love to know your thoughts on this.
>
> All the best,
>
> ntoll
>
> >
>

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



Re: simple venue representation

2009-03-18 Thread Dougal Matthews
If you just want to store the location you could just store the address or
latitude and longatude in the model? I think GeoDjango has way more than
you'll need unless your missing out some features...
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/18 Viktor Nagy 

> Hello,
>
> I'm building a conference application, and would like to have a nice
> representation of the conference venues.Do you have any ideas what might be
> the best way to do it?
>
> I was thinking about geodjango, but after havign a look at it, I have the
> feeling that it would be overly complicated for my needs.
>
> My basic idea could be represented with the following model:
> class Venue(models.Model):
>   title = models.CharField
>   gurl = models.URLField # a url to include a google maps
>
> And then I would add a venue to every conference. Do you have any
> suggestions? Should I use geodjango or is such a simple model a good idea?
>
> Thanks for you help!
> Viktor
> --
> Viktor Nagy - http://viktornagy.com
> PhD student
> Toulouse School of Economics
>
> >
>

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



Re: Map events in space on a django app

2009-03-20 Thread Dougal Matthews

You might find this useful. It's an app aimed at google map usage with django.

http://code.google.com/p/django-googlemap/

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/





2009/3/20 Alessandro :
>
> On Fri, Mar 20, 2009 at 3:23 AM, Andy Mckay  wrote:
>>
>>
>> You need two fields on a model, longitude and latitude. The rest of it
>> is pure Javascript to place the pin on a map. You can see javascript I
>> used for my site on http://www.cleartrain.ca, if you really want to
>> see the code behind the scenes, I can share some with you in private.
>
> If you can, I'll really appreciate to see the code you use for google maps.
>
> --
> 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 1 django project, 2 targets (fastcgi and GAE) - best practices?

2009-03-25 Thread Dougal Matthews

I've never actually tried this but i often hear it mentioned. It may
do what you need (or at least, help)...
http://code.google.com/p/google-app-engine-django/

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/





2009/3/25 cgarvey :
>
> Hi,
>
> Does anyone here maintain a Django project codebase that gets deployed
> to Google App Engine, *and* to standalone targets like fast_cgi or
> something similar?
>
> If so, what are the best practices for managing the different model
> types? Is there an easy way to switch between the 2 (i.e. with a
> variable in settings), so that code management is easier?
>
> I'm thinking of writing a parser script to generate 2 different sets
> of model files for GAE and standard Django (models.Model) models, from
> a standard format (my own!) (so 1 file, with DB definitions, for code
> management).
>
> Anyone have a better approach, or has this been done already (and I'm
> just missing the necessary Google skills)?
>
> Cheers, in advance, for any pointers.
>
> .cg
>
> >
>

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



Re: Django wont display images on my CSS file

2009-03-27 Thread Dougal Matthews

Isn't it just because you don't have quotes around the image address?

background: url('/site_media/header_background.gif') no-repeat top left;

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/27 Brian Neal :
>
> On Mar 27, 7:33 am, Gath  wrote:
>> Guys,
>>
>> Am having a problem in displaying images in my CSS file.
>>
>> I have a css file with the following class
>>
>> .header
>> {
>>  margin-left: auto;
>>  bla bla
>>  bla bla
>>  ...
>> background: url(/site_media/header_background.gif) no-repeat top left;
>>
>> }
>>
>> When i execute the template with this css, no image is displayed!
>> But when i directly inject the background style on my template it
>> works perfect.
>>
>> What am i not doing right!
>>
>
> I seem to recall that when you put references to files in your CSS,
> they are relative to that CSS file, not to the document root. So if
> that graphic file is in the same directory as your CSS file, change
> your url to:
>
> background: url(header_background.gif) no-repeat top left;
>
> Best,
> BN
> >
>

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



Re: Installing Django

2009-03-28 Thread Dougal Matthews

Your not giving us anything to go on here. How far do you get? do you
get any errors?

I am assuming you followed the very detailed instructions here;
http://docs.djangoproject.com/en/dev/topics/install/#topics-install

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/28 stars :
>
> I'm totally new at Python and Django and I'm having trouble with the
> installation. I'm running windows vista and I have downloaded pyhton
> 2.6. So basically, I went through the install directions a millon
> times, and nothing worked..
>
> I need someone to walk me through it, step by step so I know exactly
> what I'm doing.
>
> thanks!
>
> >
>

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



Re: QuerySet.only()?

2009-03-30 Thread Dougal Matthews

I think you are looking for get()

facilityList = Facility.objects.get(name = facilityName)

http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups


Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/30 famousactress :
>
> Hello folks. I'm new to python, new to Django, but very old to ORMs
> (via Java's Hibernate, mostly)...
>
> I naively assumed that QuerySet.filter() would return me None, if
> there were no results. Instead it returns an empty list. That's not
> terrible, but for some things, it can make code more cumbersome.
> Consider the following:
>
> def ensureFacilityExists(facilityName):
>
>  facilityList = Facility.objects.filter(name = facilityName)
>
>  if len(facilityList) == 1:
>    return facilityList[0]
>  elif len(facilityList == 0:
>    facility = Facility(name = facilityName)
>    facility.save()
>    return facility
>  else:
>    raise Exception("More than one facility with that name!")
>
>
> This is a bit clunky for this case. I looked for a method on QuerySet
> that would clean this up, but didn't find one. I may have missed
> something. Here's what I did to clean my case up though:
>
> def ensureFacilityExists(facilityName):
>
>  facility = Facility.objects.filter(name = facilityName).only()
>
>  if facility == None:
>    facility = Facility(name = facilityName)
>    facility.save()
>
>  return facility
>
>
> ... In order to do this, I added the only() method to QuerySet:
>
> def queryset_only(self):
>  i = len(self)
>  if i == 0:
>    return None
>  elif i > 1:
>    raise Exception("More than one element in this querySet!!")
>  else:
>    return self[0]
>
> import new
> from django.db.models.query import QuerySet
> QuerySet.only = new.instancemethod(queryset_only,None,QuerySet)
>
>
> My question is:
>
> Is there another facility for doing this already built into Django's
> ORM? If not, is this a change that seems valuable to anyone else?
>
> Thanks,
> Phill
>
> >
>

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



Re: Is Django right for me?

2009-03-31 Thread Dougal Matthews
You might want to look at the Django templating system. It's far more
powerful and flexible than using a simple PHP script and including other
files.
Django wouldn't be overkill - it would make all of the features you
mentioned really easy as it does them out of the box. Allowing you to spend
all your time working on the website itself rather than repeating (or self
maintaining) the building blocks.

I moved over from PHP and haven't looked back.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/3/31 Dotan Cohen 

>
> I have been writing websites as a hobby in PHP for a few years, but I
> want to switch to Python for various reasons. I have been advised to
> look into Django, but I am not sure that it fits my needs. My sites
> are mostly static HTML, generated from a header.inc and footer.inc
> file with code like $title and the page including that
> sets the $title variable before calling the include. This way, I don't
> have to code the website design into each page, and I can make changes
> to just the include files to be propogated across the site. I also
> have some pages the interact with a MySQL database, and I parse the
> query string extensively in those situations to keep friendly urls.
> See my photo gallery, for instance, which is all database driven, but
> has nice urls for all pages:
> http://dotancohen.com/eng/pictures/index.html
>
> Would Django be overkill for this type of website? Is there a better
> alternative? One of my goals in switching to Python is to broaden my
> exposure to the language as I intend to move into developing Qt
> applications soon.
>
> Thanks for any and all advice.
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> >
>

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



Re: Is Django right for me?

2009-03-31 Thread Dougal Matthews
Django uses an ORM - so you don't (usually) need to query the database
directly.
Why don't you go through the Django tutorial and try it out?

http://docs.djangoproject.com/en/dev/#first-steps

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/3/31 Dotan Cohen 

>
> > You might want to look at the Django templating system. It's far more
> > powerful and flexible than using a simple PHP script and including other
> > files.
> > Django wouldn't be overkill - it would make all of the features you
> > mentioned really easy as it does them out of the box. Allowing you to
> spend
> > all your time working on the website itself rather than repeating (or
> self
> > maintaining) the building blocks.
> > I moved over from PHP and haven't looked back.
> > Dougal
> >
>
> Actually, I do want to build and maintain the building blocks! That is
> my reason for moving the sites to Python, to increase my knowledge of
> the language.
>
> I have tried googling for examples of MySQL database interaction with
> Django and with Python, but I couldn't really find anything that would
> give me an idea of what I'm getting into. In PHP, I simply connect to
> the database, declare UTF-8, then make a query. Each step is done in a
> line of code or three. This seems to be in line with both Python and
> Django. However, in PHP there are many rich functions for manipulating
> the data returned from the query. Python does not seems to have
> functions meant for manipulating returned queries, and I could not
> find any mention of whether or not Django does. I did find MySQLdb on
> the Django site which seems to apply to Python as well, but I'm not
> really sure what it helps with.
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> >
>

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



Re: Modifu request.user

2009-03-31 Thread Dougal Matthews
Why do you want to change the request object? Why are you trying to store a
user object? Perhaps you want to store it in a session?
I think you should explain what you are trying to do.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/3/31 Masarliev 

>
> yes it's bad idea. other solution is to create additional object
> similar to request.user for example request.additional. How can i do
> that.
>
> On Mar 31, 4:17 pm, Jeff FW  wrote:
> > Changing request.user.id doesn't make sense--that would be trying to
> > change the id of the user object itself.  I think what you're trying
> > to do is change the user that is actually logged in... right?  If
> > that's true, then you need to set request.user *not* request.user.id--
> > but that seems like a very bad idea, and it won't (I think) change it
> > in the session.  What are you trying to accomplish?
> >
> > -Jeff
> >
> > On Mar 31, 2:35 am, Masarliev  wrote:
> >
> > > I have a application but i have error in base logic and I need to
> > > change request.user.id.
> > > Is it posible to do that
> > > I tried request.user.id =  but with no result
> >
>

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



Re: how to django to request a page of the other domain

2009-04-01 Thread Dougal Matthews
It depends what data your fetching I suppose but you might just want to use
urllib?
JavaScript triggers a view that makes a request to the remote server and
outputs the result to your javascript.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/1 Albert 

>
> cross domain ajax request is not allowed ,so I decide to use proxy on
> the server side
> but I don't know how to finish this, anyone point me some url?
>
> >
>

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



Re: Django Tutorial, Part 3

2009-04-02 Thread Dougal Matthews
You error is in urls.py
You have; *include('mysite/polls/urls')),*
you should have; *include('mysite.polls.urls')),*

The path is written python module style (with dots) rather than directory
style (with slashes)


Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/2 Loewe, Rosemarie 

> Hello django-user Daniel Roseman,
>
> many thanks for your quick response. In the attachment are
> - and the error messages displayed in Browser (Firefox).
> - the django project, what I have generated like shown in Django Tutorial
> (until part 3)
>
> I hope you can do something with this information.
>
> Best regards
> R. Loewe (rorocam)
>
> 
>
> Von: django-users@googlegroups.com im Auftrag von Daniel Roseman
> Gesendet: Do 02.04.2009 12:53
> An: Django users
> Betreff: Re: Django Tutorial, Part 3
>
>
>
>
> On Apr 2, 8:35 am, rorocam  wrote:
> > Hello ...,
> >
> > I have problems with the "Decoupling the URLconfs". I did, as Django
> > Tutorial (Part 3) shows me, but it does not work, the browser shows
> > following error:
> >
> > > ImportError at /polls/
> > > Import by filename is not supported.
> >
> > What is wrong with my application? I have installed Python 2.6 and
> > Django 1.0.2 at Windows XP.
> >
> > Thanks, for giving me an answer.
> >
> > Best regards
> > Rosemarie Loewe
>
> You haven't given nearly enough information for us to solve this
> problem. What is the full traceback? What is the code where the
> problem occurs?
> --
> DR.
>
>
>
>
> >
>

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



Re: Django Tutorial, Part 3

2009-04-02 Thread Dougal Matthews
Daniel and everybody else can see my reply like I can see your reply to him
;)
Just so you know you don't need to reply to each of us individually...

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/2 Loewe, Rosemarie 

> Hello Daniel,
>
> just I got a mail of another user, he had the correct answer and now it
> works.
> I have no further need for help.
>
> Best regards
> Rosemarie
>
>
> 
>
> Von: django-users@googlegroups.com im Auftrag von Daniel Roseman
> Gesendet: Do 02.04.2009 12:53
> An: Django users
> Betreff: Re: Django Tutorial, Part 3
>
>
>
>
> On Apr 2, 8:35 am, rorocam  wrote:
> > Hello ...,
> >
> > I have problems with the "Decoupling the URLconfs". I did, as Django
> > Tutorial (Part 3) shows me, but it does not work, the browser shows
> > following error:
> >
> > > ImportError at /polls/
> > > Import by filename is not supported.
> >
> > What is wrong with my application? I have installed Python 2.6 and
> > Django 1.0.2 at Windows XP.
> >
> > Thanks, for giving me an answer.
> >
> > Best regards
> > Rosemarie Loewe
>
> You haven't given nearly enough information for us to solve this
> problem. What is the full traceback? What is the code where the
> problem occurs?
> --
> DR.
>
>
>
>
> >
>

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



Re: How do i use dojo in my Django application

2009-04-02 Thread Dougal Matthews
It kinds depends what you want to do really.
JavaScript is run inside the browser and Django is running on your website.
So it doesn't even know what Django or Python is, however they can
communicate and pass data.

By using it with Django, do you mean you want to do some Ajax stuff?
If that's the case then you will want to decide how you are going to pass
data. You can then just make your views return the appropriate data, be that
chunks of HTML, JSON or XML etc.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/2 Gath 

>
> All,
>
> I have downloaded Dojo 1.3, i want to start sampling some examples  in
> the Dojo website using Django, where do i place the package? How do i
> call it in my template?
>
> Gath
> >
>

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



Re: Beginner's Help needed

2009-04-05 Thread Dougal Matthews
It depends how you mean combine really. You can have them both running on
the same server, you can have them share the same database (then you can
still manage it with django)
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/5 atik 

>
> Ok. Again Thanks. I will do it.
> Can i combine django application with PHP?
> >
>

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



Re: User Profile Problem

2009-04-07 Thread Dougal Matthews
Why do you want to change the User model?
This might be a useful read for you if you want to store more info about a
user...
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/7 hc w 

> Hii, all
>
> I just want to add a foreign key--'FourS'-- to the user model .I have
> modified it as following.it works on our dev env in windows but failed in
> product env in linux ( apache2.0.54 +mod_python3.3.1+prefork mode)  .  Can
> anyone tell me why and some solution?  Thanks
>
> MODEL:
>
> from django.db import models
> from django.contrib.auth.models import User
> from cyt.glorail.models import FourS
>
> from django.contrib.admin import validation
>
> # Create your models here.
> #class UserProfile(models.Model):
> #user = models.ForeignKey(User,unique=True)
> #dealer = models.ForeignKey(FourS)
> #class Meta:
> #db_table = u'auth_userprofile'
>
> from django.contrib.auth.admin import UserAdmin
> import datetime
> class ProfileBase(type):
> def __new__(cls, name, bases, attrs):
> module = attrs.pop('__module__')
> parents = [b for b in bases if isinstance(b, ProfileBase)]
> if parents:
> fields = []
> for obj_name, obj in attrs.items():
> if isinstance(obj, models.Field): fields.append(obj_name)
>
> User.add_to_class(obj_name, obj)
> UserAdmin.fieldsets = list(UserAdmin.fieldsets)
> UserAdmin.fieldsets.append((name, {'fields': fields}))
> return super(ProfileBase, cls).__new__(cls, name, bases, attrs)
>
> class Profile(object):
> __metaclass__ = ProfileBase
>
> class MyProfile(Profile):
> dealer = models.ForeignKey(FourS)
> #dealer = models.IntegerField(null=True,
> blank=True,db_column='dealer_id')
>
> ERROR MESSAGE:
>
> ImproperlyConfigured at /admin/auth/user/1/
> 'UserAdmin.fieldsets[5][1]['fields']' refers to field 'dealer' that is
> missing from the form.Request Method: GET
> Request URL: http://192.168.0.116/admin/auth/user/1/
> Exception Type: ImproperlyConfigured
> Exception Value: 'UserAdmin.fieldsets[5][1]['fields']' refers to field
> 'dealer' that is missing from the form.
> Exception Location:
> /usr/local/lib/python2.5/site-packages/django/contrib/admin/validation.py in
> check_formfield, line 254
> Python Executable: /usr/local/bin/python
> Python Version: 2.5.4
> Python Path: ['/pyweb', '/usr/local/lib/python2.5/site-packages/django',
> '/usr/local/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',
> '/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg',
> '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
> '/usr/local/lib/python2.5/plat-linux2', '/usr/local/lib/python2.5/lib-tk',
> '/usr/local/lib/python2.5/lib-dynload',
> '/usr/local/lib/python2.5/site-packages']
>
>
> --
> 好玩贺卡等你发,邮箱贺卡全新上线! >
> <http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: euro djangocon talks

2009-04-20 Thread Dougal Matthews

Probably best to ask @djangocon or @robertlofthouse on twitter.


Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/4/20 Aljosa Mohorovic :
>
> anybody has any information about possible euro djangocon talks?
> or any idea when will talks schedule be available?
>
> Aljosa Mohorovic
> >
>

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



Re: Models Aliases

2009-04-20 Thread Dougal Matthews
why don't you just access entry.author rather than entry.user?
I think perhaps I'm not quite following your question.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/20 Bastien 

>
> Hi,
>
> I searched the doc but couldn't find anything about this: I have a
> model for a blog entry that contains a foreign key to user and is
> named author. But that would be really convenient for me if the object
> would respond to the keyword 'user' as well: entry.user doesn't exist
> in the model but I would like it to return what entry.author usually
> returns, just like an alias. Does anything like that exists in Django?
> is it considered good practice? I could just use the author key or
> rename it to user but what happens is that I have various applications
> that already work with either object.user or object.author and I don't
> want to rewrite them all. Thanks.
> >
>

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



Re: How to relate child instance to Parent?

2009-04-20 Thread Dougal Matthews

I think its as simple as;

x = Staff()
user_obj = x.user

I found that by just printing out the result of dir(Staff()) ;)

I think however, you want to add to add a subclass for a user that
already exists. I'm not sure how you can do that, or if you can. The
recommended guide to extending/adding to the user object is here;
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

You might find that way easier.

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/4/20 Joshua Partogi :
>
> Dear all,
>
> I have an inheritance model as such:
>
> class User(models.Model)
>
> class Staff(User)
>
> Now I already have the instance of User inside view:
>
> user = User.objects.create(name="Joe")
>
> now how do I relate this user instance to the staff instance?
>
> I tried looking in the documentation but can not find anything about it.
>
> Thank you very much in advance.
>
> --
> If you can't believe in God the chances are your God is too small.
>
> Read my blog: http://joshuajava.wordpress.com/
> Follow us on twitter: http://twitter.com/scrum8
>
> >
>

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



Re: How to relate child instance to Parent?

2009-04-21 Thread Dougal Matthews
in #1 I think you meant;
user.save()
staff = Staff()
staff.user = user
staff.save()

That might work. Otherwise, I'm not sire.

Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/21 Joshua Partogi 

>
> Darn,
>
> It's really difficult to reference a child instance to a parent if the
> parent already exists in database with django :-(
>
> I tried this:
> 1.
> user.save()
> staff = Staff()
> staff = user
> staff.save()
> --> The data is not saved to the DB :-(
>
> 2.
> user.save()
> staff = Staff.objects.get(id=user.id)
> staff.save()
>
> --> returned object already exist in DB error
>
>
> Aarrrgh.
>
> Anybody got another trick for this?
>
>
> On Apr 21, 1:25 am, Dougal Matthews  wrote:
> > I think its as simple as;
> >
> > x = Staff()
> > user_obj = x.user
> >
> > I found that by just printing out the result of dir(Staff()) ;)
> >
> > I think however, you want to add to add a subclass for a user that
> > already exists. I'm not sure how you can do that, or if you can. The
> > recommended guide to extending/adding to the user object is here;
> http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-...
> >
> > You might find that way easier.
> >
> > Cheers,
> > Dougal
> >
> > ---
> > Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/
> >
> > 2009/4/20 Joshua Partogi :
> >
> >
> >
> > > Dear all,
> >
> > > I have an inheritance model as such:
> >
> > > class User(models.Model)
> >
> > > class Staff(User)
> >
> > > Now I already have the instance of User inside view:
> >
> > > user = User.objects.create(name="Joe")
> >
> > > now how do I relate this user instance to the staff instance?
> >
> > > I tried looking in the documentation but can not find anything about
> it.
> >
> > > Thank you very much in advance.
> >
> > > --
> > > If you can't believe in God the chances are your God is too small.
> >
> > > Read my blog:http://joshuajava.wordpress.com/
> > > Follow us on twitter:http://twitter.com/scrum8
> >
>

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



Re: dynamic form wizards

2009-04-23 Thread Dougal Matthews
First result in a google search for "django dynamic forms" gives you this;
http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
Just so happens I read it today and found it useful.

You can create your form fields on the fly in the __init__, I've got a form
thats completely generated from my models.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/4/23 Dennis Schmidt 

>
> Hi there,
>
> I need to dynamically create complex forms in my application. Since
> version 1.0 django has these form wizards, which can manage complex
> forms quite well.
> Now my only problem is, that they apparently have to be statically
> mapped by the urls.py. But what I need is a different set of forms for
> the wizard, depending of an ID specified in the URL.
>
> ie /order/1/accept/ shall use OrderAcceptionWizard([OrderPartOneForm,
> OrderPartTwoForm]) but
> /order/2/accept/ shall use OrderAcceptionWizard([OrderPartOneForm,
> OrderPartThreeForm]).
>
> any idea if this is somehow possible?
> >
>

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



Re: "-" in template variables

2009-05-10 Thread Dougal Matthews
>From the docs;
"Variable names must consist of any letter (A-Z), any digit (0-9), an
underscore or a dot."

http://docs.djangoproject.com/en/dev/ref/templates/api/#rendering-a-context

I suppose you could write a template tag to handle it or something. Not
sure.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/10 Danne 

>
> I'm using the Tumblr (http://www.tumblr.com) REST Api, and keys in
> returned json contains the character "-", like "post": {"regular-
> title": "asdf" .}. I'm having trouble printing this in the django
> templates since regular-title is an invalid variable name. I've tried
> stuff like: post["regular-title"], post[regular-title], post.regular-
> title and so on, and searched around the docs and mailing lists, but
> haven't found any answers.
>
> Is there a way to print template variables with "-" in their 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Overwrite send_mail

2009-05-10 Thread Dougal Matthews
Thanks Will,
Found it here;
http://code.djangoproject.com/browser/django/trunk/django/test/utils.py#L50

That does look about what I am hoping to do, not so sure about monkey
patching the core though.

Basically, assuming django's send_mail is the standard most apps use, I want
to be able to hook into that and handle all my applications email_sending
how I wish. Be that through using django-mailer or something else.

Possible use cases could be;

   - A Queue email system like django-mailer
   - Adding in my own logging for emails sent
   - Take emails to mean something else, like actually going to SMS


I think the more hooks django gives you into replacing/customising like this
the better. I might go and see how hard it would be to patch...

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/10 Will Hardy 

>
> The test runner does something similar if I remember correctly, have a
> look in django.test.utils and see if you can make something useful out
> of that.
>
> Cheers,
>
> Will
>
> >
>

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



Re: suggestion on querying external database

2009-05-10 Thread Dougal Matthews
This might be useful;
http://docs.djangoproject.com/en/dev/howto/legacy-databases/
It describes how to create models for your existing databases. However, it
wont stop you being able to make writes with the django ORM.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/10 tekion 

>
> Hi,
> I have an application which update MySQL database.  It has
> aproximately 5 million rows.  I am new to django, I am thinking of
> using django to generate report using the database as the data source.
> From what I have seen of the tutorial, you create a model. The
> database model, would create some sort of schema on the database of
> your setting (depending on what option you have set up on your
> setting.py file).  Update,ADD, MOD,Query would go against this
> schema.  What I am not sure is, what if you don't want to
> UPDATE,ADD,MOD, just select from the (external) database because
> another application is responsible for the data in the database? Does
> any one have ideas on how to best handle this?
>
> From what I have seen with Django, I would have to write my own code
> snippet to handle the query for the report in conjunction with Django
> template system.
> >
>

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



Re: Security with a solo Administrator?

2009-05-11 Thread Dougal Matthews
Why not use django.contrib.auth and only allow super users to access said
pages?
Or use django's permission system?

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/11 andrew 

>
> Hi,all
>
>I'm designing a series of admin pages that only one admin can
> logon ,I think there is no need to setup a single table to store only
> one entry which contain "name""password" .
>
>   So , I think ,is this way safe enough to ensure secure my admin
> access?
>
>   def login_admin(request):
>
>   if request.method == 'POST':
>   if(request.POST['input']=='Some code only I know'):
>   seesion['auth']='True'
>   else:
>   render_to_response("login_admin.html")
>   else:
>   render_to_response("login_admin.html")
> >
>

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



Re: What debugger do you use?

2009-05-13 Thread Dougal Matthews

pyDev and Wing IDE - I swap between them for a reason I can't quite fathom.

Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/5/13 Gath :
>
> I use pyDev for eclipse, i think its the best debugger for Python/
> Django.
>
> Gath
>
> On May 12, 10:52 pm, "ristretto.rb"  wrote:
>> I second that!  WingIDE is aweome.
>>
>> I'm using NB with xdebug for PHP with one client, and WingIDE Pro
>> (which gladly paid for)
>> for python.
>>
>> I can say, for certain, that I would choose Wing over NB if I had to
>> choose one.
>>
>> Gene Campbell
>>
>> On May 13, 1:54 am, James Matthews  wrote:
>>
>> > I use WingIde and love it!
>>
>> > On Mon, May 11, 2009 at 3:53 PM, Joshua Russo 
>> > wrote:
>>
>> > > I'm currently using Netbeans 6.5 with the Python plugin. I was just
>> > > wondering what everyone else is using because NB is a bit buggy with
>> > > the Python plugin at the moment.
>>
>> > --
>>
>> >http://www.jewelerslounge.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Design Question

2009-05-13 Thread Dougal Matthews

Alex Gaynors talk at EuroDjangoCon will probably help you out with
some handy Form tips. The slides are here;
http://lazypython.blogspot.com/2009/05/eurodjangocon-2009.html

The video should be online somewhere at some point.

Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/5/12 Glen Jarvis :
> Since I've been using Django this past year, I've slowly learned how to be
> more dynamic and DRY using the Django framework.
> For example, in the very beginning, if I were using newforms (now forms), I
> would create a form that mimic'ed the model (unless modelforms were really
> easy).
> Now, I've been using model forms and doing something like this for quite a
> while:
> from django.forms import ModelForm
> class PIGDemoForm(ModelForm):
>     class Meta:
>         model = Grant
>     def __init__(self, *args, **kwargs):
>         super(PIGDemoForm, self).__init__(*args, **kwargs)
>         self.fields['date_received'].widget =\
>             forms.TextInput(attrs={'class': 'date-pick'})
>         ...etc...
>
> Now, I have two models, we'll call model1 and model2. And, they both have a
> name attribute. Because I normalize data, I never do something like
> "model1.model1_name", but instead "model1.name." But, it's getting me in
> trouble.
> Both forms have a 'name' attribute. And, both forms are in a template
> together. (I mean that both form instances are created for the specific
> instance of the model in question, and are displayed together (very
> interleaved) in a template). The response that I get back, via request.POST
> instantiates both forms:
> form1 = Form1(request.POST, instance=blah1)
> form2 = Form2(request.POST, instance=blah2)
> [Note I'm translating this from a domain specific problem to generic (form1,
> form2, etc.) on the fly. There's room for error]
> Now, if request.POST has only one 'name' then form1 and form2 are getting
> the same name, obviously causing a problem.
> My question is specific to a better design. I see the following options (did
> I miss any):
> 1) Manually create one form that mimics model1 and model2 together (violates
> DRY, and makes verbose and less useable code)
> 2) Change my model names to be something like (model1.model1_name,
> model2.model2_name). This violates normalization rules (and has an impact on
> other code already written).
> 3) Try 'hacking' the form temporarily... something like:
>    def __init__(self, *args, **kwargs):
>        super(blah blah blah)
>        blah blah
>        self.fields['grant_name'] = self.fields['name']
>        If this third option is chosen, I need to either:
>         a) move the self.fields['grant_name'] back to self.fields['name']
> before using the form shortcut save() method, [and I scratch my head on how.
> Do I need to look at the pre-save signals, etc.]
>         b) Create a new model manually, specifying a mapping of
> "self.cleaned_data['grant_name']" to the model's "name" property. This has
> the same feel (redundant and less dynamic) as the above solutions, but may
> be the best we can do in this situation.
> Please note that the database is laid out in a very normalized manner per
> the request of the IT department of my customer. The user, however, doesn't
> understand these differences *at all* and just wants his data to look like
> it does when he types in a spreadsheet. So, there are competing design
> paradigms coming from two different people. That difference is something
> we're going to have to live with in this design.
> When I start getting into this kind of place, I think it's time for me to
> stop, put the keyboard down, and think... This is a very common design
> pattern: what do most people do?
>
> Thanks for listening and any fresh perspective would be welcomed.
>
> All the best,
>
> Glen Jarvis
> --
> "You must be the change you wish to see in the world." -M. Gandhi
>
> >
>

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



Re: if number <= othernumber

2009-05-13 Thread Dougal Matthews

Django by default doesn't allow this. This is a design decision,
comparisons like that in your template are considered 'advanced
logic.' It is discussed here;
http://docs.djangoproject.com/en/dev/misc/design-philosophies/#don-t-invent-a-programming-language

However, this doesn't stop you having your own template tag that
allows it. Or using this one that is on djangosnippets;
http://www.djangosnippets.org/snippets/1350/

This is the same all the way up to django 1.1

Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/5/13 richardcur...@googlemail.com :
>
> so the syntax is ???:
>
> {% if number <= othernumber %}
>
> {% endif %}
>
> >
>

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



Re: subscription based web app - want to develop - bounty

2009-05-18 Thread Dougal Matthews

This hasn't been updated since August 2007, so there is pretty much no
chance it will work with 1.0 or 1.1 out of the box. However, you might
find its a good base to work from;

http://code.google.com/p/django-accounts/

The feature list claims;
   1. subdomain-based accounts ie: account1.domain.com, account2.domain.com
   2. Your customers can create multiple 'sub-users' for their account.
   3. Role-based security & groups.
   4. Subscription plans - ie: Gold, Silver, etc. with resource quotas
   5. Integrates with payment processors for recurring billing.

Might be a good idea to make a copy on github and interested people
will watch/fork etc.

Cheers,
Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/5/17 AE :
>
> Hi
>
> I have looked enough and failed to identify anything that solves or
> like "SaaS railskit" if I am wrong please let me know. I am not
> technically savvy enough to develop such app myself.
>
> Maybe someone is using django-paypal to make subscription based (e.g.
> a.la basecamp) web app. What I want to do is this
>
> http://uswaretech.com/django-subdomains/
>
> However author I am not so sure about licensing above also I believe
> it should be a community effort i.e. adding other payment provider as
> needed.
>
> I would like to use django-paypal instead of what is available above.
> This is my current need I am guessing in the future it will be adding
> django-authorizenet or some other payment provider. You can find
> django paypal here
>
> http://github.com/johnboxall/django-paypal/tree/master
>
> can anyone help me to develop this if so could you please mail me
> directly about cost/time. The end code will be under MIT/GPL and I
> hope you have enough interest to maintain it further. the
> specification is very well described @ http://railskits.com/saas/ but
> paypal only that's solve my problem at the moment.
>
> I am after a re-usable app so all of django community can benefit from
> it.
>
>
> Regards
> Antonio
>
> >
>

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



Re: django captcha

2009-05-21 Thread Dougal Matthews
because its easy for them and they don't really get anything from doing it
otherwise? ;)

You'll find you have to head to SVN quite often to get projects in Django
I'm afraid, it just seems to be fairly common practice. Although, many
people are moving to github and it offers a download.

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/21 online 

>
> So i have to install svn on mymachine? Why people make download so
> complicated...
>
>
>
>
>
>
> On May 20, 10:22 pm, jai  wrote:
> > svn checkouthttp://django-simple-captcha.googlecode.com/svn/trunk/
> > django-simple-captcha-read-only
> >
> > On May 21, 9:30 am, online  wrote:
> >
> > > Could anyone please recommend a open source library captcha working
> > > fine with django?
> >
> > >http://code.google.com/p/django-simple-captcha/ looks but i just
> > > cannot find where to download.
> >
> > > Thanks
> >
>

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



Re: Using Ajax with django from different domain and technology

2009-05-22 Thread Dougal Matthews
If everything is going to be hosted on different servers etc. I think you
might want to consider using a web service or some sort SOAP or REST. It
would provide a common interface to your data that once implemented would be
easy to use in many places.

This really doesn't have much to do with Django though. However, check out
django-piston - it my help.
http://bitbucket.org/jespern/django-piston/wiki/Home

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/22 googletorp 

>
> Hi
> AJAX doesn't care what tech is serving the data as long as the format
> is what it expects (JSON). Doing cross domain AJAX calls it a bit more
> tricky, but you can do it with JSONP. It's not hard to setup when you
> have control of the json output. I know jQuery has it, but try to
> google it, there are plenty of good explainations of how to make it
> work. This is more of a javascript issue anaways so if you get stuck
> you could also try asking on an js list.
>
> ~Jakob
>
> On May 22, 6:56 am, Abhishoka  wrote:
> > Hi:
> >
> > We are a non-profit charity organization having 25+ websites and want
> > to maintain a centralized database for the various events happening at
> > different places. The database (MySql) has been implemented and we use
> > the django framework admin module to communicate with the database.
> > Our different sites use asp, php and plain html pages. In order to
> > fetch data through the django framework and use it in all our sites we
> > thought of using Ajax technology which runs on client side and should
> > be independent of server technology. Different web sites are located
> > in different domains.
> >
> > How to achieve this? Would Dujo, Jquery, Prototype, etc. help in this
> > regard? Web sites running in different technologies in different
> > domains need to communicate with the server running Django framework
> > and get the data - any suggestions on how to go about implementing
> > this? Sample code / URLs to the code / information would really help.
> >
> > - Abhishoka
> >
>

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



Re: When do snippets get into Django?

2009-05-22 Thread Dougal Matthews
Something like Pinax may offer what you need. Its almost like django.contrib
but an external project. you can find out more about it here;
http://pinaxproject.com/

Or the seperate mailing list; http://groups.google.com/group/pinax-users

They are pushing towards improving the main release at the moment, with 0.7
coming soon. I think there will then be migration/upgrade support from then
onwards. I believe its coming but not sure what stage it kicks in.

Pinax includes a huge number of apps, like django-tagging and more are being
added.

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/22 martin f krafft 

> Hi folks,
>
> I am new to Django and could not find the answer to a very important
> consideration I need to make before diving into Django more. I used
> to work with Zope and Plone, and one of the major problems were
> upgrades, not of Zope or Plone, but of all the products that were
> needed for a particular site.
>
> Django also uses pluggable apps. Between djangopluggables and
> code.google.com (and possibly other sites), there's a lot of
> external applications providing great functionality. However, I am
> reluctant to rely on those, mainly due to my experience with Plone
> and Zope.
>
> What's Django's strategy to integrate external pluggables into the
> main distribution and support it across upgrades? For instance,
> django-tagging[0] seems like a good candidate for core
> functionality. Does it stand a chance?
>
> 0. http://djangoplugables.com/projects/django-tagging/
>
> What's the process for integrating such external functionality into
> Django's core?
>
> PS: Django seems a lot thinner and more elegant than Plone/Zope, so
> upgrades are likely to be less of a problem, but still...
>
> --
> martin;  (greetings from the heart of the sun.)
>  \ echo mailto: !#^."<*>"|tr "<*> mailto:"; n...@madduck
>
> "security here. yes, ma'am. yes. groucho glasses. yes, we're on it.
>  c'mon, guys. somebody gave an aardvark a nose-cut: somebody who
>  can't deal with deconstructionist humor. code blue."
>  -- 
> http://azure.humbug.org.au/~aj/armadillos.txt<http://azure.humbug.org.au/%7Eaj/armadillos.txt>
>
> spamtraps: madduck.bo...@madduck.net
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEAREDAAYFAkoWZswACgkQIgvIgzMMSnVi5gCcC2S8dnR0VhKp2ZOiQZ7R04MZ
> /3MAoJAacIK+HQ3kYteVJfVj214TjCIa
> =jvHf
> -END PGP SIGNATURE-
>
>

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



Re: de-facto tagging (was: When do snippets get into Django?)

2009-05-22 Thread Dougal Matthews
Pretty must everybody does seem to use django-tagging unless they have some
special weird use-case.

I've used it every time I've needed tagging and don't have a gripe with it
yet.

Cheers,
Dougal


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/22 martin f krafft 

> also sprach Alex Gaynor  [2009.05.22.1545 +0200]:
> > http://jacobian.org/writing/what-is-django-contrib/  here is
> > a description of what one of the core developers see as the role
> > of django contrib.  It should be noted that 2 of the core devs
> > said at euro django con that that they prefer the core of django
> > to remain slim.
>
> Sounds good, and something like django.contrib is a great way
> forward.
>
> It does leave me wondering what the "de-facto standard" way to tag
> contents is…
>
> --
> martin | http://madduck.net/ | http://two.sentenc.es/
>
> "a kiss may ruin a human life."
>-- oscar wilde
>
> spamtraps: madduck.bo...@madduck.net
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEAREDAAYFAkoXCs8ACgkQIgvIgzMMSnWZPQCgwpHeqinX1jwo8xhyvfLFz2Sf
> JswAniqb2muIXEjw4p4LolqgDAJHPMPs
> =95Qm
> -END PGP SIGNATURE-
>
>

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



Re: de-facto tagging (was: When do snippets get into Django?)

2009-05-22 Thread Dougal Matthews
It doesn't. Why should it?

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/22 martin f krafft 

> also sprach Dougal Matthews  [2009.05.22.2352 +0200]:
> > Pretty must everybody does seem to use django-tagging unless they have
> some
> > special weird use-case.
> >
> > I've used it every time I've needed tagging and don't have a gripe with
> it
> > yet.
>
> So how would it find its way into contrib?
>
> --
> martin | http://madduck.net/ | http://two.sentenc.es/
>
> "geld ist das brecheisen der macht."
> - friedrich nietzsche
>
> spamtraps: madduck.bo...@madduck.net
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEAREDAAYFAkoXJYUACgkQIgvIgzMMSnWN4gCgyHNiUCgnrEJPSpJrtUMhzaiO
> V쀉털쭼鄃㥷쟋ॕ떳�핍�
> =GAqC
> -END PGP SIGNATURE-
>
>

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



Re: de-facto tagging (was: When do snippets get into Django?)

2009-05-23 Thread Dougal Matthews
I've never actually used it in any work related projects. I've only used it
in personal messing around type projects...

> Good contrib packages tackle issues that that are not trivial, are bikeshed
> prone, and are difficult to get right for the common case.


I don't think tagging is a particularly hard or non-trivial.

Anyway, this conversation is a bit irrelevant because; Core developers want
contrib to be slim, so its going to have a really strong usecase to get in.

If you start adding 'tagging' a huge number of other things start to feel
like they need to be added too. It because a case of well, you added
tagging, so why not this?

Also, what benefit do we really get from having it in contrib? Ok, so it
means everybody has it but by the sounds of things everybody uses it
anyway...

The difference between it being in contrib and being external is very
minimal to the developer that uses it.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2009/5/23 Kai Kuehne 

>
> Hi,
>
> On Fri, May 22, 2009 at 11:52 PM, Dougal Matthews 
> wrote:
> > Pretty must everybody does seem to use django-tagging unless they have
> some
> > special weird use-case.
>
> Huh? Can you remove that "everybody", please? I've never used tagging
> and I'm confident - many others too.
>
> >
>

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



Re: de-facto tagging (was: When do snippets get into Django?)

2009-05-23 Thread Dougal Matthews

Fair enough. I don't really have an issue with the idea, could be quite handy.

I can just imagine them saying no :) so thought I would question it as
a move/idea.

Also, might be a good idea to wait until 1.1 is out the door so they
have time to consider it properly...

Dougal

On 23/05/2009, martin f krafft  wrote:
> also sprach Dougal Matthews  [2009.05.23.1103 +0200]:
>> I don't think tagging is a particularly hard or non-trivial.
>
> No. All the more reason to push for a standard and prevent dozens
> of different implementations, no?
>
>> Anyway, this conversation is a bit irrelevant because; Core
>> developers want contrib to be slim, so its going to have a really
>> strong usecase to get in.
>
> I probably won't be hard to make a use-case for this, given how tags
> are omnipresent in the Web 2.0 and part of the "Semantic Web" idea.
> They are also incredibly useful at structuring information. Sure,
> it's easy to do, but why should't the feature be in Django?
>
> I think I'll collect some more information and then take this to the
> -devel list.
>
>> If you start adding 'tagging' a huge number of other things start
>> to feel like they need to be added too. It because a case of well,
>> you added tagging, so why not this?
>
> If there are strong use-cases, why not?
>
>> Also, what benefit do we really get from having it in contrib? Ok,
>> so it means everybody has it but by the sounds of things everybody
>> uses it anyway...
>>
>> The difference between it being in contrib and being external is
>> very minimal to the developer that uses it.
>
> I disagree. For me, it's the difference of having to track it
> myself, or letting my distro do that.
>
> --
> martin | http://madduck.net/ | http://two.sentenc.es/
>
> "love is a grave mental disease."
>  -- platon
>
> spamtraps: madduck.bo...@madduck.net
>

-- 
Sent from my mobile device



---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Making the case for Django (vs. Drupal)

2009-11-02 Thread Dougal Matthews
2009/10/31 shacker 

>
> Things like the announcement that
> whitehouse.gov switched to Drupal just cement the deal in many
> managers' minds.
>
>
I can't find the source for this (the original tweeter has protected tweets)
but if true its an interesting stat.

http://twitter.com/pydanny/status/5263754707

Plone not Django, but its closer than Drupal.

Cheers,
Dougal

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



Re: a request for some brain picking

2010-01-02 Thread Dougal Matthews
How would you propose people edit and manage the templates?

Do you follow a wiki style where everybody can edit others? or follow a VCS
and allow forking of templates?

I think it will be hard to find contributors since it will be hard to have a
limited/standard template context that still remains a useful resource for
all.

Have you any thoughts about example templates? Perhaps a good place to start
would be by creating custom admin templates as that context is defined by
django already (pretty much) and then it would be useful and usable by
anybody in real projects rather than scenarios.

Dougal


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




Re: a request for some brain picking

2010-01-02 Thread Dougal Matthews
2010/1/2 Raja 

> IMO, it would be useful if we get standard templates for django
> libraries that are out there, like django-registration, django-
> profiles etc. Since the library offers the models and views, it would
> be helpful if the templates are also available. The developer could
> then take it and modify it to adapt to their website.
>

+1 making templates that are fitted for common apps (including contrib)
would be great.


>
> Also, frameworks like Blueprint CSS (http://www.blueprintcss.org) make
> it much easier to start designing a layout by providing a pre-defined
> template , so its not all that difficult now, but blueprint could be
> one of the templates thats available in the original poster's library.


+1 again - would help with standardisation of what is made

--

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




Re: Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread Dougal Matthews
If you want your app to be shipped individually and re-used then you
shouldn't use the project name. If you make a reusable app and release it
then I want to use it, I don't want to have to include the project
namespace, i just want the app.

However, its your shipping the project as a whole then it doesn't really
matter and its then its just down to personal preference really.

Dougal

2010/1/15 Sebastian Pawlus 

> Hi
>
> I've found something like "Top 10 tips to a new Django developer"
>
> http://blog.dpeepul.com/2009/08/31/top-10-tips-to-a-new-django-developer/
>
> I'm really blasted by first point "Don’t put project name  in the imports".
> is this point correct? Django site and core developers
> http://github.com/jacobian/cheeserater/blob/master/urls.py
> http://code.djangoproject.com/browser/djangoproject.com/django_website/
>
> break that rule.
>
> x_O
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Re: how to do a form with elements drawn from database (not hard-wired in forms.py)?

2010-01-19 Thread Dougal Matthews
2010/1/18 dk 

>
> Is there a way to do what I'm trying?
>
>
As a totally shameless plug I wrote about this fairly recently;
http://dougalmatthews.com/articles/2009/dec/16/nicer-dynamic-forms-django/

I don't quite do the step of the database but show how one can create a form
on the fly - it could easily be based on database values.

Cheers,
Dougal
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Re: About unit testing

2010-01-22 Thread Dougal Matthews
If you look at the tests in django-shorturls you can see how they created
models that were only used for the tests:


http://github.com/jacobian/django-shorturls/tree/master/src/shorturls/tests/


---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2010/1/22 Gabriel Reis 

> Hi,
>
> I would like to know if it is mandatory to create an application and define
> my model in the models.py file or if it is possible to define a model
> locally in my test method (inside my TestCase class) and interact with it
> and saving without creating an application and the models.py. In other
> words, is it possible to force the creation of the table inside the test
> method?
> Example:
>
> class MyTestCase(TestCase):
>
> def test_something(self):
> class MyModel(models.Model):
> foo = CharField(max_length=10)
>
> call_something_to_sync_db()
>
> m = MyModel(foo='something')
> m.save()
>
>
> Thanks for your attention!
>
> Kind regards,
>
> Gabriel
>
> --
> Gabriel de Carvalho Nogueira Reis
> Software Developer
> +44 7907 823942
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: getting the object with max value

2010-01-25 Thread Dougal Matthews
model.objects.annotate(Max('handicap')).order_by('-handicap__max')

I think something like that does what you need.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/



2010/1/25 Kenneth Gonsalves 

> hi,
>
> I have a model 'Player' and a Model 'Handicap'. Handicap will have several
> fields, one of which is a foreign key to player. Now I need to get the
> Handicap
> instance when the player had the highest handicap. I can use Max to find
> the
> highest handicap and do a query to identify the instance where the handicap
> is
> at Max value. Is there a simpler way of doing this?
>
> --
> regards
> Kenneth Gonsalves
> Senior Project Officer
> NRC-FOSS
> http://nrcfosshelpline.in/web/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: I am new to the Django community

2010-01-26 Thread Dougal Matthews
In a shameless plug, you could try your hand at doing some testing with
django. This follows on from the tutorial.
http://dougalmatthews.com/articles/2010/jan/20/testing-your-first-django-app/

Otherwise... I'd just read the Django docs - they are fantastic.

Read what people post here; http://www.djangoproject.com/community/

and checkout the django book; http://www.djangobook.com/en/2.0/

Cheers,
Dougal

2010/1/27 kamilski81 

> I have done the tutorial on the site, are there any other recommended
> readings?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: What's the going rate for a Django developer?

2010-01-29 Thread Dougal Matthews
I think the answer to that is probably "it depends".

   1. Permanent or contractor?
   2. What country?
   3. Often it even matters what city?
   4. How much experience do they have?

It's probably best for you to look at job adverts and see what they are
offering. Some listings on http://djangogigs.com include the salary/budget.

Cheers,
Dougal


On 29 January 2010 12:00, Astley Le Jasper wrote:

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

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



Re: template rendering problem plz look at this.

2010-02-17 Thread Dougal Matthews
The django-developers mailing list is for the discussion about
the development of django itself, not using django.

Please use the django-users mailing list and don't cross post between the
two.

Dougal



On 17 February 2010 09:26, chiranjeevi muttoju <
chiranjeevi.mutt...@gmail.com> wrote:

>
> Hi,
> Actually my aim is to load the iframe when i click my link(play) in
> facebook. i get the functionality working fine but the problem is after
> loading the iframe with desired content, it becomes blur.. I dont know what
> the problem is. please see the bellow screen short  .
>
> After clocking the play link i want to change the i frame content.. for
> this i'm calling one view function.
>
> play button href is: 
> Play 
>
> view deff:
> def play(request):
> content = {'baseUrl' : settings.FACEBOOK_URL}
> return direct_to_template(request,'play.html',content)
>
>
> functionality is working fine but i'm getting the blur screen on the top of
> actual page. if i click on that page it replacing the entire page. i dont
> know what is the error. if anybody know please help me. if any other
> information please ask me.
>
> --
> Thanks & Regards,
> Chiranjeevi.Muttoju
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: any suggestions for managing DB schema with visual ERD tool?

2010-02-18 Thread Dougal Matthews
On 18 February 2010 00:03, snfctech  wrote:

> I just built a complicated schema with MySQL workbench and am looking
> at Python frameworks to start implementation.
>
> Does anybody in the Django community do this?  What's your practice
> for going back and forth between the ERD and the ORM?  I saw
> DjangoGraphviz http://code.djangoproject.com/wiki/DjangoGraphviz -
> which looks like you manage your schema in your Django models and can
> then export those to a visual representation.  Does anyone use that?
>
> I would love a visual DB design tool that automatically generated my
> framework models - but I'm sure that doesn't exist.


You could always continue to use MySQL workbench and use django-admin.py
inspecdb[1] to create the models. It seems a bit backwards to me and I
imagine it will trip up eventually...

I would suggest you try to get used to managing them via python - there is a
reason most people use it, it really works quite well.

[1]: http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb

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



Re: Best way to access 'request' in pre_save

2010-02-19 Thread Dougal Matthews
On 19 February 2010 09:28, Paul Stone  wrote:

>
> > Presumably you have a view which is updating this object. The view has
> > access to the HttpRequest. Therefore, the easy, simple, clean and
> > elegant way is... to have the view set the value of that field. So do
> > that and ignore anyone who tells you otherwise --
> > magically/secretly/implicitly trying to make things happen or provide
> > access to variables is the path of people who prefer to make their own
> > jobs harder.
>
> That's fine for one or two models. But what if I want to do this for a
> number of models, in every view? What's the best way to do that
> without code repetition?
>

Using a ModelForm?

http://docs.djangoproject.com/en/dev/topics/forms/modelforms/

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



Re: Best way to access 'request' in pre_save

2010-02-19 Thread Dougal Matthews
On 19 February 2010 10:27, Paul Stone  wrote:

> > > That's fine for one or two models. But what if I want to do this for a
> > > number of models, in every view? What's the best way to do that
> > > without code repetition?
> >
> > Using a ModelForm?
> >
> > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
>
> Ok, I think I understand now. ModelForm always has a reference to the
> request object.


Nope, it doesn't need that. You pass it request.POST (or GET).


> So I can create a subclass of ModelForm (e.g
> AuditModelForm) that I use as a base for all my forms. In the save()
> method of AuditModelForm, I can set the updated_by field of the model
> and do anything else I want.
>
>
But yes, you can update the object in the save method.

Dougal

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



Re: allowing other chars in User.username

2010-02-22 Thread Dougal Matthews
On 22 February 2010 11:56, Aljosa Mohorovic wrote:

> what are security concerns if username is allowed to contain chars
> like ".,;-() " and non-ascii alphabet letters?
> will orm still properly escape string before querying the database?
>
> Aljosa
>
>
In short, yes it will. All strings passed through the ORM are correctly
escaped (this applies to any and all models).

I'm not sure what your reason if for using such characters?

Dougal

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



Re: Django in the enterprise?

2010-02-24 Thread Dougal Matthews
You may find this thread of django-developers interesting; "What The
Enterprise wants from Django"

http://groups.google.com/group/django-developers/browse_frm/thread/c89e028a536514d3

It's a discussion about some of the things that Django is missing that
the enterprise wants/needs - the good news is that the list is fairly short
and doesn't really contain surprises.

Dougal

On 24 February 2010 14:23, Steven Elliott Jr wrote:

>  Dear friends,
> I apologize for writing this type of question to the community but I would
> appreciate any information you could pass on considering the breadth of
> knowledge within this group.
> I know that the word “enterprise” gives some people the creeps, but I am
> curious to know if anyone has experience creating enterprise applications,
> similar to something like say… Java EE applications, which are highly
> concurrent, distributed applications with Django? I know Java has its own
> issues but its kind of viewed as THE enterprise framework and I think that’s
> unfortunate.
> Some people say that Rails is a good replacement for Java EE but what about
> Django? Has anyone ever used it in this context? You only ever see pretty
> standard websites on djangosites.org and it seems like its capable of so
> much more. I am planning on scrapping some of our old systems which are
> written mostly on ASP.NET and some Java for something more easily
> maintainable. I started using Django for some other applications and find it
> to be fantastic for what I am using it for (Corporate news, intranet, etc.)
> internally but what about something like… an accounts receivable system, or
> a billing system, etc.
> I would hate to see a framework such as this pigeon-holed into a category
> it doesn't need to be. It seems to be used for social media/networking,
> content-heavy sites, not so much data processing, etc. I feel that it has
> all the elements needed to start down this path. Anyone have any thoughts?
>
> Thank you very much for your time.
>
> Best,
> Steven Elliott
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Storing API Passwords

2010-03-02 Thread Dougal Matthews
On 2 March 2010 14:11, hcarvalhoalves  wrote:

> Sorry, I just saw Twitpic's documentation now [1].
>
> What I can say, is that their implementation is a joke.
>

It's not that simple. Twitpic is usually used by 3rd party programs - not
directly. So for example with Tweetdeck, if they wanted to integrate Twitpic
I would have to use oauth to allow tweetdeck and then oauth again with
twitpic and every other service. In other words, a horrible
user experience - the same would apply to websites.

There isn't a way to pass around tokens between services as its
authenticated against their secret key. So you need to authenticate each of
them individually or use the passwords.

Anyway, basically you should at least store encrypted passwords as you can't
store a hash. Something like this would help;
http://www.djangosnippets.org/snippets/1095/. It isn't ideal but its better
than plain text.

I believe that snippet (or a variation of) is used in Pinax - so you may
want to look there to see how they did it. It was discussed at the sprints
at EuroDjangoCon, Prague last year.

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