Re: One to Many+foreign key Query: best way to build the optimal result

2009-06-25 Thread Sam Walters
tle': loc.location.title, 'id': > loc.location.id, 'state_id': loc.state.id, 'name': loc.name} \ > for loc in locations.iterator() > ] > > render_to_response('template.htm', {'results': results}) > > I run a query si

Help using the django queries API to select columns from multiple tables

2009-06-28 Thread Sam Walters
Hi I am using django 1.0 to redevelop a website. I have read http://docs.djangoproject.com/en/1.0/topics/db/queries/ and cant work out how to do my query except using raw sql. It would be great to be able to use the django query api so i can stack queries more easily. Just one working example woul

Re: Help using the django queries API to select columns from multiple tables

2009-06-29 Thread Sam Walters
ign key relationship work with the current schema then I will move it as you have suggested. Do you know how to build the admin.py to circumvent this issue? On Mon, Jun 29, 2009 at 6:51 PM, Daniel Roseman wrote: > > On Jun 29, 4:57 am, Sam Walters wrote: > > Hi > > I am using d

Re: Best distro for django

2009-07-03 Thread Sam Walters
It should not matter. Any modern Linux Distro which supports the dependencies will be no different. The only conceivable way this question makes sense is if you want to make install or deployment easy. In which case use something thats based on a debian, fedora type distro where there is heaps of

AttributeError when trying to save and access models

2009-07-14 Thread Sam Walters
Hi Django world I keep getting problems accessing and storing data in foreignkey and one-to-one relationships. Error is basically of the form: "AttributeError Exception Value: 'DirectoryAdmin' object has no attribute 'abbrev'" The models.py file is here: http://pastebin.com/mcc4ee45 The SQL it pr

Help building a custom RadioSelect widget.

2009-08-03 Thread Sam Walters
Hi fellow Django users. This is the first time necessity has required me to look at overriding functionality in the django code. I need to replace the and tags in a choicefield using radio buttons with tags as my project has very specific formatting requirements for this form. I basically do

Re: Help building a custom RadioSelect widget.

2009-08-04 Thread Sam Walters
Thanks David This example is exactly what i was hoping for. I hope something like this gets put into a tutorial because i guess many people would need to control exactly what their form looks like. Cheers -Sam On Tue, Aug 4, 2009 at 11:00 PM, David De La Harpe Golden wrote: > > Sam W

Re: Django documentation site is SLOW

2009-08-07 Thread Sam Walters
Hi Its probably not the browser. I am using firefox 3.5 on an eee pc and the documentation is fine. This is with Javascript disabled using noscript however i just turned it on again and no noticable difference in top readings *You should look at the install addons of firefox, eg: some plugin whic

Re: Editors of choice

2009-09-10 Thread Sam Walters
Vim in conjunction with Git - most powerful + extensible editor out there in my humble opinion. On Thu, Sep 10, 2009 at 7:46 PM, boyombo wrote: > > Vim + pydiction + django.vim > > On Sep 10, 1:31 pm, eka wrote: >> Vim + RopeVim + Omincompletion + taglist + tasklist + python_fn >> >> On Sep 10,

One to Many+foreign key Query: best way to build the optimal result

2009-06-17 Thread Sam Walters
Here is the essentials from my models.py file: class Event (models.Model): contact = models.CharField(max_length=100) email = models.CharField(max_length=100) url = mod

help, insert into a foreign key produces unusual 'invalid keyword argument' error

