Re: django templates and tex/latex

2013-03-13 Thread Drew Ferguson
On Wed, 13 Mar 2013 07:01:45 -0700 (PDT) Ken wrote: > I would like to write a tex/latex file with django tags in it. Load it > with the template loader and render it with a context. The problem is > that my tex/latex file has quite a few '{%' in them. They are > conventional in TeX for writi

Re: How do I have company display in admin drop down box?

2013-04-07 Thread Drew Ferguson
On Sun, 7 Apr 2013 17:01:52 -0700 (PDT) frocco wrote: > I have a model that references User and on the admin page, it shows the > user name. > I have the User tied to a UserProfile model that has a field called > company. > > I want the drop down on my Pricing Model to show company, not user. >

Re: How do I have company display in admin drop down box?

2013-04-07 Thread Drew Ferguson
On Sun, 7 Apr 2013 18:15:32 -0700 (PDT) frocco wrote: > Thanks Drew, > > I am trying your second suggestion. > > But it is complaining not found for UserProfile > > On Sunday, April 7, 2013 8:41:46 PM UTC-4, Drew Ferguson wrote: > > > > On Sun, 7 Apr 2013

Serving files in production

2013-04-11 Thread Drew Ferguson
Hi The docs recommend serving static data from a second web server rather than the one serving via WSGI How do folks implement this? I can't figure how to serve data for the same domain using 2 web servers. Am I missing something? -- Drew signature.asc Description: PGP signature

Re: Serving files in production

2013-04-11 Thread Drew Ferguson
e gets very complicated when trying to develop the same site on a development system. Is the recommendation really addressing a performance issue for high traffic sites where Apache WSGI gets overloaded and becomes a bottleneck? > > > On Thu, Apr 11, 2013 at 2:01 PM, Drew Ferguson >

Re: Serving files in production

2013-04-11 Thread Drew Ferguson
PM, Drew Ferguson > wrote: > > On Thu, 11 Apr 2013 14:54:50 +0300 > > Avraham Serour wrote: > > > >> you can create a subdomain (static.yourdomain.com) and serve static > >> using that, configure the second webserver to serve this subdomain > > > &g

Re: Testing with complex database setups

2013-05-23 Thread Drew Ferguson
> > So how I should proceed with unit testing with database like that, since > some operations rely heavily that there really exists all that > trigger-function mess in the database? So that I don't need everytime to > start from the scratch but from some known state of the db? >

Re: view data tables?

2013-05-25 Thread Drew Ferguson
ooking for? http://stackoverflow.com/questions/835069/which-sqlite-administration-console-do-you-recommend On my Linux system, sqliteman gets the billing "The best developer's and/or admin's GUI tool for Sqlite3 in the world" someone thinks it is good. I wouldn't know -- Drew Fergu

Re: view data tables?

2013-05-25 Thread Drew Ferguson
t; > > On Sun, May 26, 2013 at 5:51 AM, Drew Ferguson > wrote: > > > On Sun, 26 May 2013 05:23:08 +0530 > > Kakar Arunachal Service wrote: > > > > > Hi, how to view the tables in pg admin for postgresql database, or in > > > workbench for m

Re: listing objects in a html file

2013-05-28 Thread Drew Ferguson
> {% for premises in object_list %} > {% if premises.in_use %} > {{ premises.name }} Update >   > {% else unusedpremises.add(premises) %} > {% endif %} > {% endfor %} > > Unused Premises > > {% for premises in unusedpremises %} > {{ premises.name }} Update

Re: ROOT_URLCONF = 'mysite.urls' : SyntaxError: invalid syntax

2013-06-02 Thread Drew Ferguson
syntax error probably very close to line 104 Possibly the closing bracket ")" of the previous tuple has been removed accidentally or something similar -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubsc

Re: Complex(for me) queryset comparisons

2013-06-12 Thread Drew Ferguson
s were created where the cable_sets are > all the same and their parent Bundle's length is the same. I figured I > should attempt the simpler query first without the length, and add > length later by iterating through the repeated_sets dictionary and > querying for each cable_set'

Re: Project settings and application settings.

2013-06-21 Thread Drew Ferguson
x27;my.backends.LDAPUserMiddleware', ) + > >> settings.MIDDLEWARE_CLASSES[index+1:]) > >> > >> EXTERNAL_AUTH is used at different locations in my application, for > >> example I use it to decide whether or not > >> I display the "change passwor

Re: Getting URL root

2013-07-02 Thread Drew Ferguson
when the domain can be retained; this could be achieved through some configuration page that saves the url in the database which your script can then reference or you provide the script with the url from a configuration file or something similar But there is nothing in django that can be queried

