Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/14/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/13/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Now we want to use the same model to create a contact tree for a given > > user: we determine who this user can view, e.g. personal phone > > numbers

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > As for my initial question I apologize for the confusion, I didn't > > mean to use the generic views as described in the Django tutorials. I > &g

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Wow! I didn't know it would be that simple! > > > > What about convenience functions, get_relatedobjectname()? > > Can 'relatedobject

Re: Contacts application

2006-08-08 Thread Sam Tran
e able to view somebody's personal phone numbers based on these pre-defined relationships. The application performs the lookups in LDAP. Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Inline editing for aggregation relationships

2005-08-21 Thread Sam Newman
;t, if there is anything in Django which would stop this being added in the future? -- sam http://www.magpiebrain.com/

Re: Global models

2005-08-21 Thread Sam Newman
e in the skills section, or in the tools section. A global tag search doesn't make sense, but at the same time it does make sense to have one Linux tag rather than 3 (as I suspect for some areas I would want to cross search - for example showing news tagged with Linux when browsing for Linux too

Re: CSS and PNG files in templates

2005-08-23 Thread Sam Newman
simply put, the Django web server doesn't serve your media (e.g. images, PNG, CSS) and there isn't a plan to (the related ticket is marked as WONTFIX). Which majorly blows IMHO. -- sam http://www.magpiebrain.com/

Re: CSS and PNG files in templates

2005-08-23 Thread Sam Newman
hat from the name, they're going to make bigger mistakes than using Django to serve media files in a production environment. -- sam http://www.magpiebrain.com/

Re: CSS and PNG files in templates