2009-10-15 Thread Sam Walters
Hi, im using django 1.0+mysql I get an unexpected error: "'event' is an invalid keyword argument for this function" I get using a django view which used to work for moving data into the mysql db by saving a foreign key instance of 'Event' in 'Category'. 1. The model is: class Event (models.Model

Mod_wsgi from source + centos 4.8 compile issue

2009-11-05 Thread Sam Walters
Hi I am trying to get mod_wsgi installed on a production server. Apache: 1.3.37 Kernel: 2.6.17.13-vs2.0.2.1vs-1.00 Os: CentOS 4.8 Following instructions from: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide at the point with: ./configure --with-apxs=/usr/local/apache/bin/apxs --with

Re: Performance monitoring

2009-12-09 Thread Sam Walters
You can always place some more performance testing code inside your views: import time t = time.time() search_time=0.00 # #place some code which hits the database here # search_time+=time.time()-t search_time="%.3f"%(search_time) This does not test the memory footprint of your

Need help: customise a multi-key dictionary sort to put None objects at the end.

2009-12-16 Thread Sam Walters
Hi I have been reading stuff like: http://wiki.python.org/moin/SortingListsOfDictionaries I want to sort a list of dictionaries (alphanumeric values) by multiple keys (achieved with code below). However I would like to customise the comparator to put empty objects last. eg: def orderBasedOnDepa

Re: Need help: customise a multi-key dictionary sort to put None objects at the end.

2009-12-17 Thread Sam Walters
Thanks Daniel Yes, it was multiple keys not just 'department'. Will have a go and do some more reading on lambda. cheers -sam On Thu, Dec 17, 2009 at 8:38 PM, Daniel Roseman wrote: > On Dec 17, 6:23 am, Sam Walters wrote: >> Hi I have been reading stuff like: >> >&

Re: django with mod_wsgi on centos

2010-05-10 Thread Sam Walters
Yes, +1 to forgetting to update permissions at some stage of the game. Best approarch to all this stuff is to make an interactive bash script so wen you update a production server you just run the script. Or document the steps, its often the smaller obvious steps which catch people out. On Mon,

Re: how to display an image inside Django

2010-05-12 Thread Sam Walters
Specifically what do you want to do? 1. Write a form to upload and display an image? 2. Dynamically display/generate an image? eg: http://effbot.org/zone/django-pil.htm 3. hyperlink an image from a templates folder or media folder? (with either django test server or a production server) On Tue,

Re: Google maps like app for Django for small area?

2010-06-02 Thread Sam Walters
http://geodjango.org/ On Thu, Jun 3, 2010 at 11:35 AM, Stodge wrote: > Is there a Django app (or SDK/API/technology/etc) that can recreate > Google maps for a small area (say 60 square miles) with all maps > stored locally on the server? Thanks > > -- > You received this message because you are

Nginx-fcgi setup guidance needed to render certain views with HTTPS.

2010-07-01 Thread Sam Walters
Hi Django Users I have been looking to make some of my views secured by SSL, i have made a certificate for testing. For the views which require https i rewrite the url and redirect using a decorator. In theory this should redirect and nginx will server the views through https. Instead what i fin

Re: Nginx-fcgi setup guidance needed to render certain views with HTTPS.[solved]

2010-07-19 Thread Sam Walters
2, 2010 at 12:48 PM, Sam Walters wrote: > Hi Django Users > > I have been looking to make some of my views secured by SSL, i have > made a certificate for testing. > > For the views which require https i rewrite the url and redirect using > a decorator. > In theory this sho

Re: do QuerySet joins still suck?

2010-08-10 Thread Sam Walters
I dont think they do. The only time i use raw sql + joins is for performance... eg: When you have a model and for each instance of that model it has a reverse foreignkey relationship where you would have to call: _set.all() in a for loop thus making heaps of sql queries. There are 3rd party addo

Help with Geodjango+Postgres to find a Point, variance in decimal places

2010-08-24 Thread Sam Walters
Hi fellow Django developers I have Lat/Lng points stored in my db: class Airfield(models.Model): point = models.PointField(srid=4326) I noticed when i query on my development server with postgresql i DONT have to have the EXACT number of decimal places to find that point. (what i want) Howev

Re: Help with Geodjango+Postgres to find a Point, variance in decimal places

2010-08-25 Thread Sam Walters
the old > server, your representations of the number were precise enough to be > identical, but on the new server, there is enough precision in the database > to represent different numbers. > > > > "Reinout van Rees" wrote: > >>On 08/25/2010 02:57 AM, Sa

Re: ip to distance mapping

2010-08-26 Thread Sam Walters
I have used geoip in conjunction with the rest of the geodjango functionality. However you shouldnt have to deal with all the extra complexity of geodjango (which isnt too bad one you get used to it ;). Basically the process involves querying 2 IP's , getting a 'Point' for each and then calculatin

Re: Strange 404s

2010-10-06 Thread Sam Walters
I concurr. I have seen: /phpMyAdmin/scripts/setup.php /phpmyadmin/ /user/soapCaller.bs I guess there are security holes in old versions of phpmyadmin. Some sort of content management with setup.php left unconfigured/unsecured so the bots are just checking out all of those url's. sam_w On Thu, O

Re: Iterating tree-like data structures with django

2010-10-07 Thread Sam Walters
Also for all your tree related needs there is Django Treebeard: https://tabo.pe/projects/django-treebeard/ On Thu, Oct 7, 2010 at 2:51 AM, Cesar Canassa wrote: > I had the same issue a few months ago. > My only answer to you is that is not worth to develop this all for self. > There is a great

Re: Where is everything on ubuntu 10.10

2010-11-19 Thread Sam Walters
Read up on how linux programs work the file system becomes intuitive. Also try this: python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" cheers sam_w On Fri, Nov 19, 2010 at 3:08 AM, Kenneth Gonsalves wrote: > On Thu, 2010-11-18 at 06:10 -0800, sheeptick wrote:

Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-29 Thread Sam Walters
Hi I have reached the optimisation stage of my project. I am trying to work out how to reduce the turnaround time for my queries. I implemented 'db_index=True' for the fields where i determined there should be a performance boost by indexing that particular field. This has not really improved the

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2009-12-30 Thread Sam Walters
Thanks for the replies. Yes, there is the option of going to raw MySQL. However the project requirements mean i can't use raw SQL. (portability, readability) >From what i can see using django's db API i have to execute the queries 500 times. I am very familiar with the query documentation and i kn

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-01-03 Thread Sam Walters
ue hundreds of SQL queries. " Yes this seems to be the best way, do you have any links where i can see how various people have implemented this? Would be good to write a 'pythonic' solution cheers -sam 2010/1/4 Tomasz Zieliński : > On 31 Gru 2009, 01:56, Sam Walters wrote: &

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-01-07 Thread Sam Walters
Thanks Koen I had suspected such things would exist but couldnt find them. I will take a look at this. Looks like a neat addon which would greatly help my project turnaround time. cheers Sam On Wed, Jan 6, 2010 at 11:07 PM, koenb wrote: > > On 31 dec 2009, 01:56, Sam Walters wrote: >

Re: autocomplete widget

2010-01-11 Thread Sam Walters
Hi The widget source code is here, its pretty easy to see wats going on, if im dealing with forms i spend a lot of time in here: http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py And the docs are here: http://docs.djangoproject.com/en/1.1/ref/forms/widgets/#ref-forms-widge

Re: Looking for Lead Django Developer in LA please call 310 571 JOBS

2010-01-24 Thread Sam Walters
Is it just me or is asking for 5+ years for django unlikely. http://en.wikipedia.org/wiki/Django_%28web_framework%29 "released publicly under a BSD license in July 2005" On Mon, Jan 25, 2010 at 2:13 PM, James Matthews wrote: > People should research before posting. But I always enjoy these

Re: AJAX Autocompletion Field

2010-02-13 Thread Sam Walters
There probably isnt a good whole tutorial. Which looks at the operation from client side to server side... You should read about writing your own autocomplete field in JS. And for server side look at writing a view which returns a JSON or list of options which corresponds with the JS / JS framework

Re: Job opportunity - Newcastle, NSW, Australia

2010-02-23 Thread Sam Walters
Hi Peter If you want someone who is very good at python/django you could also try contacting the people here: http://www.newcastlelug.org/wiki/doku.php cheer sam_w On Mon, Feb 22, 2010 at 4:15 PM, Peter wrote: > Hi all > > Please see: > > http://tinyurl.com/djangojob > > for a job being adve

Re: Many to Many...so many queries

2010-03-19 Thread Sam Walters
Yes, this conversation hits the nail on the head. 'select related' only works with forward facing keys. http://code.google.com/p/django-selectreverse/ is a resonably good piece of code to improve performance: using a structure like: class model1(model.Models) 1<* class model2(model.Models

Django + Raw SQL: not returning a M2M key set of related values properly.

2010-03-25 Thread Sam Walters
http://pastebin.com/dFW6MdBm Hi I have a raw MySQL query which im using for performance reasons. It works great except under one condition. When i want to apply a filter based on a directories related table 'tags'. In SQL i use this: `directory_directorytag`.`name` = '%s' now typically i would w

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-03-25 Thread Sam Walters
en you would probably be down to > one main query plus a lot of cache lookups. > > Also you were on the right track when using addresses = > Address.objects.filter(directory__in=directories). I've often used > that kind of queries to reduce (1 + many queries) down to (2 + lots of > dic

Re: can django be used in destop application?

2011-08-23 Thread Sam Walters
Seriously why bother? http://www.wxpython.org/ The whole front end of django is too web-centric. So the only thing that might be of use is if you have an existing web application which heavily uses the django ORM and you want back end consistency with a desktop GUI application that shares thee sa

Re: Django Development environment

2011-08-27 Thread Sam Walters
Ok lets see. At the moment: Editor: vim + http://code.google.com/p/trespams-vim/ sometimes gedit or kate Editor console *this has been really useful: yakuake Debug client-side: firebug, yslow, a windows computer with ie7 Version system: git OS: develop on apto-sid (debian unstable), deploy on

Re: Django Development environment

2011-08-28 Thread Sam Walters
Ok :) Thankyou. Yes ill try something like that when i have the time later this year! On Sun, Aug 28, 2011 at 7:31 PM, Simon Connah wrote: > > On 28 Aug 2011, at 04:41, Sam Walters wrote: > >> Debug client-side: >> firebug, yslow, a windows computer with ie7 > > R