Re: Django date format issue

2013-07-05 Thread Drew Ferguson
> > context_instance=RequestContext(request)) > > > > forms.py > > > > DATE_FORMAT = ( > > ('0', ' dd / mm / yyyy'), > > ('1', 'mm / dd / '),) > > DATE_INPUT_

Re: Unable to do import django

2013-07-08 Thread Drew Ferguson
on shell > > (python 2.7.5, to be exact) and did import django, this is what I got: > > > > >>> import django > > Traceback (most recent call last): > > File "", line 1, in > > ImportError: No module named django > > > > sudo py

Re: Unable to do import django

2013-07-08 Thread Drew Ferguson
On Mon, 8 Jul 2013 14:46:25 -0700 (PDT) "Yves S. Garret" wrote: > On Monday, July 8, 2013 5:18:21 PM UTC-4, Drew Ferguson wrote: > > > > Yo > > > > You have 2 versions of python installed: > > > > * python 2.6 installed probably in /usr/bin a

Where is CBV & Formset docs

2013-08-02 Thread Drew Ferguson
Hi I am having trouble locating documentation illustrating use of formsets with CBVs. Can someone point me at a page please? Issue #17700 in the tracker has been closed suggesting there is something somewhere -- Drew Ferguson -- You received this message because you are subscribed to the

Re: Where is CBV & Formset docs

2013-08-02 Thread Drew Ferguson
options. > > Django core doesn't deal with teh cbv/formset problem very well (yet) > - there are ways they can be mangled, but it's code heavy. > django-extra-views is relatively simple by comparison. > > cheers > L. > > On 2 August 2013 22:28, Drew Fer

Re: Custom column names in ManyToMany Field intermediate table

2013-08-02 Thread Drew Ferguson
ames to the columns in the > table So, as to not get the Missing column error in Java. > > Any help would be really appreciated. > -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: How to check if DEBUG is True in template?

2013-08-05 Thread Drew Ferguson
On Mon, 5 Aug 2013 03:41:49 -0700 (PDT) cui ye wrote: > As title. > http://stackoverflow.com/questions/433162/can-i-access-constants-in-settings-py-from-templates-in-django Gives has an extensive answer with several alternatives -- Drew Ferguson -- You received this message because y

Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Drew Ferguson
nce with this... TRUNCATE mytable RESTART IDENTITY http://www.postgresql.org/docs/9.1/interactive/sql-truncate.html -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving ema

Re: Live server tests from cron

2013-08-10 Thread Drew Ferguson
at invokes the tests: > > export DISPLAY=:0.0 > xhost + > > But that seems to have had no effect at all. This question seems to > have been asked a lot, but none of the answers I saw on SO or other > sites worked for me (none of them were using django). > > Anyone here run

Class Based Views

2013-08-14 Thread Drew Ferguson
Hi Did someone here recently say CBVs are now or will be deprecated? Or did I imagine that because I was on holiday? -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Class Based Views

2013-08-14 Thread Drew Ferguson
Phew! Thanks for clearing that up On Wed, 14 Aug 2013 17:29:59 -0400 Bill Freeman wrote: > I believe that GENERIC views that ARE NOT CBVs are deprecated (or maybe > even gone in the latest). > > > On Wed, Aug 14, 2013 at 5:23 PM, Drew Ferguson > wrote: > > >

Passing initial values to a form

2013-09-01 Thread Drew Ferguson
Hi I have gotten myself badly confused today trying to figure this out. If I have these elements # urls.py url(r'^banker/(?P\d+)/iac$', view = IacCreateView.as_view()) # views.py class IacCreateView(LoginRequiredMixin, CreateView): template_name = 'iaccount_form.html' model = Iaccount

Re: Passing initial values to a form

2013-09-01 Thread Drew Ferguson
django/blob/1.6b2/django/views/generic/edit.py#L22 > ) > > > `get_initial` should return a dict, and you should use: > > { > 'name_of_the_model_field': self.kwargs["iid"] > } > > > On Sun, Sep 1, 2013 at 6:37 PM, Drew Ferguson > wrote:

Re: Complex query

2013-09-09 Thread Drew Ferguson
way the ORM & Django SQL access is reduced to a single query on the view. The heavy lifting is all done server-side as comments/articles are saved Could this work? -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups "Django users"

managed=False ignored by migrate

2015-04-17 Thread Drew Ferguson
ngo running fine but it always wanted an "id" field to exist in tables even though there was another field had "primary_key=True" set Is there some trick I am missing or maybe I should not be using 1.8 just yet -- Drew Ferguson -- You received this message because you

