Re: Freelancers in Bristol UK July/August 09

2009-07-02 Thread Daniel Hilton
2009/7/2 sleepyjames 

>
> Were looking for freelance developers preferably in the Bristol area
> (but not essential) for a number of projects over July/August 09.
>
> Requirements:
> Html/css
> Django 1.1 (svn)
> Happy with Subversion
>
> Please send examples/urls/rates to:
> j...@dropp.co.uk


You should post this on underscore as well:
http://www.under-score.org.uk/

HTH
Dan




>
>
>
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: Common report values?

2009-07-06 Thread Daniel Hilton
Couldn't you use something like django-chunks for this?

Specify a single chunk something like footer and then pull it in for every
report?

HTH
Dan


2009/7/6 Joshua Russo 

>
> I have a seriese of reports that have a signature section with the
> name below. The name does not change very often but it will change at
> some point and I want a layman to be able to change the name without
> having to edit the scary looking template files. Can I specify an
> arbitrary field from an arbitrary table in a template or should I
> create a ReportInfo model and associate it (through a relation) to the
> different models that have reports where I need to use the info?
>
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: Has anything changed with Sagepay/protx apart from the name?

2009-07-14 Thread Daniel Hilton
To answer the original post:

Sagepay AFAIK is a rebrand as sage have owned protx for a while now.

Nothing should have changed apart from names of products.
Cheers,
Dan



2009/7/14 Kip Parker 