Re: Using gedit for django development

2011-09-15 Thread Sam Walters
Yes. I mostly use vim+yakuake. I really like gedit and have used it for large projects too. Notably: I will try this gedit-django-project pluggin as it never hurts to know your way around multiple IDE's. sam_w -- You received this message because you are subscribed to the Google Groups "Django

Re: Using IGNORABLE_404_URLS

2011-09-28 Thread Sam Walters
I second this. Not something you would implement in django. Would handle that with the web server front end. Eg: i used to get requests to phpmyadmin login url requests (i assume thats because that software is a security issue). So i got nginx to return a minimal 404 message instead of the full 404

Re: Easiest Way to Deploy Django?

2013-02-23 Thread Sam Walters
Hi Helping people get started at work with PostgreSQL ad the most common problem coming from MySQL users is they have trouble connecting to the database: setting up hg_hba.conf and some of the basic operations are different to MySQL which confuses them. I dont think there is an easiest way. Nginx+

Re: django-newsletter, cron job not working

2013-04-17 Thread Sam Walters
Hi In addition to the previous advice i would also check /etc/init.d/cron to see if the daemon is running. make sure you have the correct date+time settings in your shell eg: 'date' command. also run some sort of primitive debug command like: * * * * * touch "/tmp/$(date +\%d-\%m-\%Y-\%T)" for a