2005-08-30 Thread Sam Newman
On 8/23/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 8/23/05, Sam Newman <[EMAIL PROTECTED]> wrote: > > Or more simply put, the Django web server doesn't serve your media > > (e.g. images, PNG, CSS) and there isn't a plan to (the related ticket

Reminder - Django and Rails meetup in London, September 5th

2005-08-31 Thread Sam Newman
Hi all, Just a quick reminder, but on the 5th of september we're having a Rails & Django meetup in London - the more the merrier! More details: http://www.magpiebrain.com/archives/2005/08/17/meetup -- sam http://www.magpiebrain.com/

'Automatic tabulation' in table

2006-04-24 Thread Sam Tran
| I haven't been able to accomplish this using the template system and the context rendering. I could get to something close using the built-in tag 'widthratio' and a spacer GIF. But I don't think it is an elegant solution. Has someone done so

Re: 'Automatic tabulation' in table

2006-04-24 Thread Sam Tran
On 4/24/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Hi Sam, > > On Mon, 2006-04-24 at 15:52 -0400, Sam Tran wrote: > > Hi All, > > > > I have the following list of tuples: > > [(0, 'Jenna'), > > (1, 'Tom'), > >

Re: 'Automatic tabulation' in table

2006-04-26 Thread Sam Tran
nted with the method Malcom suggested. But I think it is more appropriate to use a template tag or a template filter as you pointed out. I prefer not to do any template processing in the views. So I am now using a template filter and it works perfectly.

Django admin css not fully working in MS IE6 ...

2006-04-27 Thread Sam Tran
Hi All, I have been working with the Django admin using Firefox. Today I tried MS IE 6 and it looks like the css file used is not fully compatible with IE. For instance, the blue submit buttons are grey in IE. Is there a way to fix that? Thanks. Sam

Re: Django admin css not fully working in MS IE6 ...

2006-04-27 Thread Sam Tran
On 4/27/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 4/27/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > I have been working with the Django admin using Firefox. > > Today I tried MS IE 6 and it looks like the css file used is not fully > > compatible

Re: Django admin css not fully working in MS IE6 ...

2006-04-27 Thread Sam Tran
On 4/27/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 13:06 -0400, Sam Tran wrote: > > On 4/27/06, James Bennett <[EMAIL PROTECTED]> wrote: > > > > > > On 4/27/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > >

Send POST data for unchecked checkboxes

2006-05-01 Thread Sam Tran
Hi All, I am having the problem described in ticket 1045: http://code.djangoproject.com/ticket/1045 Was this problem fixed in Django 0.91? Thanks in advance. Regards, Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Send POST data for unchecked checkboxes

2006-05-01 Thread Sam Tran
On 5/1/06, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Monday 01 May 2006 20:03, Sam Tran wrote: > > > I am having the problem described in ticket 1045: > > http://code.djangoproject.com/ticket/1045 > > > > Was this problem fixed in Django 0.91? > > I

Re: Is there a function that returns common elements in multiple lists

2022-01-25 Thread Sam Chaffy
You can use sets On Tue, Jan 25, 2022 at 7:47 AM bnmng wrote: > Hello, > > Is there a built in function that compares two or more lists and returns > elements common to all? > > like this: > > def in_both( list_a, list_b ): > list_c=[] > for value in list_a: > if value in list_b: > list_c.append

Re: Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread Sam Chaffy
Yes you can What’s your model look like ? On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com < narendrathapa...@gmail.com> wrote: > hello folks, > any django ex[ert here, I want to know if anybody can do multiple join > more than 5 tables at once using ORM > Prefetch,prefetch_related,select_

as_* helpers (e.g. as_p as_div) for display (read "not in a form")

2022-12-14 Thread Sam Brown
ate. Does anyone know of a non-form helper like as_p? Same question posted on stackoverflow here <https://stackoverflow.com/questions/74790679/django-as-p-method-equivalent-for-non-form-display-only-use-cases> Thanks, Sam Brown -- You received this message because you are subscribed to t

i want to use .db file in django application

2023-01-03 Thread Sam Stephen
How can i connect employee.db file to django? can any1 please help or share any tutorial -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-30 Thread Sam Lai
On 29 January 2012 16:49, JJ Zolper wrote: > Sam, > > I have set up VirtualBox with Python and Django. Things have gone > flawlessly. > > Only thing I've noticed is it seems to be running a tad bit slow. I feel > this way because I had a native installation before and it

Re: field of tuples

2012-02-07 Thread Sam Basl
Wouldn't it be better to do this sort of thing with a related model? On Feb 7, 2012 4:44 AM, "Jaroslav Dobrek" wrote: > Hello, > > how can I create a field that contains tuples of entities? An example: > A model "Candidate" (someone who applies for a job) might have a field > "languages" which is

Re: Haystack Solr Error

2012-03-06 Thread Sam Lai
On 5 March 2012 07:49, coded kid wrote: > I'm trying to rebuild_index, so after inputting manage.py rebuild- > index , I'm getting: > > Removing all documents in your index because you said so. > fail to clear Solr index: [Errno 10061] No connection could be made > because the target > machine act

Re: Running manage.py commands in Windows Power Shell

2012-03-15 Thread Sam Lai
On 15 March 2012 04:35, orschiro wrote: > Hello, > > I have a question which is based on the discussion here: > > http://groups.google.com/group/django-users/browse_thread/thread/2333f5dc8d0674f0 > > I'm working on Windows 7 with the PowerShell. Python 2.7 and the path > to django-admin.py is stor

Re: Accessing objects from a dictionary in templates

2012-03-24 Thread Sam Lai
On 24 March 2012 09:29, gowtham wrote: > Template tag filters like this (made one for each field in the library > object) helps me to get what i wanted But, that seems too silly to do... > > in template > {{ reslibdic|hash2libcode:res.result_id }} > I had the same thought as Reinout did, but

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{% endblock %} > {% bloc

Re: Template Error: Invalid block tag: 'endblock', expected 'empty' or 'endfor'

2012-03-26 Thread Sam Lai
On 25 March 2012 11:56, Homer wrote: > I tried to create an index webpage but Django told me I had a template > error: > > Invalid block tag: 'endblock', expected 'empty' or 'endfor' > > Here is the code of index.html: > > {% extends "base.html" %} > > {% block title %}Home{% endblock %} > {% bloc

startproject/startapp template context

2012-05-01 Thread Sam Simmons
I was pretty excited to see the template option for startapp/startproject. Especially when I read your context can be any option passed to the command and it clicked that the files are rendered using django'

Re: startproject/startapp template context

2012-05-01 Thread Sam Simmons
er: django-admin.py startproject --template=/path/to/boilerplate --template-context=options.conf myproject opions.conf: [options] compass coffee js_dir=javascripts css_dir=sass Only issue is ConfigParser expects a section header which isn't necessary here... On Monday, April 30, 2012 10:39

Re: startproject/startapp template context

2012-05-01 Thread Sam Simmons
This has turned into a topic for django developers. On Tuesday, May 1, 2012 7:18:34 AM UTC-5, Sam Simmons wrote: > > Checked the src and it's the case that the 'any options' means the ones > available to the command. I could see an additional context option being >

Re: Beginner problem linking pages from homepage?

2012-09-22 Thread Sam Lai
On 23 September 2012 06:40, Vincent Fulco wrote: > Missing something basic here even after scouring web and running thru online > tut a few times. > > Started a project 'mysite' and added twitter bootstrap then created a static > homepage "index.html' to act as a simple launchpad to other more inf

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Sam Lai
On 20 October 2012 14:16, Barry Morrison wrote: > I've got a pretty expensive query...Wondering if I can't speed things up in > regards to Postgresql. > > Here is the model: [1] http://dpaste.org/JmEeQ/ > > Here is the sql statement: [2] http://dpaste.org/GbfAJ/ > > Here is the template: [3] http:

on-site deployment

2011-08-22 Thread Sam Bull
ns. I'd be happy to share the solutions we came up with. Sam PS- Is on-site deployment even the right name for this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com.

Re: on-site deployment

2011-08-22 Thread Sam Bull
> On Mon, Aug 22, 2011 at 7:09 PM, Sam Bull wrote: > - What will we ultimately be delivering to our clients (a tarball of the > code, a physical server, a VM image, a WAR file, etc.)? We're providing an ubuntu 10.04 VM image. > - Who is responsible for the upkeep of the server

Re: on-site deployment

2011-08-22 Thread Sam Bull
dating solution. We don't plan to offer that, at least not any time soon. Our plan is to require a sysadmin to deploy the update, but the deployment workflow will be as close to "turnkey" as we can get. For our initial release the deployment interface will be via the shell, but i

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: does php code works in Django

2011-10-20 Thread Sam Lai
On 20 October 2011 20:15, Chen Xu wrote: > Hi, everyone: > I am new to Django, does anyone know whether php code works in Django? This list's archives will have the answer to your question, and many variations of it. http://groups.google.com/group/django-users The short answer is no; PHP and Py

DoS susceptability via email logging

2011-12-08 Thread Sam Berry
anything I can do to throttle or limit the email sending without writing my own logging handler? Any thoughts would be much appreciated. Many thanks, Sam Berry -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-23 Thread Sam Lai
On 23 January 2012 15:22, JJ Zolper wrote: > Hello everyone, > > I was able to install Django to my machine and before I was using the > command prompt. Django's path is in my Windows 7 64 bit Enterprise > Environment variable. Python worked fine as well too. I also installed > IPython because I h

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-24 Thread Sam Lai
On 24 January 2012 07:58, JJ Zolper wrote: > Yes I knew I was in the Python shell I just never saw anything that > described you couldn't make Django commands within the Python interpreter. I > mean it is based on Python isn't it? That's where I thought logically you > could make Django calls from

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
it the file for execution. You may even be > prompted to supply command line arguments (PythonWin, I know does this). > > This is very interesting thanks for sharing! As for the information above > that has cleared it up quite a bit for me. > > Sam Lai has helped a lot I think I am

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
On 26 January 2012 12:05, JJ Zolper wrote: >>  Unless you have a >>  preference for Windows though, I wouldn't use it as a Django app web >>  server in production; there's far less support on the net to help you >>  out when things go wrong. > > Let me see if this what you mean... so when I want t

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-25 Thread Sam Lai
ter documented on Linux. If it makes things easier, just do everything on Linux. > I have installed ActiveState and will give it a try. I have my VS up and > running with Python Tools for VS so that should be okay. > > Hey Sam you've been a great help. Would you by chance mind

djangosnippets.org domain has expired

2012-01-28 Thread Sam Lai
Heads-up to whoever is in charge of this domain - it has expired and is now redirecting to a GoDaddy domain parking page. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsu

Re: Help with manage.py sql

2012-12-03 Thread Sam Solomon
I'm guessing that for some reason the classes in your app/models.py are not set up correctly, are you sure you inherit from models.Model in your class(es). Example: from django.db import models class MyModel(models.Model): rather instead of : class MyModel(): If it doesn't inherit models.Mod

Re: Django-MongoDb deployment at production servert

2012-12-11 Thread Sam Solomon
I'm guessing that the problem is there are many ways to deploy Django so it's hard for anyone to give a good one-size-fits-all answer and also hard to run down the complete list of possibilities, and I'm guessing that since this list is only viewed by a small percentage of Django users, that the

loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
l over the internet and posted a question at Stackoverflow and still can't figure it out. I really need some help. Thanks, -sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.g

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-29 Thread Sam Raker
really appreciate any help on this. On Saturday, December 29, 2012 3:28:34 PM UTC-5, Ryan Blunden wrote: > > Can you provide a single example of one of the fixture objects you're > trying to import, as well as the model it corresponds to? > > On 29/12/2012, at 11:34 AM, Sam Rak

Re: virtualenv setup

2012-12-29 Thread Sam Lai
It looks like you haven't installed Django in your virtualenv. In your virtualenv directory, look in lib/python2.x/site-packages and see if there is a Django directory in there. You can also try sourcing your venv, then running Python, and entering in the following statement to see if Python can f

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
s related to the length of the files or something in simplejson, as even a dozen-line yaml file gives me the same exception when I try to load it with loaddata. Any more ideas? On Sun, Dec 30, 2012 at 12:18 PM, Amirouche wrote: > > > On Saturday, December 29, 2012 9:42:50 PM UTC+1, Sam

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
arb wrote: > On Sunday, December 30, 2012 9:54:45 AM UTC-8, Sam Raker wrote: >> >> Thanks for your suggestions. >> >> I eliminated the underscores and got rid of the __unicode__ methods >> entirely, cleaned up my except statement, and changed the order of stuff >

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I just tried both of those things, and the YAML data loaded fine, and validate said I had 0 errors. Any other suggestions? I'm really stumped here. On Sun, Dec 30, 2012 at 3:35 PM, donarb wrote: > > > On Sunday, December 30, 2012 11:58:46 AM UTC-8, Sam Raker wrote: >&g

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I tried changing my backend to django-mysql-pymysql (http://pypi.python.org/pypi/django-mysql-pymysql/0.1), and that didn't work either. I'm really at my wits' end. Can anyone help? On Sunday, December 30, 2012 4:21:57 PM UTC-5, Sam Raker wrote: > > I just tried both of

Re: loaddata deserializationerror: maximum recursion depth exceeded while calling a Python object

2012-12-30 Thread Sam Raker
I've also tried changing the charset and collation options in my MySQL tables. Still no good. I'm so stumped. Can anyone help me, please? On Sunday, December 30, 2012 8:54:44 PM UTC-5, Sam Raker wrote: > > I tried changing my backend to django-mysql-pymysql ( > http://pypi.pyt

django-users@googlegroups.com

2013-01-01 Thread Sam Raker
and restaurants is case-insensitive. Searching by course uses case-insensitive exact matching. Valid courses are Appetizer, Main, and Dessert. Years should be entered . Five-year periods span either the first or second half of a decade, and should be entered -. Example valid five-ye

Reserved Words

2013-01-03 Thread Sam Raker
Is there a list of 'reserved words' for Django like there is for Python? I posted a question in here a few days ago about a mysterious recursion error I kept getting when I tried to load my data in with loaddata. Turns out, it was because I had defined a field called 'pk' with primary_key=True i

Re: What's your opinion about nested apps?

2013-01-12 Thread Sam Solomon
We've not had any trouble and we have a very nested structure: project/main_app/sub_apps/ project has manage.py, main_app has main urls.py, etc. sub_apps have models/views/urls, etc. We also have: project/main_app/utils/other_apps/ with no issues (and utils and other_apps both have models, ev

Re: What's your opinion about nested apps?

2013-01-12 Thread Sam Solomon
I agree, the simple approach may be good for some things, but we have a highly complex tightly coupled main app that for us, we believe it's easiest to keep bundled together. If we add/write new, more generic apps to our site, we would obviously consider adding it as an app in the "project/" folder

Re: Insane sql logging

2013-01-15 Thread Sam Solomon
The word "Insane" caught my eye and lo and behold it was relevant to what we've done. We actually do this for security reasons and it does help with debugging sometimes (we actually log all queries, not just INSERT/UPDATE/DELETE). We also store fk to user (with a pre_delete hook to unattach use

Re: Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-07 Thread Sam Solomon
Can't spot any issues but here is what we have to run multiple staging versions of our site: group_* names are more descriptive in the actual settings WSGIDaemonProcess group_1 processes=1 threads=100 display-name=%{GROUP} inactivity-timeout=30 #defining it out here allows you to use the same

Re: Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-07 Thread Sam Solomon
Regarding having WSGIDaemonProcess outside of vhosts, as explained in the comment I added, it allows you to use the same process to handle requests from multiple vhosts. As for the rest, I honestly don't remember why or where they came from, I just know that this is probably not all that common (m

Re: Django and mod_wsgi serving different apps from separate virtual hosts on the same server

2013-02-07 Thread Sam Solomon
Glad you figured it out! On Thu, Feb 7, 2013 at 2:55 PM, robertlnewman wrote: > Just thought I would wrap this up. Turns out the problem was that my > sysadmin did not have the port I wanted (8788) open to traffic. My syntax > was correct. The problem was a network one. > > Sa

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: StreamingHttpResponse into a Template

2013-02-28 Thread Sam Solomon
Not sure if this is what you meant by "we'll probably keep the javascript reloading to process junks, waiting for the support of celery", but one option without celery is to have the initial request save a bunch of "PendingEmail" objects in the database and then redirect you to a "send_queued_e

Re: Extending the base file depending on User type

2013-03-06 Thread Sam Solomon
Tom Evans has probably the correct answer for you, but another thing that I've done (maybe not 100% applicable in this case) is to have a default base and then make it extendable from views when necessary: {% extends base_template|default:"base.html" %} This sounds like it isn't applicable in y

Re: I screwed up my django site using touch

2013-03-08 Thread Sam Solomon
Here is something that may help: import importlib from django.conf import settings for app in settings.INSTALLED_APPS: views_name = "%s.views" % app try: importlib.import_module(views_name) except ImportError: pass except: print "Could not import %s" % vie

Re: Creating a admin-field, containing checkboxes. The data of this fields is stored in the string format

2013-04-08 Thread Sam Solomon
Not sure exactly what the issue is, but this may be handy (either as a replacement or as an example of doing something somewhat similar): https://github.com/disqus/django-bitfield I believe on most machines the maximum is 63 "flags" though so you will likely only be able to use it as an example

Re: [SPAM] Implementing User login expiration

2013-04-09 Thread Sam Solomon
Depending on if the expiration is a temporary thing or if you actually want to permanently deactivate the user, this may be even simpler and database efficient (and is what we use to ban users): class DeactivateUserMiddleware(object): def process_request(self, request): if request.us

Re: should we develop apps based on urls?

2013-04-12 Thread Sam Solomon
t: - Could someone be looking at a page that has a link while you are deploying the code and then the link will take them to a 404? - Is it in a search engine somewhere that will then be used by a user to try to reach your site? Sam On Wednesday, April 10, 2013 11:41:28 PM UTC-7, Muli

Re: How do I display image in admin list?

2013-04-15 Thread Sam Solomon
One small correction, in 'list_display' it should be 'admin_photo' (or I'd probably put 'display_photo' (see #1 below)), not 'photo'. Some other tricks: 1) If you don't want to clog up your Model class, you can put the function in your ModelAdmin class. 2) If you add "readonly_fields = ('displa

Re: How do I display image in admin list?

2013-04-15 Thread Sam Solomon
Oh and I just noticed you added "Also, some images could be blank/None" Instead of 'if obj.id:' you can simply do 'if obj.id and obj.photo:' On Monday, April 15, 2013 10:52:11 AM UTC-7, Sam Solomon wrote: > > One small correction, in 'list_display'

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: Installing django-allauth

2013-05-02 Thread Sam Solomon
Hello, What version of allauth are you trying to install and where did you get it from? https://github.com/pennersr/django-allauth/tree/0.10.0/allauth/socialaccount/migrations is the most recent version on pypi and has more than 2 migrations. Could it be that you have another app installed th

Re: unique not working as expected

2013-05-10 Thread Sam Solomon
My guess is that unique=True was added after the table was created using syncdb. I'm guessing that most companies that use Django professionally use South ( http://south.aeracode.org/) to make schema changes easier. Without South, you would have to keep the database in sync with the code manual

Re: [Bulk] Re: Template Inheritance doubt

2013-05-20 Thread Sam Solomon
If you are mainly using this for splitting stuff into multiple files, here is what we do to accomplish the same thing but keep it so that templates always inherit base.html instead of sidebar.html: base.html: {% extends 'header.html' %} {% block main %} {% endblock main %} header.html: {%

Re: current transaction is aborted, commands ignored until end of transaction block

2013-05-30 Thread Sam Solomon
Hmm, yeah, Ryan could be onto something, but that doesn't really help figure out the root cause (which likely was an error that existing before upgrading but just went ignored). What should help get to the root issue is checking out the postgresql log file (for me: /var/log/postgresql/postgresq

Re: Django Development Server Root URL...

2013-06-04 Thread Sam Solomon
Daniel is correct. One more point though, there are cases where you may want to use the full url instead of just "/django_project/", in which case, you should use settings.BASE_URL or {{ request.get_host }}. To use either of those in the template, the template would need to be rendered with a R

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: Bootstrap - django-bootstrap3 or django-crispy-forms

2013-09-26 Thread Sam Lai
Yep. django-bootstrap-* and django-crispy-forms only provide helpers for outputting HTML with bootstrap CSS classes. Neither are really necessary to use Bootstrap (just makes it slightly easier), which is applied through HTML and CSS and Django doesn't place any restrictions on how your HTML/CSS i

Tests not loading initial_data fixtures

2013-10-02 Thread Sam Lai
the docs that mentions this either. Thanks, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To p

Re: Tests not loading initial_data fixtures

2013-10-03 Thread Sam Lai
Ah, turns out all you have to do is specify - fixtures = [ 'initial_data' ] ... in the TestCase and it'll load all the initial_data fixtures from all apps. Still a bit odd that loading initial_data fixtures isn't the default in tests though. On 3 October 2013 16:49, S

Re: Getting GIS Working - possible kernel32 problem

2013-10-25 Thread Sam Lai
Can you try running 'python.exe manage.py runserver' outside of PyCharm, i.e. in the Command Prompt/PowerShell? I've got a similar setup, although on Windows 7, and it works. Instead of setting environment variables, I added the following parameters into my settings.py to indicate the location of

Re: haystack

2011-05-12 Thread Sam Lai
On 12 May 2011 17:31, pankaj sharma wrote: > > can u tell me which one is better in sphinx and haystack Haystack provides only the glue between Django and a search engine/indexer. With Haystack, you still need to pick a search engine to use, e.g. Solr, Whoosh, Xapian. It doesn't support Sphinx ye

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: uber weird access problem from windows

2011-05-23 Thread Sam Lai
On 23 May 2011 11:15, Kenneth Gonsalves wrote: > On Sat, 2011-05-21 at 08:04 -0400, AJ wrote: >> Just out of curiosity, is it firefox 4? Is it seen with some of the >> other >> web forms too? > > just one form - I do not have access to that machine right now, but I do > not think it is ff4. Will c

is there any reason our sqlite3 DB on disk wouldn't reflect the changes made after we get a signal?

2011-06-16 Thread Sam Roberts
till has the deleted rows. Thanks, Sam -- You received this message because you are subscribed to the Google 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...@googlegroup

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: template newlines

2011-08-14 Thread Sam Lai
On 14 August 2011 14:00, Python_Junkie wrote: > I think that if you performed the logic to determine if there actually > is something in the interest for that row in the view and > then only pass those components from the view, and not in the template > then your problem goes away. > I don't thin

<    1   2   3   4   5   6   >