>
> No, I did not. Oh dear. Thanks for pointing this out Karen.
>
> I am now off to the Satchmo group to post the same message, in case
> anyone was wondering what it was all about.
>
> Kip.
>
> On Jul 14, 1:47 pm, Karen Tracey  wrote:
> > On Tue, Jul 14, 2009 at 7:42 AM, Kip Parker  wrote:
> >
> > > I noticed whilst researching which payment gateway to use that Protx
> > > has become Sagepay. Anyone know if they've just changed the name (so
> > > that the Protx payment module still works OK) or if they've changed
> > > the product at all (so the Protx module doesn't)?
> >
> > Did you ask this on the right list?  I can't recall ever hearing either
> of
> > these names mentioned before, so I'm not sure they have anything to do
> with
> > Django?
> >
> > Karen
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: multi-tenant website

2009-08-23 Thread Daniel Hilton

You might have alook at the saas kit which is availble on github,
which does subscription billing, subdomain handling and multi user
accounts. You could then write a decorator to wrap any db request to
perform a test to check that only rows that are linked to that
requesting user are returned or some custom managers.

HTH
dan

On Sunday, August 23, 2009, Fernando  wrote:
>
> Is there a Django app that helps with handling multitenancy, that is,
> having a single website and a single database serving multiple
> organizations in a software-as-a-service fashion while avoiding one
> tenant to interact with another's data?
>
> I'm talking about the "Shared database, shared schema" scenario like
> described in this article:
>
> http://msdn.microsoft.com/en-us/library/aa479086(loband).aspx#mlttntda_topic2
>
> "In this approach, all tenants share the same set of tables, and a
> Tenant ID associates each tenant with the rows that it owns."
>
> If there isn't an app or plugin that helps with that scenario, I'd
> appreciate some pointers on how this could be implemented in a Django
> website.
>
> Cheers,
>
> Fernando Correia
>
> >
>

-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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 call random pictures thumbs in sidebar from pictures section?

2009-09-02 Thread Daniel Hilton

2009/9/2 Bins :
>
> On my django run website, I've this sidebar which calls 5 random
> pictures from entries.. here's the code that does it :-
>
>                  {% for entry in thumb_entries %}
>                    '110' src='{{entry.img}}' style='border:none;' / >
>                   
>                   {% endfor %}
>
> My website, say www.example.com, has a section www.example.com/photos/
> with pages like www.example.com/photos/the-great-catch/. My question
> is, how do I change above code so that it calls 5 random pictures from
> photos section and not from entries?

You need a new template tag / filter to generate your sidebar picture
block or add an extra bit of code to your standard list view.

What you want to do is select 5 from your queryset at random.

The following code should put you kinda on the right path:

(Place this in a templatetags folder inside an app, you also need to
do an "import random" at the top of your python file.


#random_slice: returns a list of random entries from a list limited to
the number passed in
# Usage:  list|random_slice:5
@register.filter(name='random_slice')
def random_slice(value, number):
try:
  new_list =  random.sample(value,number)
except:
  new_list = value
return new_list


That is a generic filter that will work on any list, however you can
also do it in the ORM:

MyModel.objects.order_by('?')[4]

Assuming your backend supports it. More documentation here:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-fields

HTH
Dan





> >
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: Production install 'admin' failing with 500 internal server error

2009-05-13 Thread Daniel Hilton

2009/5/13 Vincent :
>
> Additional information:
>
> I am running Django 1.0.2 and the web host I am attempting to do this
> all on is Media Temple, in one of their Dedicated Virtual (DV)
> accounts. I followed the general guidelines for mod_wsgi setup from
> here:
>
> http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> None of my media, templates or app code reside in the standard MT
> httpd path:
>
> /var/www/vhosts/example.com/httpdocs
>
> I am using /usr/local/django-apps along with the suggested mod_wsgi
> script path of:
>
> /usr/local/django-apps/myapp/apache/django.wsgi
>
> My templates and media directories appear to load correctly, in
> particular, my 404 template loads just fine.
>
> There's no shortage of configurations and settings to list but I am
> not sure what else to post.
>
>
> On May 13, 4:19 pm, Vincent  wrote:
>
>> Hi all:
>>
>> I have loaded my application on our production server but I am unable
>> to load the supplied admin interface. What's really odd is that
>> everything else seems to work fine. Databrowse works along with the
>> django 'configuration success' page. When using databrowse, I can view
>> all of my database just as I would on the dev server. My database is
>> currently a SQLite3 db and I am using the latest release version of
>> mod_wsgi all running with Python 2.4.3. When I get the "500 Internal
>> Server Error" page, it is the one generated by Apache and not django.
>> I also do not get any errors in logs/httpd/error_log. Everything runs
>> swimmingly when run locally from the built-in development server.
>>
>> If any other configuration info is needed, please ask. Any help would
>> be greatly appreciated. I've spent so much time working on my app,
>> it's no fun having things break at this stage.
> >
>


Are you using a virtualenv?

Can you serve the site using ./manage.py runserver example.com:8080 ?

If you can serve it using the in-built server then it's likely a
problem with your mod_wsgi setup.

If you can't serve it using the in-built server try comparing the
versions of packages installed on the server verses your local
machine.

HTH
Dan
-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: FileBrowser: Installation Question

2009-05-25 Thread Daniel Hilton

Filebrowser uses a directory called uploads, in your media directory.
You need to create it and allow the user running your wsgi instance to
be able to write to it as you upload files.

On a related note, has anyone ram into trouble installing filebrowser
with tinymce? Have run usual install all fine but when you try to add
an image in tinymce and click the file browser icon I get a 'u is not
defined error', which I've traced back to some sort of failed
installation according to moxiecode website. Have tried python
setup.py install -f. But to no avail. Any ideas?

On 25/05/2009, Bob N.  wrote:
>
> I've followed the instructions properly, but I get the error:
>
> OSError (2, 'No such file or directory')
>
> at line 52 in Views.py: dir_list = os.listdir(os.path.join
> (PATH_SERVER, path))
>
> PATH_SERVER is not defined in my Settings, so I'm sure it's because I
> can't figure out what to do for Basic Installation step #4.
>
> 4. Change fb_settings.py
> Either change fb_settings.py or overwrite the filebrowser settings in
> your project settings-file (settings.py). See "Available Settings".
>
> In Available Settings:
> All Settings can be defined in your projects settings-file
> (settings.py) or the FileBrowsers settings-file (fb_settings.py). When
> using the projects settings-file, you have to use the prefix
> "FILEBROWSER" for every setting (e.g. FILEBROWSER_PATH_SERVER instead
> of PATH_SERVER).
>
> Can someone please explain what "change fb_settings.py" means or how
> to add fb_settings to my project settings.
>
> Thanks!
>
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: Automatically creating auth.models.group for an application

2009-06-02 Thread Daniel Hilton

2009/6/2 eric.frederich :
>
> In an application I'm writing I have a model that stores admins by
> location in a model called LocationAdmin.  So in this model I have a
> foreign key to User and a foreign key to a Location object.
>
> I would like to override the save() method so that when an Admin is
> created they are assigned to a special group (auth group).  This group
> would be called something like "Location Admins" and have various
> permissions.
>
Couldn't you do this with the post-save signal?
http://docs.djangoproject.com/en/dev/ref/models/instances/#what-happens-when-you-save

Create a signal that listens for the save of a admin and have it place
an admin into your group if they aren't already.

That way you could could add your new admin user to your special group.

HTH
Dan

> I have having a hard time finding a way let alone the correct way to
> do this.
>
> I feel that the group should be created when running syncdb but by
> using a fixture I'd have to hard code the permissions keys that the
> group needs.
>
> Its almost like I need a fixture that runs some python script that
> runs Permission.objects.get to go after the wanted permissions.
>
> Is there a mechanism to do something like?
> >
>



-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: tinycme and filebrowser - unable to select image

2009-06-09 Thread Daniel Hilton

2009/6/9 nostradamnit :
>
> Hello,
>
> I've successfully implemented TinyMCE and filebrowser for flatpages,
> however, I can't seem to select the images that are displayed in
> filebrowser. If I click on the image, it just serves the image?!? How
> do you use it to select the image to insert into TinyMCE? if I paste
> the path from the image served into the image url field, it inserts it
> correctly into TinyMCE.
>
> Thanks in advance for you assistance,
> Sam

I lost three days to this! It's to do with the tinymce filebrowser
template - you need to capitalise the javascript function, otherwise
you'll get an 'u is not defined error' from tinymce in your javascript
error log.
HTH
Dan

>
> >
>



-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: tinycme and filebrowser - unable to select image

2009-06-09 Thread Daniel Hilton

Thanks, I have done:
http://code.google.com/p/django-tinymce/issues/detail?id=45

HTH
Dan

2009/6/9 patrickk :
>
> I´m actually not sure whether or not your saying there´s an error with
> the filebrowser-templates ... because I don´t know what you mean with
> "the tinymce filebrowser template".
>
> if you think you´ve found an error, please use the google-code issue-
> tracker to report it.
>
> thanks,
> patrick
>
>
> On Jun 9, 10:23 pm, Daniel Hilton  wrote:
>> 2009/6/9 nostradamnit :
>>
>>
>>
>> > Hello,
>>
>> > I've successfully implemented TinyMCE and filebrowser for flatpages,
>> > however, I can't seem to select the images that are displayed in
>> > filebrowser. If I click on the image, it just serves the image?!? How
>> > do you use it to select the image to insert into TinyMCE? if I paste
>> > the path from the image served into the image url field, it inserts it
>> > correctly into TinyMCE.
>>
>> > Thanks in advance for you assistance,
>> > Sam
>>
>> I lost three days to this! It's to do with the tinymce filebrowser
>> template - you need to capitalise the javascript function, otherwise
>> you'll get an 'u is not defined error' from tinymce in your javascript
>> error log.
>> HTH
>> Dan
>>
>>
>>
>> --
>> Dan Hilton
>> 
>> DanHilton.co.uk
>> 
> >
>



-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: tinycme and filebrowser - unable to select image

2009-06-11 Thread Daniel Hilton
Hi Sam

Yes mine is working now. Weird - will try a fresh project at some stage and
try and track this one down.
Was the error you were getting from tinyMCE saying that 'u is not defined'?

Cheers,
Dan

2009/6/11 nostradamnit 

>
> Hi Daniel,
>
> Your javascript name change didn't work for me :( Is your working now?
>
> Did you check your settings.FILEBROWSER_URL_FILEBROWSER_MEDIA? Mine
> was pointing to an invalid path ( I hadn't copied the filebrowser
> media files over ) . My install is working now :D
>
> Good luck,
> Sam
>
> On Jun 9, 11:40 pm, Daniel Hilton  wrote:
> > Thanks, I have done:
> http://code.google.com/p/django-tinymce/issues/detail?id=45
> >
> > HTH
> > Dan
> >
> > 2009/6/9 patrickk :
> >
> >
> >
> >
> >
> > > I´m actually not sure whether or not your saying there´s an error with
> > > the filebrowser-templates ... because I don´t know what you mean with
> > > "the tinymce filebrowser template".
> >
> > > if you think you´ve found an error, please use the google-code issue-
> > > tracker to report it.
> >
> > > thanks,
> > > patrick
> >
> > > On Jun 9, 10:23 pm, Daniel Hilton  wrote:
> > >> 2009/6/9 nostradamnit :
> >
> > >> > Hello,
> >
> > >> > I've successfully implemented TinyMCE and filebrowser for flatpages,
> > >> > however, I can't seem to select the images that are displayed in
> > >> > filebrowser. If I click on the image, it just serves the image?!?
> How
> > >> > do you use it to select the image to insert into TinyMCE? if I paste
> > >> > the path from the image served into the image url field, it inserts
> it
> > >> > correctly into TinyMCE.
> >
> > >> > Thanks in advance for you assistance,
> > >> > Sam
> >
> > >> I lost three days to this! It's to do with the tinymce filebrowser
> > >> template - you need to capitalise the javascript function, otherwise
> > >> you'll get an 'u is not defined error' from tinymce in your javascript
> > >> error log.
> > >> HTH
> > >> Dan
> >
> > >> --
> > >> Dan Hilton
> > >> 
> > >> DanHilton.co.uk
> > >> 
> >
> > --
> > Dan Hilton
> > 
> > DanHilton.co.uk
> > 
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: FileField will not validate

2009-06-12 Thread Daniel Hilton
Can you post the model as well?

2009/6/12 Brandon Taylor 

>
> Hi Everyone,
>
> I'm using Django trunk, Python 2.6.
>
> I have a model form with a FileField. The relevant portions of the
> HTML are:
>
>  enctype="multipart/form-data">
>{{ job_seeker_form.resume }}
>{{ job_seeker_form.resume.label_tag }}
>{{ job_seeker_form.resume.help_text }}
>{{ job_seeker_form.resume.errors }}
> 
>
> In my view, the relevant portions of code are:
>
> def create_career_profile(request):
>if request.method == 'POST':
>job_seeker_form = JobSeekerProfileForm(request.POST,
> request.FILES, prefix='job_seeker')
>#do more stuff here
>else:
>job_seeker_form = JobSeekerProfileForm(prefix='job_seeker')
>
>return render_to_response, etc
>
> Every time I post this form, I get a required validation error on the
> resume field. Can anyone see what I'm doing wrong?
>
> TIA,
> Brandon
> >
>


-- 
Dan Hilton

DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: any open source complete django app to use as start

2009-10-12 Thread Daniel Hilton

2009/10/12 shreko :
>
> I've been looking all day yesterday to find a complete django open
> source project that is non trivial. Using it as a base for my app
> would greatly speed up my learning and give me a fast start. To give
> you an example, for kohana framework in php you can find
> http://www.argentuminvoice.com/ as a full app. I would think that
> Django has been out long enough that these apps would exist. If you
> know of any, could you please let me know?

Everyblock?
http://code.google.com/p/ebcode/


>
> Thanks
>
> >
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: hosting from /some/url in apache

2009-10-14 Thread Daniel Hilton

2009/10/14 Jani Tiainen :
>
> Chris Withers kirjoitti:
>> Hi All,
>>
>> I need to host my django project from /some/folder in my apache instance.
>>
>> I have the following:
>>
>> WSGIScriptAlias /some/folder /path/to/django.wsgi
>>
>> Does this now mean I have to prefix all my entries in urls.py with
>> /some/folder?
>>
>> I hope not, but give that going to:
>>
>> http://myserver/some/folder
>>
>> ...gives me a 404 unless I do, I'm not hopeful.
>>
>> What am I doing wrong?
>
> "nothing".
>
> Term is called "suburl deployment" and I've done it (for testing purposes).
>
> Apache config:
>
> RewriteEngine On
>
> #add missing trailing slash if needed
> RewriteRule    ^/$  //  [R]
>
> #WSGI alias[[BR]]
> WSGIScriptAlias / absolute_path_to_wsgi_file.wsgi[[BR]]
>
> And if you're using authentication in your app you must provided full
> absolutely URL to login page, I've done it settings.py:
>
> LOGIN_URL='//login/'
>
> And that's it. Of course you have to keep all your apps using hardcoded
> urls but use reverse url finding always.
>
Does this enable you to run a django project only on a certain url?

So, say for example you've got a legacy php site that has the
siteroot, could you run a django app off of // ?

Many Thanks,
Dan


> --
> Jani Tiainen
>
> >
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 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: Calling Stored procedures from PostgresSQl

2009-12-04 Thread Daniel Hilton
2009/12/4 Geobase Isoscale :
> Hi all,
> Does anyone has an idea on how I can call a ' stored procedure' (function)
> in posgresql into Django Form?
> Many Thanks
> Isoscale


Do you mean in a Django way or do you mean into the Django Forms library?

I think you mean in a Django way so I'd suggest you use the raw method
of the ORM:
http://docs.djangoproject.com/en/dev/topics/db/sql/

HTH
Dan


>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--

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 Gantt Chart

2010-01-04 Thread Daniel Hilton
2010/1/4 Alessandro Ronchi :
> I need to make a simple chart with a list of projects and a grafic
> display of the end date with a link to the project page.
> It's simpler than a gantt chart.
>
> Is there any library / snippet I can use to simplify my work?
>

Hmmm, as I'm about to do something similar I've also researched this.

If you're just looking at displaying a list of objects(projects) then
you can use a generic view and then handle the display in the
template, which means the following links may be of help:

http://www.jlion.com/docs/gantt.aspx
http://www.jsgantt.com/

Niether of which are particularly pretty but the basics are there
ready to be reskinned.

http://www.ext-scheduler.com/examples.html

Is however, pretty awesome, if commercially licensed.

This question on stackoverflow is pretty extensive as well:
http://stackoverflow.com/questions/1005587/gantt-chart-online

If I don't find one I like, I'm thinking about writing a template tag
and some jQuery to make a nice dependency graph.
HTH,
Dan




> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> http://hobbygiochi.com
> Hobby & Giochi, l'e-commerce del divertimento
>
> --
>
> 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.
>
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


--

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: Data Level Access Control

2010-01-05 Thread Daniel Hilton
2010/1/5 datta :
> Hi,
>
> Is there a setting/module that helps me to achieve data level access
> control in a web application.

There are a number of projects that are looking at row-level access control:

http://nomadblue.com/blog/django/django-rbac/
http://opensource.washingtontimes.com/projects/objectpermissions/

You can enforce this through use of managers though, so say you had a
leads model, you could have a leadManager
that only ever got leads for the current logged in user.

HTH
Dan


>
> For example, if I have a sales app, the leads created by one user
> should not be visible to the other. Also, I should be able to create
> sales hierarchies ( agents attached to managers, managers reporting to
> VP;s and VP;s managing sub-organizations in a organization). If anyone
> of you is familiar with 'siebel' access control module, this
> functionality is implemented there.
>
> I know that one can achieve all of this programmatically, but if there
> is an app or a setting that helps me do this, that will be great. I am
> not sure if Pinax is planning to provide a similar functionality in
> one of its 'base' projects.
>
> Thanks!
> Datta
>
> --
> 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.
>
>
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk

-- 
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: Send and Receive SMS from a django app

2010-01-13 Thread Daniel Hilton

 http://www.rapidsms.org/


2010/1/13 Alessandro Ronchi :
> Is it possible with linux and django to send and receive data from SMS from
> a django APP? Did anyone managed to do that?
>
> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> http://hobbygiochi.com
> Hobby & Giochi, l'e-commerce del divertimento
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk

-- 
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: Send and Receive SMS from a django app

2010-01-14 Thread Daniel Hilton
2010/1/14 Alessandro Ronchi :
>
>
> On Wed, Jan 13, 2010 at 2:29 PM, tback  wrote:
>>
>> Hi Alessandro,
>>
>> yes, it's possible to send sms messages (I use this myself every day)
>> and to receive sms messages (that's an assumption).
>> The easiest way is through a sms gateway.
>> http://www.celltrust.com/ is a provider that advertisises two way
>
> I cannot use an SMS gateway for my app (I must use a SIM and an hardware
> modem).
>
> Does RapidSMS include SMS receiving?
>
> Thanks in advance.

Yep take a look at this:

http://www.rapidsms.org/code/architecture/

You'll need a GSM modem though.

Cheers,
Dan

>
>
>
> --
> Alessandro Ronchi
>
> http://www.soasi.com
> SOASI - Sviluppo Software e Sistemi Open Source
>
> http://hobbygiochi.com
> Hobby & Giochi, l'e-commerce del divertimento
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk

-- 
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 generated html forms with django

2010-01-22 Thread Daniel Hilton
2010/1/22 Ariel :
> Hi everybody:
> I need to make an automatic admin interface with a behaviour similar to the
> Django's default admin interface but not totally equal, then I need to know
> how django generate all the html forms and views methods for any class
> included in the model, how does django do that ??? Where are the classes
> that control all the generated html forms and views methods ???
> How could I make this ???
> Could you help me ?
> Thanks in advance
> Ariel

Django-frontendadmin may help you:

http://github.com/bartTC/django-frontendadmin

You'll need to read the forms documentation as well though and have an
understanding of the basics of form processing:
http://www.djangobook.com/en/2.0/chapter07/

HTH
Dan


>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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 generated html forms with django

2010-01-22 Thread Daniel Hilton
I'm just trying to help :-)

Google git clone or read the user guide on github to help you out.

Cheers,
Dan


On Friday, January 22, 2010, Ariel  wrote:
> I am asking you that because I am having problems to download it.
>
>
>
> On Fri, Jan 22, 2010 at 12:13 PM, Ariel  wrote:
>
> Why is this http://github.com/bartTC/django-frontendadmin helpfull ???
>
> Regards
> Ariel
>
>
>
>
>
> On Fri, Jan 22, 2010 at 12:00 PM, Daniel Hilton  
> wrote:
> 2010/1/22 Ariel :
>
>
>> Hi everybody:
>> I need to make an automatic admin interface with a behaviour similar to the
>> Django's default admin interface but not totally equal, then I need to know
>> how django generate all the html forms and views methods for any class
>> included in the model, how does django do that ??? Where are the classes
>> that control all the generated html forms and views methods ???
>> How could I make this ???
>> Could you help me ?
>> Thanks in advance
>> Ariel
>
> Django-frontendadmin may help you:
>
> http://github.com/bartTC/django-frontendadmin
>
> You'll need to read the forms documentation as well though and have an
> understanding of the basics of form processing:
> http://www.djangobook.com/en/2.0/chapter07/
>
> HTH
> Dan
>
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-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.
>>
>
>
>
> --
> Dan Hilton
> 
> www.twitter.com/danhilton
> www.DanHilton.co.uk <http://www.danhilton.co.uk/>
> 
>
> --
> 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.
>

-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Python Graph

2010-01-27 Thread Daniel Hilton
2010/1/27 Bhaskar Gara :
> Hi,
>
>    I am very new to django.  I am trying to use this library for my
> graphs
> http://www.gerd-tentler.de/tools/pygraphs/?page=introduction
>
>
> In my Views.py
>
> prev_score(request):
>        graph = graphs.BarGraph('vBar')
>        graph.values = [380, 150, 260, 310, 430]
>        print graph.create()
>
> In my Template  "score_compare.html"  in between the screen  I kept
> below code where it need to display the graph.
>
>                {{ prev_score }}
>
> It not erroring out,  but the graph is not displaying.  Please help.
>
> Thank you
> Bhaskar


Within a view function you can't print html out, you need to return
the output of the function.

So, using your example, this should give you your graph:



from django.template import loader, Context

def prev_score(request):
graph = graphs.BarGraph('vBar')
graph.values = [380, 150, 260, 310, 430]
myGraph =  graph.create()
t = loader.get_template('my_template.html')
c = Context({ 'graph': myGraph })
return HttpResponse(t.render(c))


Have a read through this part of the documentation:
http://docs.djangoproject.com/en/1.1/topics/http/views/#topics-http-views

HTH
Dan


>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Python Graph

2010-01-27 Thread Daniel Hilton
2010/1/27 Bhaskar Gara :
> No luck.
>
> url.py
> url(r'^member/score/compare/$', direct_to_template,
>            {'template': 'member_score_compare.html'},
> name='member_score_compare'),
>
>
> view.py
> def prev_score(request):
>    template_name = 'member_score_compare.html'
>    graph = graphs.BarGraph('vBar')
>    graph.values = [380, 150, 260, 310, 430]
>    myGraph =  graph.create()
>    return render_to_response(template_name,
>                   { 'graph': myGraph },
>                    context_instance=RequestContext(request))
>
> thank you
> Bhaskar

In your example, the request will never touch your view function as
you're using the generic view to render straight to template.
Try placing this at the top of your urls.py:

from YOUR_APP_NAME.views import view

And then in your urls.py:


url(r'^member/score/compare/$', view,
{'template': 'member_score_compare.html'},
 name='member_score_compare'),

Although you'll prob get an error on your view name. Have a look at:
http://docs.djangoproject.com/en/1.1/topics/http/urls/#topics-http-urls

HTH

Dan


>
> On Jan 27, 3:40 am, Daniel Hilton  wrote:
>> 2010/1/27 Bhaskar Gara :
>>
>>
>>
>>
>>
>> > Hi,
>>
>> >    I am very new to django.  I am trying to use this library for my
>> > graphs
>> >http://www.gerd-tentler.de/tools/pygraphs/?page=introduction
>>
>> > In my Views.py
>>
>> > prev_score(request):
>> >        graph = graphs.BarGraph('vBar')
>> >        graph.values = [380, 150, 260, 310, 430]
>> >        print graph.create()
>>
>> > In my Template  "score_compare.html"  in between the screen  I kept
>> > below code where it need to display the graph.
>>
>> >                {{ prev_score }}
>>
>> > It not erroring out,  but the graph is not displaying.  Please help.
>>
>> > Thank you
>> > Bhaskar
>>
>> Within a view function you can't print html out, you need to return
>> the output of the function.
>>
>> So, using your example, this should give you your graph:
>>
>> from django.template import loader, Context
>>
>> def prev_score(request):
>>     graph = graphs.BarGraph('vBar')
>>     graph.values = [380, 150, 260, 310, 430]
>>     myGraph =  graph.create()
>>     t = loader.get_template('my_template.html')
>>     c = Context({ 'graph': myGraph })
>>     return HttpResponse(t.render(c))
>>
>> Have a read through this part of the 
>> documentation:http://docs.djangoproject.com/en/1.1/topics/http/views/#topics-http-v...
>>
>> HTH
>> Dan
>>
>>
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/django-users?hl=en.
>>
>> --
>> Dan Hilton
>> www.twitter.com/danhiltonwww.DanHilton.co.uk
>> - Hide quoted text -
>>
>> - Show quoted text -
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Python Graph

2010-01-28 Thread Daniel Hilton
On 27 January 2010 17:56, Bhaskar Gara  wrote:
> I am really stupid. After cut & Paste I need to double check what i
> pasted.
>
> Thank you very much Dan and sorry for wasting your time.
>
> Lesson learned.

I usually find all my mistakes are stupid ones. I actually find a
little comfort in this!

Good luck with Django - it's a great framework.
Cheers,
Dan

>
> On Jan 27, 11:16 am, Daniel Hilton  wrote:
>> 2010/1/27 Bhaskar Gara :
>>
>>
>>
>>
>>
>> > No luck.
>>
>> > url.py
>> > url(r'^member/score/compare/$', direct_to_template,
>> >            {'template': 'member_score_compare.html'},
>> > name='member_score_compare'),
>>
>> > view.py
>> > def prev_score(request):
>> >    template_name = 'member_score_compare.html'
>> >    graph = graphs.BarGraph('vBar')
>> >    graph.values = [380, 150, 260, 310, 430]
>> >    myGraph =  graph.create()
>> >    return render_to_response(template_name,
>> >                   { 'graph': myGraph },
>> >                    context_instance=RequestContext(request))
>>
>> > thank you
>> > Bhaskar
>>
>> In your example, the request will never touch your view function as
>> you're using the generic view to render straight to template.
>> Try placing this at the top of your urls.py:
>>
>> from YOUR_APP_NAME.views import view
>>
>> And then in your urls.py:
>>
>> url(r'^member/score/compare/$', view,
>>             {'template': 'member_score_compare.html'},
>>  name='member_score_compare'),
>>
>> Although you'll prob get an error on your view name. Have a look 
>> at:http://docs.djangoproject.com/en/1.1/topics/http/urls/#topics-http-urls
>>
>> HTH
>>
>> Dan
>>
>>
>>
>>
>>
>>
>>
>> > On Jan 27, 3:40 am, Daniel Hilton  wrote:
>> >> 2010/1/27 Bhaskar Gara :
>>
>> >> > Hi,
>>
>> >> >    I am very new to django.  I am trying to use this library for my
>> >> > graphs
>> >> >http://www.gerd-tentler.de/tools/pygraphs/?page=introduction
>>
>> >> > In my Views.py
>>
>> >> > prev_score(request):
>> >> >        graph = graphs.BarGraph('vBar')
>> >> >        graph.values = [380, 150, 260, 310, 430]
>> >> >        print graph.create()
>>
>> >> > In my Template  "score_compare.html"  in between the screen  I kept
>> >> > below code where it need to display the graph.
>>
>> >> >                {{ prev_score }}
>>
>> >> > It not erroring out,  but the graph is not displaying.  Please help.
>>
>> >> > Thank you
>> >> > Bhaskar
>>
>> >> Within a view function you can't print html out, you need to return
>> >> the output of the function.
>>
>> >> So, using your example, this should give you your graph:
>>
>> >> from django.template import loader, Context
>>
>> >> def prev_score(request):
>> >>     graph = graphs.BarGraph('vBar')
>> >>     graph.values = [380, 150, 260, 310, 430]
>> >>     myGraph =  graph.create()
>> >>     t = loader.get_template('my_template.html')
>> >>     c = Context({ 'graph': myGraph })
>> >>     return HttpResponse(t.render(c))
>>
>> >> Have a read through this part of the 
>> >> documentation:http://docs.djangoproject.com/en/1.1/topics/http/views/#topics-http-v...
>>
>> >> HTH
>> >> Dan
>>
>> >> > --
>> >> > You received this message because you are subscribed to the Google 
>> >> > Groups "Django users" group.
>> >> > To post to this group, send email to django-us...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to 
>> >> > django-users+unsubscr...@googlegroups.com.
>> >> > For more options, visit this group 
>> >> > athttp://groups.google.com/group/django-users?hl=en.
>>
>> >> --
>> >> Dan Hilton
>> >> www.twitter.com/danhiltonwww.DanHilton.co.uk
>> >> - Hide quoted text -
>>
>> >> - Show quoted text -
>>
>> > --
>>

Re: svn checkout problems? (at around 2:50 pm GMT, 2010-01-29)

2010-01-29 Thread Daniel Hilton
On 29 January 2010 14:59, chefsmart  wrote:
> For the last 1 hour I have been trying to checkout a fresh copy of
> django-trunk from svn. But the checkout is failing.  Unfortunately, I
> don't have the exact message I have been receiving, but just wondering
> if anybody else facing similar issues with checkout?
>
> Regards.

I had an issue about half an hour ago but it was because I was being foolish.

I had 'browser' rather than 'svn' in the url.

Check the svn url perhaps?

HTH
Dan

>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: virtual currency / check-in apps

2010-06-23 Thread Daniel Hilton
No but you can do 'badges' or awards with this:

http://bitbucket.org/jiaaro/django-badges/src

HTH
Dan

On 23 June 2010 00:28, Greg Pelly  wrote:
> Can anyone recommend any apps/tools for implementing either virtual currency
> or "check-ins" in Django?
> Thanks,
>
> Greg
>
> --
> 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.
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Signal emitted after successful login?

2010-06-29 Thread Daniel Hilton
On 29 June 2010 20:07, Andy McKay  wrote:
> On 2010-06-29, at 10:48 AM, tiemonster wrote:
>
>> Is a signal emitted after a successful login? I need to hook a
>> particular piece of code into that point in the application.
>
One easy way is to wrap the login view function and execute your code
once a user has successfully been authorised. If you look at the
account app included in
Pinax, there is an example of how this could work.

HTH,
Dan


>
> Not specifically, if you are using django.contrib.auth last_login is set by 
> some scripts, eg the login django.contrib.auth.login. So you can listen to 
> the save signals on that model.
> --
>  Andy McKay, @andymckay
>  Django Consulting, Training and Support
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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 present N items in table row for list

2010-07-28 Thread Daniel Hilton
On 27 July 2010 17:51, Wadim  wrote:
> Hello.
> I have a list that i want to present in a table.
> Each row should have 5 items.
> For now i create the function that returns me new grouped list, that i
> use later in a template.
> def groupListByRow(list):
>        cnt=0
>        rows=[]
>        while cnt                row=[]
>                for x in range(5):
>                        if cnt                                row.append(list[cnt])
>                        else:
>                                row.append(None)
>                        cnt+=1
>                rows.append(row)
>        return rows;
> is there better way to do this? May be it is possible to do it inside
> template?
> Thanks
>

Hi Wadim

You could easily do this in the template with if tag:




{% for value in list  %}
{% if value.counter1|divisibleby:"5"  %}
 {{value}}


{% else %}
{{value}}
{% if  value == list|last%}

   {% endif %}

{% endif %}
{% endfor %}


I think that's right, it's off the top of my head so use with caution.
Cheers,
Dan







> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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 Daniel Hilton
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.

Saw this a couple of days ago:
http://github.com/diN0bot/Auto-Models

It's omnigraffle specific and I haven't used it but it does kinda fit your wish.

HTH
Dan



>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: SAAS User and Auth situation.

2010-02-22 Thread Daniel Hilton
On 22 February 2010 05:09, orokusaki  wrote:
> I'm developing an SAAS which means that I will have Accounts and those
> Accounts will have Users. Each account's Users are completely
> orthogonal to the Users of another Account. When a user logs in,
> they'll supply an Account ID, a username, and a password so username
> only needs to be unique with regards to the Account in question.
> Firstly, is there an app out there or somebody who knows how to
> conquer this? If so, I would truly appreciate the help or a link.
>
>
> Problem 1 (with built-in User object), maybe there is a way around
> this:

You could look at this app:

http://github.com/saas-kit/django-muaccounts

The rest of the saas-kit might be helpful too - I'm really loking
forward to the payment stuff coming from satchmo as well to help with
saas payments.


HTH
Dan

>
> A) User of Account 'acme' might have the username "mike" and the user
> for Account "general mills" might have a user with the username
> "mike" (since "mike" is a very common name this will certainly happen
> within the first day of getting clients). I can't control what
> Accounts' Users decide to make their username and I certainly don't
> want to make it like domain registration, like if a User has to check
> if a username is available before creating it (all common names would
> be taken after the first 100 accounts if the average account had 2-3
> users).






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



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Scrape a file, then put it in the django database

2010-03-08 Thread Daniel Hilton
On 8 March 2010 07:45, mjlissner  wrote:
> I'm trying to write a program that scrapes all the pdfs off of this
> page:
> http://www.ca3.uscourts.gov/recentop/week/recprec.htm
>
> And then puts them onto my hard drive, with the reference to their
> location in a FileField.
>
> I've defined a FileField in my model, and I believe I can scrape the
> site OK (though my code needs improvement), but I can't for the life
> of me figure out how to go from "here's my file" to "I've placed my
> file in the right directory, and there's a reference in my database to
> it - awesome."
>
> I could give more details, but I'm not entirely sure they'd be
> helpful. Essentially, I just want to know how to download a PDF, and
> store it locally, while updating the django db to point to it
> appropriately.
>
> So far, I've been very much unable to pull this off...
>
> Thanks,
>
> Mike

I'd write a management command that wraps around a couple of functions:


* One that gets the file and stores it locally using urllib2
* One that then takes the file and saves it in your model. (Have a
google for using django orm without the full django stack)

The thing to remember is to be nice when scraping and check that your
use of the data is legal.

You could break out the two parts and have one script that downloads
all teh files to a folder, then another that imports them all.

HTH
Dan











> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Cassandra backend

2010-03-29 Thread Daniel Hilton
2010/3/29 Ricardo Bánffy :
> Hi.
>
> I am about to be asked to either find a way to use Cassandra as a
> database backend or create one. Is there anyone working on something
> like this?
>

Do you mean writing a database backend for django ORM that supports Cassandra?
Have a look at the work of non-rel project on BitBucket:
http://bitbucket.org/wkornewald/django-nonrel/wiki/Home


Or do you mean using Cassandra in a form with django?
Twissandra as an example:
http://github.com/ericflo/twissandra


HTH
Dan

> --
> Ricardo Bánffy
> http://www.dieblinkenlights.com
> http://twitter.com/rbanffy
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


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



Multi-cores & Django

2010-04-01 Thread Daniel Hilton
I'm researching the deployment of a new internal app and the ops team
have asked me what type of server the app requires. What I'm looking
for is some advice / guidance on how best to make
use of multi cores in a single machine deployment.

We are currently running mod_wsgi, postgresql on a single machine.

What I've read has said that due to GIL you need to run multi-process
mod_wsgi and make use of that to

(I know a separate db server would be best, I know!)
(And I know the web app will always be the bottleneck, I'm just
looking for best practise.)

Thanks in advance,
Dan

-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: DB Adapter for HTML5 Client Database Storage?

2010-04-07 Thread Daniel Hilton
On 7 April 2010 08:45, Victor Hooi  wrote:
> heya,
>
> This is a bit of random musing, but I was wondering, how big a project
> is it to write a DB adapter for the Client-side Client-side Database
> Storage API in HTML5?
>
> That is, there are already efforts to integrate in things like CouchDB
> and MongoDB models, surely using HTML5's client-side Storage wouldn't
> be too much of a stretch.

Related but still not true html5 storage is lawnchair & Deckchair:

http://www.agmweb.ca/blog/andy/2250/

HTH
Dan

>
> Are there any large barriers to an effort like this?
>
> Cheers,
> Victor
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Equivalent of php json_encode?

2010-05-04 Thread Daniel Hilton
On 4 May 2010 15:34, zweb  wrote:
> Is there a django or python equivalent of php json_encode?
>
> the data I am converting to json has text fields that have quotes,
> double quotes, newlines and html tags. Creating json manually in my
> program without escaping or converting these special characters is
> causing problem on javascript side.
>
> A php programmer suggested I use equivalent of php json_encode.
>

Have a look at django.serializers
http://docs.djangoproject.com/en/dev/topics/serialization/
 or simple-json python package.

HTH
Dan

> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


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



Form multiple inheritance

2010-05-11 Thread Daniel Hilton
Hi

I've got two ModelForms, both really simple.

class TaskBaseForm(forms.ModelForm):


class Meta:
model = Task


class TaskAssignmentDurationForm(forms.ModelForm):
""" Form for setting the duration of an existing TaskAssignment object. """

class Meta:
model = TaskAssignment
fields = [
"days",
"hours"
]



class TaskUberForm(TaskBaseForm):
"""
Using the magic of multiple inheritance we can combine our two forms to
create a new form that makes sense to the user and presents the
disparative data models in a nice way.
"""
__metaclass__ =  getMixupFormMetaClass()



I then define a third form that inherits from both, making use of the
classmaker[1] factory to get rid of any multi inheritance issues.

The new form that I've created then won't display any of the second
form's fields.

Any ideas how I can get this to work?

I've looked at this ticket: http://code.djangoproject.com/ticket/7018
, implementing the last resolution to solve the issue.
[1]And I've implemented the classmaker:
http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/

I feel like I'm missing something obvious here?

Many Thanks in Advance,
Dan


-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Server on diffferent machine

2010-05-16 Thread Daniel Hilton
On 16 May 2010 19:25, bax...@gretschpages.com  wrote:
> I know this is something stupid I'm missing, but I'm not getting it.
>
> I'm trying to run my Django from one cloud instance and the DB from
> another, to (hopefully) optimize each server for task and balance the
> load a bit.
>
> On the DB server, I have mysql installed and have a working database
> running on the default port 3306. I do not have a domain assigned to
> this server, only a raw IP.
>
> On the django side, I'm not sure what my settings should be to connect
> to it. So far, everything I've tried has resulted in
> _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host
> '< THE IP >' (1)")
>
> Settings.py looks like:
>
> DATABASES = {
>    'default': {
>        'ENGINE': 'django.db.backends.mysql',
>        'NAME': 'django',
>        'USER': '',
>        'PASSWORD': 'XXX',
>        'HOST': '< THE IP >',
>        'PORT': '3306',
>    }
> }
>
> What am I missing?


Can you ping the db machine from the webserver?
Can you access the db machine from the webserver using a mysql client
such as Navicat or such like?

My 2p is on the db machine not having the right port open or denying
non-local connections.

HTH
Dan



>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Server on diffferent machine

2010-05-16 Thread Daniel Hilton
On 16 May 2010 20:22, bax...@gretschpages.com  wrote:
>
>
> On May 16, 1:55 pm, Daniel Hilton  wrote:
>
>> Can you ping the db machine from the webserver?
>> Can you access the db machine from the webserver using a mysql client
>> such as Navicat or such like?
>
> I can go to the DB machine via phpmyadmin.
Is the phpmyadmin on the dbmachine? If so that doesn't prove that the
machine is accepting non-local mysql requests.

> However, when I try to ping the IP, it fails. Strange.
>>
>> My 2p is on the db machine not having the right port open or denying
>> non-local connections.
>
> It's definitely port 3306 (double-checked). Not sure about non-local
> connections. And the ping thing is weird to me.

If you can't ping the dbserver from the webserver can you ssh from the
webserver to the dbserver?

What distro are you using?

Cheers,
Dan

>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Sync user objects with sympa mailinglist

2010-05-19 Thread Daniel Hilton
On 19 May 2010 00:02, Dexter  wrote:
> Hi,
> I want to sync emailadresses in the django.contrib.auth User model, to a
> sympa mailinglist subscriberlist.
> I really don't have any experience with sympa. So I don't know how this
> process usually goes,
> but what I did found out, is that sympa documentation is lacking a bit.
> I find the concepts they use really vague, but I guess its powerful as well.
> Does anyone know how this is done?
> Grtz, Dexter

You would have to write a management command that did the sync.

Your command could then make use of the bulk load command as outlined here:

http://www.sympa.org/manual_6.1/database#importing_data_from_a_text_file

All you would need is a management command that either wrapped around
that creating a stream of text which could then be piped in or that it
did that for you.

Alternatively if you wanted to run the django instance on a different
machine (recommended++) you could make use of their SOAP server.

I would recommend having a look at Suds, a really nice python package
for talking to soap services.

HTH
Dan






>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-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.
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Sync user objects with sympa mailinglist

2010-05-19 Thread Daniel Hilton
On 19 May 2010 14:51, Dexter  wrote:
> Hi thanks for your replies,
> I couldn't run the django page on a different server, because I only have
> one VPS running.
> But I understand there isn't a way to catch "events" on a database update.
> Grtz, Dexter


If you wrote a management command, you could add it to the crontab for
your VPS with it running every 30 mins or faster, that syncs any user
that isn't already in sympa.

You could have a boolean field on a profile of a user, and when a user
is successfully added to Sympa, the boolean is set to true.

That way you don't have to catch any events, just make sure your cron
job runs regularly to keep the two in sync.
Cheers,
Dan





>
> On Wed, May 19, 2010 at 3:43 PM, Daniel Hilton 
> wrote:
>>
>> On 19 May 2010 00:02, Dexter  wrote:
>> > Hi,
>> > I want to sync emailadresses in the django.contrib.auth User model, to a
>> > sympa mailinglist subscriberlist.
>> > I really don't have any experience with sympa. So I don't know how this
>> > process usually goes,
>> > but what I did found out, is that sympa documentation is lacking a bit.
>> > I find the concepts they use really vague, but I guess its powerful as
>> > well.
>> > Does anyone know how this is done?
>> > Grtz, Dexter
>>
>> You would have to write a management command that did the sync.
>>
>> Your command could then make use of the bulk load command as outlined
>> here:
>>
>> http://www.sympa.org/manual_6.1/database#importing_data_from_a_text_file
>>
>> All you would need is a management command that either wrapped around
>> that creating a stream of text which could then be piped in or that it
>> did that for you.
>>
>> Alternatively if you wanted to run the django instance on a different
>> machine (recommended++) you could make use of their SOAP server.
>>
>> I would recommend having a look at Suds, a really nice python package
>> for talking to soap services.
>>
>> HTH
>> Dan
>>
>>
>>
>>
>>
>>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Django users" group.
>> > To post to this group, send email to django-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.
>> >
>>
>>
>>
>> --
>> Dan Hilton
>> 
>> www.twitter.com/danhilton
>> www.DanHilton.co.uk
>> 
>>
>> --
>> 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.
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: GeoDjango: Measure distance between two points.

2010-06-13 Thread Daniel Hilton
On 13 June 2010 06:24, Tyler Andersen  wrote:
> I'm trying to figure out how to take two Point objects and determine
> the distance between them.
>
> It seems that it is trivial to search the DB (well, provided that I'm
> not using mySQL, which I am) to filter by distance, however, that's
> not what I'm looking for at the moment.
>
> I have a set of Point objects, and I'd like to compute the distance in
> miles for each.
>
> For Point objects a, b, one can "a.distance(b)", however, a number is
> returned not a Distance object. I'm having trouble finding
> documentation on what this value represents (I could perhaps plug it
> into D(=a.distance(b)).mi).

Try this query on the Geodjango list: http://groups.google.com/group/geodjango

But to try and answer your question:

Are you trying to get the distance of a set of objects from a point?

So for example, say you were looking for houses from a railway
station? Or are you looking at finding the distance between each of a
set of points that have an order? Like waypoints on a path?

As for what metric it returns, I'd say have a look at the documentation here:
http://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#distance-lookups


Hope that helps,
Cheers,
Dan







>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Save uploaded file to remote machines?

2010-12-28 Thread Daniel Hilton
On 28 December 2010 07:12, Andy  wrote:
> I'm using forms.FileField() to allow users to upload photos.
>
> After a photos is uploaded, I want to save the photo to one or more
> than one remote machine(s) which are dedicated to serving images. How
> do I do that?
>
> Thanks.

Have a look at this app:
https://github.com/seanbrant/django-queued-storage

That will manage moving the file to a backend storage system (s3, SAN,
etc) and handle the movement time as well.

HTH
Dan

>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:15, galago  wrote:
> Is there any working toolbar for Django 1.3?
> https://github.com/dcramer/django-debug-toolbar - this doesn't work in my
> project based on 1,3 :/
>

Doesn't work how?

Stack trace or more info please!

Cheers,
Dan

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



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:24, galago  wrote:

> It doesn't work when I switch on the panel for SQL
> ('debug_toolbar.panels.sql.SQLDebugPanel',). Without that panel it works.
> That's error:
> TemplateSyntaxError at /
>
> Caught AttributeError while rendering: 'Cursor' object has no attribute 'db'
>
> Request Method:GETRequest URL:http://localhost:8000/Django Version:1.3
> beta 1 SVN-15519Exception Type:TemplateSyntaxErrorException Value:
>
> Caught AttributeError while rendering: 'Cursor' object has no attribute 'db'
>
>
Are you running devserver as well? I found I had an issue with the both of
them so deactivated the sql panel in debug toolbar so I got the sql queries
in the devserver instead.

Cheers,
Dan


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



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:34, galago  wrote:
> I run my sever on localhost (manage.py runserver).
> Is there any way to display all queries in console or somewhere else?

Yes, if you install dcramer's devserver, which is a straight
replacement for the runserver command.

More info and install guide here: https://github.com/dcramer/django-devserver

Or using pip:
 pip install django-devserver

HTH
Dan


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



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: eval if an object meets with a queryset.

2011-03-01 Thread Daniel Hilton
On 1 March 2011 10:55, Marc Aymerich  wrote:
> Hi!,
> I have a model class like this one:
>
> class Domain(models.Model):
>    active = models.BooleanField()
>    root = models.CharField(max_length=6)
>
> now given a Domain instance I need to know if it meets with an
> expresion like this one:
>
> active=True and (root='com' or root='net')
>
> one way to do that is get all domains that meets the expresion
> (formated as queryset) and check if the object is one of them.
> But maybe there is a more direct way to check it?

You can use filter's with get so:

Try:
   myDomain =  Domain.objects.get(active=True, etc...)
except myDomain.DoesNotExist:
  myDomain = None

Kinda like that ish.

HTH
Dan

>
> Thanks!
> --
> Marc
>
> --
> You received this message because you are subscribed to the Google 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Some clues on multi language webapp on Django

2011-03-22 Thread Daniel Hilton
On 22 March 2011 14:18, Andre Lopes  wrote:
> Hi,
>
> I'm new to Django. I need some clues on how to design a multi language
> webapp on Django. There are some some examples, tips and tricks about
> the best way of doing it?
>
> PS: Sorry for my english.

Have a look at django-localeurl and django-mothertongue as well.
Cheers,
Dan



>
> Best Regards,
>
> --
> You received this message because you are subscribed to the Google 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Johnny Cache on Django 1.3

2011-04-04 Thread Daniel Hilton
On 4 April 2011 08:16, Charlie Offenbacher
 wrote:
> Hi everyone!
>
> I'm try to install johnny-cache on Django 1.3. I literally followed
> the instructions here (http://packages.python.org/johnny-cache/#)
> exactly, using the memcached version.
>
> Evverything runs okay, but nothing gets cached at all when I telnet to
> memcached. When I used cache-machine, that worked fine, so I know my
> memcached installation works.
>
> Any suggestions on how to debug this problem?
>
> Thanks for your time!!
> ~Charlie
>
> --
> You received this message because you are subscribed to the Google 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.
>
>

If you read the docs (http://packages.python.org/johnny-cache/) on
pypi  there is a reference to the incompatibility and the cause of the
problem.

Cheers,
Dan



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Stackoverflow kind of Answer/commenting app in Django

2011-04-15 Thread Daniel Hilton
On 15 April 2011 13:01, roberto  wrote:
> You can also have a look at askbot.
> It seems to have more functionalities.
> Good luck !
>
> www.askbot.org
>
> On Apr 14, 6:43 pm, AJ  wrote:
>> Why has this become a case for me? I just wanted to know about a particular
>> solution, that whether it exists or not. I did try Google and other forums.
>>
>> I never complained about 'a couple of days', someone else did.
>>
>> I apologize for asking a 'dumb' question by your standards. Please accept my
>> sincere thanks to all who replied and helped.
>
> --
> You received this message because you are subscribed to the Google 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.
>
>
Having built one for a project, it took about 10 days with tests and
integration.

You could use a rating app via generic foreign keys to cut some time down.
HTH
Dan



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Do any financial firms use a Django framework?

2011-05-03 Thread Daniel Hilton
On 3 May 2011 15:53, rpt...@reportlab.com  wrote:
> Does anyone know of any financial firms which use a Django framework?
> I am preparing a proposal to build a web based solution for a
> financial firm using Django, and some key players there would be much
> more comfortable if I could point to some "serious" firms in finance
> or similar industries which use Django.
>
> I have googled around and found some links such as:
>
>  - http://www.djangosites.org/
>
>  - http://bostinnovation.com/2011/03/31/boston-companies-using-django/
>
> But a lot of these examples are from news and social networking
> sites.
>
> If anyone can give examples of Django being used by financial firms or
> blue-chip companies, it would be very appreciated.
>
> Thanks,
>
> Tom
Hi Tom

The UK based payment service provider Secure Trading use it[1]  as do
Accountis[2] who use python as well as they were also recruiting
django developers, if I remember correctly.

HTH
Dan

[1] http://www.securetrading.com/jobs.html
[2] http://www.accountis.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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: UK-based Django Host?

2011-05-25 Thread Daniel Hilton
On 24 May 2011 20:01, Nan  wrote:
> Thanks, Matt.  Normally I'd agree with you, but this application isn't
> just a website -- it's sensitive to latency issues and will be
> integrating with a third-party service that's also UK-based, so we're
> looking at minimizing cross-Atlantic round-trips.

If you're that worried about latency then a cheap lowend vps maybe the
way. Both slicehost, Rackspace cloud and linode do
London based vps's or try tagadab. Or what about an amazon small
instance in Ireland? Or ovh in France or london?

For actual hardware have a look on http://www.lowenddedi.net/

HTH
Dan

>
>
>
> On May 24, 2:46 pm, shofty  wrote:
>> just use webfaction, you dont know that they're US when you connect
>> from the UK, speed isnt an issue.
>> I moved to a VPS for cost reasons, but webfaction were fine for me.
>>
>> Matt
>>
>> On May 24, 6:03 pm, Nan  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > I know this question has been asked before, but the most recent thread
>> > I can find in the archives is from 2007, and presumably the landscape
>> > has changed since then.
>>
>> > I'm looking for a Webfaction-like host with servers in the UK.  It
>> > needs to allow long-running processes, of course, and would ideally be
>> > (like Webfaction) fully managed.  (We don't have the staff to keep a
>> > server updated or tuned).  We need plenty of memory, shell access (of
>> > course), and preferably mod_wsgi.
>>
>> > Does anyone have any recommendations of hosts they've worked with?
>>
>> > Thanks!
>> > -Nan
>
> --
> You received this message because you are subscribed to the Google 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: UK-based Django Host?

2011-05-25 Thread Daniel Hilton
On 25 May 2011 14:43, Nan  wrote:
>
> Thanks for the suggestions, guys.  I've heard great things about
> Linode, but we really need managed hosting.

Then have a look at Rackspace cloud managed options - I think that's
the closest you're going to get without finding an individual /
technical organisation to manage it for you.

Cheers,
Dan
>
> On May 25, 7:24 am, Simon Connah  wrote:
>> On 24 May 2011, at 18:03, Nan wrote:
>>
>> > I know this question has been asked before, but the most recent thread
>> > I can find in the archives is from 2007, and presumably the landscape
>> > has changed since then.
>>
>> > I'm looking for a Webfaction-like host with servers in the UK.  It
>> > needs to allow long-running processes, of course, and would ideally be
>> > (like Webfaction) fully managed.  (We don't have the staff to keep a
>> > server updated or tuned).  We need plenty of memory, shell access (of
>> > course), and preferably mod_wsgi.
>>
>> > Does anyone have any recommendations of hosts they've worked with?
>>
>> > Thanks!
>> > -Nan
>>
>> I use Linode (US based host) with a VPS in their London datacentre. It's 
>> fantastic. The IRC channel is chock full of Python programmers as well :).
>>
>> Simon.
>
> --
> You received this message because you are subscribed to the Google 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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 REST

2012-03-04 Thread Daniel Hilton
On 4 March 2012 18:35, Jani Tiainen  wrote:
> I've been very happy with django-rest-framework.
>
> I think there exists at least django-piston to do the same.

The other one to look at is django-tastypie - I've used it twice now
in anger and been really happy with it plus the rate of development /
improvement I've seen.

Cheers,
Dan

>
> And you can write it also "manually". Since REST is just architectural
> specification and doesn't involve any special magic.
>
> On Sun, Mar 4, 2012 at 8:13 PM, Bharath Mundlapudi 
> wrote:
>>
>> Dear Django Users and Authors,
>>
>> I am wondering if there are any best practices or better way to write REST
>> based apps on top of Django. I was using version 1.1 and not followed recent
>> advancements. Can you kindly point me to links or references from your
>> experience.
>>
>> Preferably out-of-the-box solutions.
>>
>> -Bharath
>>
>> --
>> You received this message because you are subscribed to the Google 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.
>
>
> --
>
> Jani Tiainen
>
> --
> You received this message because you are subscribed to the Google 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.



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Help with django-paypal anyone?

2012-03-22 Thread Daniel Hilton
On 22 March 2012 05:47, Jonathan Baker  wrote:
> You'll need to enable the CSRF middleware, adjust your view and make use of
> the {% csrf_token %} template tag in your template. Details can be found
> here: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
>
>
> On Wed, Mar 21, 2012 at 11:35 PM, Stanwin Siow 
> wrote:
>>
>> Hello,
>>
>> I was following this tutorial on django-paypal from this link:
>>  http://od-eon.com/blogs/nai/django-paypal-step-step-integration/?c=619
>>
>> i managed to get the paypal button working but when i click return to home
>> page i get a CSRF token not found.
>>
>> Please advise on how i should continue?
>>
>> I would appreciate any help rendered.
>>
>> Thank you.
>>
>> Best Regards,
>>
>> Stanwin Siow

Hey!

Which fork are you using? dcramer's on github was the best when I was
working with this last year.

HTH
Dan



>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
> --
> Jonathan D. Baker
> Web Developer
> http://jonathandbaker.com
> 303.257.4144
>
> --
> You received this message because you are subscribed to the Google 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.



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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: Help with django-paypal anyone?

2012-03-22 Thread Daniel Hilton
On 22 March 2012 10:20, Stanwin Siow  wrote:
> hey daniel,
>
> I used the johnbox version.
>

I found this version has more uptodate bug fixes and features:
https://github.com/dcramer/django-paypal

HTH
Dan



> Should be ok right?
>
> Best Regards,
>
> Stanwin Siow
>
>
>
> On Mar 22, 2012, at 6:01 PM, Daniel Hilton wrote:
>
> On 22 March 2012 05:47, Jonathan Baker  wrote:
>
> You'll need to enable the CSRF middleware, adjust your view and make use of
>
> the {% csrf_token %} template tag in your template. Details can be found
>
> here: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
>
>
>
> On Wed, Mar 21, 2012 at 11:35 PM, Stanwin Siow 
>
> wrote:
>
>
> Hello,
>
>
> I was following this tutorial on django-paypal from this link:
>
>  http://od-eon.com/blogs/nai/django-paypal-step-step-integration/?c=619
>
>
> i managed to get the paypal button working but when i click return to home
>
> page i get a CSRF token not found.
>
>
> Please advise on how i should continue?
>
>
> I would appreciate any help rendered.
>
>
> Thank you.
>
>
> Best Regards,
>
>
> Stanwin Siow
>
>
> Hey!
>
> Which fork are you using? dcramer's on github was the best when I was
> working with this last year.
>
> HTH
> Dan
>
>
>
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
>
> "Django users" group.
>
> To post to this group, send email to django-users@googlegroups.com.
>
> To unsubscribe from this group, send email to
>
> django-users+unsubscr...@googlegroups.com.
>
> For more options, visit this group at
>
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
>
> --
>
> Jonathan D. Baker
>
> Web Developer
>
> http://jonathandbaker.com
>
> 303.257.4144
>
>
> --
>
> You received this message because you are subscribed to the Google 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.
>
>
>
>
> --
> Dan Hilton
> 
> www.twitter.com/danhilton
> www.DanHilton.co.uk
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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 make a small change for apps installed under /site-packages dir

2012-02-05 Thread Daniel Hilton
On 5 February 2012 17:16, Tom Lesters  wrote:
> hi all,
>
> I installed an app called idios into python2.6/site-packages/idios dir,
>
> now I need to make a small change, adding the following line(just for
> purpose of explaining this question)
> @login_required
> to one of the functions defined in idios/views.py
>
> The way I can think of is I can copy all the app's source .py files into my
> project/apps dir, then I can make whatever changes I want,
> but seems that's against the principle of using those apps as library.
> is there a better way of doing that?
>
> or it's just the nature of any django apps:
> if you need to modify anything in the urls.py ,views.py or models.py,
> you just grab the source and make is as a local project app?
>
> I know for template files I can just copy individual file into my project
> dir and leave the rest under /site-packages,
> but how about the .py files?
>

One way you could do this is to copy the urls.py from idios into your
urls.py and wrap just that url pattern with
login_required:


url(r'^blah/$', login_required(views.blah), name = 'idios_blah')


HTH
Dan




> thanks,
> Tom
>
> --
> You received this message because you are subscribed to the Google 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.



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
You received this message because you are subscribed to the Google 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.