Re: Understanding an existing big web application written in Django

2013-06-06 Thread Sam Walters
Hi In addition to what has already been said. Make use of command line search tools. Hoe to search through all the python files using BASH is a good example. eg: In one of my projects i have to find all the places where a particular class is called or instantiated: 'LocationAirfieldLookup' find

What client side html layout tools are people using to speed up template development?

2013-07-29 Thread Sam Walters
Its not specific to django however i have a few small projects on the horizon where i could really save time spent on the things im not good at: Graphic design CSS layouts, choosing fonts, colours that look good. What are the tools people are using for this these days? What are strong points of t

Re: What client side html layout tools are people using to speed up template development?

2013-07-30 Thread Sam Walters
like "20 web designer tools" and you'll get >> one of those blog posts that lists them all. >> >> And if you have time check out this list https://github.com/** >> dypsilon/frontend-dev-**bookmarks<https://github.com/dypsilon/frontend-dev-bookmarks>.

Re: Script to move django 1.4.3 to 1.5.1

2013-09-01 Thread Sam Walters
The worst change i've had to make was a long time ago when we had to send CSRF Token with Ajax calls because of a security exploit. Had to write an entire regular expression and apply it to multiple template files. Took perhaps 40 minutes. However i can see some of the really old django snippets o

Re: How do you organize your deployment enviroment

2011-05-23 Thread Sam Walters
Hi I make a shell script as i performs the steps for the first time. Basically it means learning bash or something similar. Disadvantage is its pretty inflexible however if its exactly the same linux distro every time then its not too bad. cheers sam_w On Mon, May 23, 2011 at 5:24 PM, Malcolm B

Re: What is the Development Life Cycle of Django App?

2011-07-24 Thread Sam Walters
Hi Also you can download a project from one of the many sites that have source code. Look at a git tree and see the commit dates would give an idea of how long it takes to build a project, how many people were involved, how specialized their role was etc. cheers sam_w On Sat, Jul 23, 2011 at 3:1

Re: Most stable Linux distribution for Django - Python development

2011-08-01 Thread Sam Walters
If a modern linux OS is crashing then it will likely /var/log whats going wrong. The phrasing of this issue seems to indicate lack of experience or familiarity with the linux os or unix model of os. Thats no problem if you are keen to learn the principles of the OS you will get better at using the

Re: Constructing / rendering a complex