Re: managed=False ignored by migrate

2015-04-17 Thread Drew Ferguson
Erk! My own fault unfortunately, apologies for the noise Some files had gotten left in a migration folder in an app; causing all sorts of confusion evidently All well now... On Fri, 17 Apr 2015 13:51:08 +0100 Drew Ferguson wrote: > Hi > > Trying to use a legacy database with Dja

Dynamic CSS

2014-08-12 Thread Drew Ferguson
Hi Is there any documentation describing possible ways of having dynamic CSS in a site? For example, having a CSS colour scheme set from a database query or setting a site logo URL from a database query Ta -- Drew Ferguson -- You received this message because you are subscribed to the Google

Re: Dynamic CSS

2014-08-12 Thread Drew Ferguson
s hard to see Thanks > ATOM, XML and JSON in templates). Or you could have multiple CSS files > and just pick the one you want to use when you render the link to the > CSS in your HTML pages. > > François > > On Aug 12, 2014, at 7:37 PM, Drew Ferguson > wrote: > >

Re: # in django URL

2014-08-14 Thread Drew Ferguson
the file > > both > requestGET["file_path"] and > request.get_full_path() > > ignore #1/test.txt part, how can i fix this? Is there some other way to > get full url? > -- Drew Ferguson -- You received this message because you are subscribed to the Google Groups

Re: Dynamic CSS

2014-08-14 Thread Drew Ferguson
Hi Avraham Thanks for the heads-up On Wed, 13 Aug 2014 11:25:09 +0300 Avraham Serour wrote: > just remember to change the headers of the response to reflect that you > are serving a css file and not html > > > On Wed, Aug 13, 2014 at 3:37 AM, Drew Ferguson > wrote: >

How to get database data into a template sidebar

2013-12-02 Thread Drew Ferguson
but independent of view classes Do I have to add a function call to all CBV contexts to tabulate the data I want to list or is there a better way? Thanks -- Drew Ferguson AFC Commercial http://www.afccommercial.co.uk signature.asc Description: PGP signature

Re: How to get database data into a template sidebar

2013-12-03 Thread Drew Ferguson
.djangoproject.com/en/1.5/ref/settings/#template-context-processors > > On 12/2/13, Drew Ferguson wrote: > > Hi > > > > I am not really sure how to ask the Django docs what I want to do for > > this Could someone point me at the docs please > > > > I h

Re: Url logic

2013-12-15 Thread Drew Ferguson
rom the client browser. > > Now the questions are: > > 1) would you oranize the url in a way like this? (notice that 32 is > the author id) > /mylibrary/book/32/addnewbook > > 2) how do I extract the slug within my BookNew (derived from CreateNew)? > url(r&#

Problem with Form with ForeignKey field

2014-01-14 Thread Drew Ferguson
Hi Django 1.5 I have a model which includes a ForeignKey field defined likes this class Document(models.Model): name = models.CharField(max_length=25, unique=True, null=False,blank=False) target = models.CharField(max_length=12, choices=TARGETS,default='report') content =

Re: Do I need an API?

2014-02-03 Thread Drew Ferguson
> Thanks > > Jim > > > > -- > > 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+uns

Re: moving from sqlite3 to mysql

2014-02-05 Thread Drew Ferguson
EATE DATABASE django_1; > > Query OK, 1 row affected (0.24 sec) > > mysql> SHOW DATABASES; > > ++ > > | Database | > > ++ > > | information_schema | > > | django_1 | > > | mysql

Re: two apps against one table (admin)

2014-02-06 Thread Drew Ferguson
Hi This seems a very complicated solution to a fairly basic problem unless I am missing something > On Feb 7, 2014 2:24 AM, "fborell" wrote: > > > I need to create a second application in the admin section that ports > > to the first applications model. The second application's admin.py > > wou

Re: A subprocess call fails, but only under Django

2014-03-11 Thread Drew Ferguson
of memory required, > but I'm pretty sure this script isn't consuming much memory. Even when > it's not running ls, it's just doing a subprocess call to gpg to sign > and encrypt a file. It takes well under one second. > > Thanks for looking at it. > Shawn > -

user object not available in template

2016-11-25 Thread Drew Ferguson
Hi Using Django 1.10 In my templates there is no user object to provide user.is_authenticated Is there something I have to do to turn this on? My settings has this TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS':

Re: user object not available in template

2016-11-25 Thread Drew Ferguson
Nov 25, 2016 at 3:23 PM, James Bennett > wrote: > >> The auth context processor provides it, but not as a variable named >> 'user'; instead it's attached to the 'request' variable, so what you want >> is '{% if request.user.is_authenticated }}