2011-08-02 Thread Sam Walters
Hi i dont see what is complex about this. On Wed, Aug 3, 2011 at 6:35 AM, Michał Sawicz wrote: > Hi all, > > I'd like to pick your brainz about how would you approach constructing > and rendering a complex table with headers, row/colspanning cells in a > most clean way that rids the view of rende

Re: "Great circle" using the django ORM?

2011-08-12 Thread Sam Walters
Dont know specifically about sql lite. I have used django orm with postgres spatial db to find points within a 'convex hull' bounding box shape: from django.contrib.gis.geos import GEOSGeometry, Polygon, LineString, Point, LinearRing from django.contrib.gis.measure import D coords_in = simplejs

Re: Multi widget?

2011-01-03 Thread Sam Walters
Hi, I think you are looking to override the widget render() method to build multiple HTML form elements? Here is a good example: http://k0001.wordpress.com/2007/11/15/dual-password-field-with-django/ I have built heaps of these things, usually a choicefield + charfield, charfield + charfield, ch

Re: Japanese Text Sort Order

2011-01-05 Thread Sam Walters
Hi, Personally I would map the priority of every character in a dict and pass this to sorted: dd = { "cha1": 1, "char2": 2, "char3": 3, "char4": 4, } result = sorted(mylist, key=lambda x:dd[x[0]]) Point being if the db query isnt too slow you could use python. cheers sam_w

Re: Django's documention is horrible

2011-01-10 Thread Sam Walters
Hi, My approach with regard to: > frameworks I'm used to have at least a well structed API documention listing > all methods and members of classes with some comment attached to them. They > also show the class heirachy, quick and simple. I just look at the source itself for this. cheers sam_w

Re: Current Django 1.3 Alpha 2 Documentation as PDF

2011-01-17 Thread Sam Walters
at the very least use mysqldump on you db or a table before you play with the code. though depending on what you are doing backup should be even more structured than ad-hoc sql dumps. http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/ On Mon, Jan 17, 2011 at 10

Re: Google maps

2011-01-29 Thread Sam Walters
Hi This also depends how server-side oriented you want this to be? Its good to learn geodjango. (that way if your calculation areas of polygons, loading layers you can just make this python+server side instead of writing it in javascript. Also with lots of ajax related request/response designs so

Re: ANN: Django 1.3 released

2011-03-23 Thread Sam Walters
Hi fellow Django users. Its great news that 1.3 is out. I have been using the development branch on one machine for a month or so before this release so fiddling with some of the new features. Very happy about the class based views. Static file handling is so-so, *never really had issues with the

Re: validate user input on templates

2011-03-27 Thread Sam Walters
hey use: str.isdigit() http://www.tutorialspoint.com/python/string_isdigit.htm what is idDigit() ? is that a call to a method somewhere else. and arent you trying to validate numberofapples = request.POST['numberofapples'] not playerid? Personally if this is form data you are trying to validate

Re: how to create message box in Django?

2011-03-29 Thread Sam Walters
Yes, this is really a client-side related issue. To try and answer your question what would be involved on the django side of things: Basically you want django to deal with any submission from one of these fields as either a from or modelform so you can run clean() and validate the input. Beyond

Re: develop to product

2011-03-29 Thread Sam Walters
Hi Yongzhen, Looks like you're trying to run two mis-configured web servers. if you're on linux stop the nginx process eg: /etc/init.d/nginx stop The stuff you've submitted is for apache: Send us the contents of the apache log file showing the error. Perhaps *if the error is long* use http://pas

Re: Need help: request.POST.copy() ?

2011-03-31 Thread Sam Walters
Hi hank23 request.POST would be immutable. "QueryDict instances are immutable, unless you create a copy() of them. That means you can't change attributes of request.POST and request.GET directly." http://docs.djangoproject.com/en/dev/ref/request-response/ So I'm > wondering if there is somethin

Re: Need help: request.POST.copy() ?

2011-03-31 Thread Sam Walters
py of >> request.POST (request.POST.copy()) like this: >> >> request.POST['title'] = record.title >> >> I actually call sub views from the main view which processes this >> screen, display the data as shown above as well as capture the changes >> to the

Re: noobie cannot get mod_wsgi to import settings

2011-04-03 Thread Sam Walters
Hi I dont usually deal with Apache+WSGI (usually fcgi + nginx) However your script: WSGIScriptAlias /wsgi /var/www/wsgi-scripts One of my apache sites: WSGIScriptAlias / /home/hvv00/hvv/wsgi/hvv.wsgi Point directly this directly to the file. Note: You wont need to chmod 777 anything S

Re: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-04-03 Thread Sam Walters
I dont understand so you render a view with a form once and you get form errors on the initial view? Or Is there a POST/GET with formdata being submitted generating this issue? *which would be by design as fas as i can tell you want form verification to work Note: http://docs.djangoproject.com/e

Re: Do you combine you Django decorators?

2011-04-04 Thread Sam Walters
Hi Andy I dont combine them... however: I was using a couple of decorators for almost every view in one project. Ended up putting them in middleware. Are these decorators for every view? Maybe you should consider middleware too. cheers sam_w On Mon, Apr 4, 2011 at 3:26 AM, andy wrote: > Do you

Re: Static/media url in template

2011-04-04 Thread Sam Walters
Yes it already exists {{MEDIA_URL}} Thats what the settings.py file does... There is a bunch of stuff you can read about in the docs: http://docs.djangoproject.com/en/1.3/howto/static-files/ Also for some of my own deployments there are a bunch of static file servers so i just put these into se

Re: Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Sam Walters
Hey Block tags dont work like that. {%if choice1 == 2 %} {% include "sometemplate.html" %} {%endif%} instead of: {%if choice1 == 2 %} {%block two%} > The temperature in {{city}} is {{temperature}}° > > {%endblock two%} {% endif %} I hope that was what you were thinking... http://docs.d

Re: Dajaxice and CSRF issues

2011-04-08 Thread Sam Walters
Hi Vincent Yes. Look at the HTTP Headers. Just in case you need to read the docs on 1.2.5 which identified the CSRF AJAX issue. http://www.djangoproject.com/weblog/2011/feb/08/security/ Also looking at the request in firebug you can see the 'X-CSRFToken' needs to be added as an attribute with t

Re: Is it possible to output a graph from Matplotlib into Django like this?

2011-04-11 Thread Sam Walters
Use python imaging: http://www.pythonware.com/products/pil/ You can return a response with an image of the graph. response = HttpResponse(status=200, mimetype="image/gif") background.save(response, "GIF") return response There is no 'best practice for this' Some people i know use flash. However

Re: Is it possible to output a graph from Matplotlib into Django like this?

2011-04-11 Thread Sam Walters
PM, nai wrote: > You have to bear with me but where does background come from? So I can > use the save() method from the PIL library is that right? > > And I can do something like this: > > return render_to_response('template.html', {'graph':response}) >

Re: Is it possible to output a graph from Matplotlib into Django like this?

2011-04-11 Thread Sam Walters
I mis-read this... basically you have one view and in the template you are rendering you put HTML: so that path will call your other views which return content as content_type='image/png' or whatever specific format you're using. what i was suggesting is you could have: So in your urls.p

Re: syncdb just hangs/tutorial

2011-04-11 Thread Sam Walters
Postgres uses a unix style user model. Its intuitive once you understand it: I would seriously advise you to read the tutorial for this: http://www.postgresql.org/docs/manuals/ FInd out the version you are using too. Specifically: 1.2. Architectural Fundamentals onwards. That error just means

Re: how to Generate a 5 character unique alpha-numeric string

2011-04-11 Thread Sam Walters
Hi If this is a sequence then why not use python list comprehensions, nest them together and concatenate the different parts into a string. http://docs.python.org/tutorial/datastructures.html#nested-list-comprehensions you could even do it with recursive method calls. Point is. If its not 'random+

Re: How to make a dynamic list in Django

2014-01-10 Thread Sam Walters
Hello With this sort of problem it depends on the dimensions of your data. What kind of data is associated with a user? Is this just editing a user profile like the built in django 'user' or is there a lot more? My approach to this sort of stuff is a straightfoward initial HTTP response with your

Re: IntegrityError --- NOT NULL constraint failed: books_book.publication_date

2014-03-26 Thread Sam Walters
Did you perhaps change the schema of the database after you had created it. Eg: added null=True as a constraint after creating the table? If so check the db sheme using: python manage.py sqlall It sounds simple enough. You will have to go into the db shell and update your schema manually. usin

Re: Decrease amount of identical "Email reports"

2017-01-09 Thread Sam Walters
Hi Presumably you have had a look at logging docs and its not good enough? https://docs.djangoproject.com/en/1.10/topics/logging/ With these sort of project requirements the way i have solved this in the past is to: *Work out who needs to receive certain messages. Draw a grid with all useful messa