Re: linking the logged in user to other models to filter query sets -( noobie )

2013-05-30 Thread tony gair
with the line self.user = kwargs.pop('user') do I need to import anything to access that the value 'user' ? On Wednesday, 29 May 2013 15:16:32 UTC, Tom Evans wrote: > > On Wed, May 29, 2013 at 3:29 PM, tony gair > > wrote: > > > > > &

Re: django 1.5 abstractuser / accessing information of logged on user

2013-05-30 Thread tony gair
django! On Thursday, 30 May 2013 11:14:27 UTC, Tom Evans wrote: > > On Thu, May 30, 2013 at 9:57 AM, tony gair > > wrote: > > > > I am using CBV / django braces for authentication. My user authorisation > > model inherits abstractuser and adds a few fields which are

Re: django 1.5 abstractuser / accessing information of logged on user

2013-05-30 Thread tony gair
not i get an error 'type object 'PremisesCreateView' has no attribute 'as_view' #urls.py ), url( regex=r'premuv/(?P\d+)/$', view=PremisesUpdateView.as_view(), name="premuv" ), do you know what I would substitute as_view() for , thank

CBVs and using existing forms for user authentication etc

2013-05-31 Thread tony gair
I'm trying to write my first django app using cbv's and good practice ala 2 scoops! (thanks for all the help so far in this forum btw!) I have constructed the app using django braces and CBV's and have noticed that I can only authenticate into my app through the admin panel. I suspect that dj

django , python and ides

2013-05-31 Thread tony gair
Python and Django are not my first languages and currently I am using it like I would a compiled language inside gedit on debian wheezy. I was actually quite surprised to find a lot of people using it on windows and macs when I went to my local python user group but enough digression!. I was wo

Re: django , python and ides

2013-06-03 Thread tony gair
Got to say that this looks very promising. Theres also a Django plugin too. dddjjjannnggooo! On Saturday, June 1, 2013 9:01:00 PM UTC, Doug S wrote: > > Hey I just ran into a new opensource Python IDE that looks interesting > that wasn't around when I commited to Aptana > Ninja-ide > http:

CBVs and logging a user

2013-06-03 Thread tony gair
I'm getting an error Request URL: http://127.0.0.1:8000/heating/login/?next=/heating/orglv/ Django Version: 1.5.1 Exception Type: ImproperlyConfigured Exception Value: The included urlconf main.urls doesn't have any patterns in it my login form and view has been modified to work off email and p

Re: CBVs and logging a user

2013-06-03 Thread tony gair
my URLS_CONF points to my urls.py in my main project directory. The error only once I press the login button, the form is validated, the user then(correctly ) is authenticated then it fails with the error when I try to redirect it to a view. On Monday, June 3, 2013 2:45:09 PM UTC, tony gair

Re: CBVs and logging a user

2013-06-04 Thread tony gair
lpatterns) > > (Since the error message complains that main.urls has no url patterns in > it.) > > If you don't expect to use such a module, check your existing urls.py > files for a url pattern that does include('main.urls'), or something close. > > > On Tue,

Writing your first Django app - Tutorial Question

2013-06-04 Thread Tony Guilin
t to next command "p.save()" because of the error below. > tony@tonymachine:~/django_projects/mysite$ python manage.py shell > Python 2.7.3 (default, Aug 1 2012, 05:16:07) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license

getting information from a many to many model from user

2013-06-06 Thread tony gair
I use the Userena app to manage my users but I want the superuser to choose the organisation for them so they cannot wonder around other organisations information. I can either create a foreign key in their profile to point to the organisation but then I expect they can change it, which woul

Re: getting information from a many to many model from user

2013-06-07 Thread tony gair
class function ? On Thursday, 6 June 2013 13:02:02 UTC, Daniel Roseman wrote: > > On Thursday, 6 June 2013 11:00:40 UTC+1, tony gair wrote: > >> >> >> >> I use the Userena app to manage my users but I want the superuser to >> choose the organisation for

database -> model -> charting

2013-06-07 Thread tony gair
I would like to hear peoples opinions on third party django charting apps, with various considerations. My primary consideration would ease of use by a django noob. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: database -> model -> charting

2013-06-07 Thread tony gair
Been trying out a couple over the last few hours. I have to say, the one you mention seems streets ahead of anything else, and its documented really well, which is the clincher for me. Many thanks for that super helpful info! On Friday, 7 June 2013 11:33:07 UTC+1, Christian Schulz wrote: > > Whe

Re: database -> model -> charting

2013-06-08 Thread tony gair
After trying this I find a problem with the types it can use. For example it does not seem to like BigIntegerField unless there is something else I am doing wrong. Thinking about it, maybe I am letting chartit do too much for me but I do like the idea of something doing the hard thinking for me

Re: database -> model -> charting

2013-06-10 Thread tony gair
imal' Exception Location: /usr/lib/python2.7/json/__init__.py in dumps, line 250 Python Executable: /usr/bin/python Python Version: 2.7.4 Python Path: ['/home/tony/django/sh', '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg', '/usr/lib/python2.7', &#

Re: database -> model -> charting

2013-06-10 Thread tony gair
dumps, line > 250 > > Python Executable:/usr/bin/python > > Python Version:2.7.4 > > Python Path: > > ['/home/tony/django/sh', > > '/usr/local/lib/python2.7/dist-packages/Django-1.5.1-py2.7.egg', > > '/usr/lib/python2.7',

Re: database -> model -> charting

2013-06-10 Thread tony gair
, tony gair wrote: > > I tried that on 1.5 and tried my code out in a 1.4 install. I get the same > error. Interestingly in stack overflow they mention this problem at > http://stackoverflow.com/questions/8644060/caught-typeerror-while-rendering-init-got-an-unexpected-keyword-argu

readonly_fields

2013-06-19 Thread tony gair
I have tried to use readonly_fields in a form to designate fields that the user is not allowed to change. class Meta readonly_fields = [user] e.g. However when I show the form the user can edit them.doh, btw I do want to display, but not to edit! -- You received this message be

Re: readonly_fields

2013-06-19 Thread tony gair
Ah thanks that explains that I'll look into changing the readonly attribute on the widget, is there a list of widgets do you know as some of these are choice fields i.e. non text and non integer fields On Wed, Jun 19, 2013 at 1:26 PM, Timster wrote: > Where are you setting that? readonly_fi

Anyone using django tabs ?

2013-06-20 Thread tony gair
I am trying django tabs for my site navigation and was wondering is I have to list multiple tabs in the html file thats inherits from base.html {% if request.user.is_superuser %} {% activetab "topnav" "home" %} {% activetab "topnav" "admin" %} {% endif %} or can I say {% if request.use

Re: Anyone using django tabs ?

2013-06-20 Thread tony gair
The answer I think is no , ah well. On Thursday, 20 June 2013 09:28:39 UTC, tony gair wrote: > > I am trying django tabs for my site navigation and was wondering is I have > to list multiple tabs in the html file thats inherits from base.html > > {% if request.us

Re: Writing your first Django app - Tutorial Question

2013-06-25 Thread Tony Guilin
> > you have missed > from django.utils import timezone > That worked! Thanks. P.S. I just copy and paste in Chrome (in Ubuntu) and it picks up the formatting. On Tuesday, June 4, 2013 4:10:23 PM UTC-7, Tony Guilin wrote: > > In the https://docs.djangoprojec

Django Chartit Installed, How do I run the demo???

2013-07-16 Thread Tony Guilin
I'm a complete noob. I've been able to go through the Djano tutorial with minimal issues. I successfully installed this according to: Installation¶ You can install Django-Chartit from PyPI. Just do $ pip install django_chartit You also need

Re: Django Chartit Installed, How do I run the demo???

2013-07-16 Thread Tony Guilin
BTW, I'm using http://chartit.shutupandship.com/docs/#how-to-use On Tuesday, July 16, 2013 10:43:39 PM UTC-7, Tony Guilin wrote: > > I'm a complete noob. > > I've been able to go through the Djano tutorial with minimal issues. > > I successfully installed this ac

Custom logging formatter issue

2013-07-17 Thread Tony D
I am attempting to eventually set up django logging via a third-party service. For this I am using python-json-logger and setting up an appropriate formatter in the LOGGING dictionary in settings.py. I believe I have it set up correctly, but when the formatter is enabled the first page I get af

Customize error messages for django-registration

2013-09-05 Thread Tony Lâmpada
Hi, I have a question about django-registration ( https://bitbucket.org/ubernostrum/django-registration), but I can't find their issue tracker or a mailing list for it, so I'll try mu luck here. My application enables login via OpenID and login/password. Some users "forget their password" on FS

how can I use ipdb with runserver_plus?

2011-08-04 Thread Tony Schmidt
Is this possible? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, vis

Re: jquery problem

2011-01-16 Thread Tony Lambropoulos
Prashanth, This has to do with django because they work outside of django. On Mon, Jan 17, 2011 at 6:12 AM, Prashanth wrote: > Hi Tony, > > On Mon, Jan 17, 2011 at 8:57 AM, Tony wrote: > >> Unfortunately, I can't get any other plugins to work that I download. No >

Re: jquery problem

2011-01-17 Thread Tony Lambropoulos
eat myself too much, but I did get them to work otuside of django and Ive used firebug to confirm that the scripts are in the page when loaded in the browser. On Mon, Jan 17, 2011 at 7:53 PM, Vovk Donets wrote: > > > 2011/1/17 Tony > > I did what you've recommended, I put in

Re: jquery problem

2011-01-17 Thread Tony Lambropoulos
When I say I am only using the table-formset page, I mean thats the only template. I am using the js file, jquery.formset.js it comes with. Sorry about my vagueness. On Mon, Jan 17, 2011 at 8:14 PM, Tony Lambropoulos wrote: > This is the project I have started with: > http://code.google

Re: chrome extension

2011-02-15 Thread Tony Lambropoulos
Should I assume that this was a silly question? On Mon, Feb 14, 2011 at 10:10 PM, Tony wrote: > Hi, > Is there any way to have a chrome extension with a backend in Django, > like for storing data server side and using its views? Or is this not > possible? > thanks > > -

Trouble changing from sqlite3 to postgres

2015-02-17 Thread tony . guil35
I have written a simple Django app (my first) that works with sqlite3 database. I want to change to postgres, but when I run the Django 1.7 migration utility with the command "python manage.py migrate" I get the error: psycopg2.ProgrammingError: column "date" cannot be cast automatically t

Re: Trouble changing from sqlite3 to postgres

2015-02-17 Thread tony . guil35
, params) django.db.utils.ProgrammingError: column "date" cannot be cast automatically to type integer HINT: Specify a USING expression to perform the conversion. On Tuesday, February 17, 2015 at 4:39:27 PM UTC-8, Joel Burton wrote: > > The error is probably in code you wrote tha

Deploying Django, nginx , gunicorn, postgresql

2015-02-20 Thread Tony Kyriakidis
Hello, It's been a week now since the day i started trying to deploy a test blog application on digital ocean. I tried everthing and if you go to the IP: http://188.166.62.146 you get a Welcome to Nginx page. when i go to http://188.166.62.146:8001 i get a (400 Bad Request) error. Here on Stac

Attempting to setup Graphite (Django/Gunicorn) DJANGO_PATH not set and "no such table: auth user"

2014-03-11 Thread Tony Su
ssues that differ from the official documentation for a week now... Thx, Tony I have 2 current questions: Q - I strongly suspect that DJANGO_PATH is not set. I've found documentation that suggests how it might be set from an interactive console on Windows http://stackoverflow.com/questions

Re: Attempting to setup Graphite (Django/Gunicorn) DJANGO_PATH not set and "no such table: auth user"

2014-03-12 Thread Tony Su
der https://github.com/gdbtek/setup-graphite Tony -- 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 post to

My first project - URL issue?

2017-11-02 Thread Tony King
Hi, I've started my first real project (django v1.11.4 and Python 3.6.2) and I'm probably trying to run before I'm ready, but anyway I'm here. I'm essentially trying to create a front-end menu, that will eventually launch and log-on to either a local application or another web-site. This lat

Re: My first project - URL issue?

2017-11-02 Thread Tony King
> > Ok, well I've solved my immediate problem but clearly need to learn more > about JavaScript, jQuery and CSRF tokens. > But for anyone with a similar URL issue, I did the following; Added an appname setting to my urls.py appname = 'shopfront' urlpatterns = [ url(r'^$', views.index, name='ind

How do I pass the CSRF token when using a jQuery post

2017-11-07 Thread Tony King
Hi, I thought I'd finally understood this but it seems I have not and I've spent far too much time trying to do it myself. I have a view rendering to the template below, which is displaying a number of buttons that when clicked will execute another Python function in the views.py. This works

static files in production

2017-11-07 Thread Tony King
.py and folder structure, which I'm hoping will be useful. Can someone please help? Kind regards, Tony -- 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,

Re: static files in production

2017-11-08 Thread Tony King
it like that. Having gone through the tutorial, I thought Django would be a great tool but I seem to be struggling with the most simple of things and I've barely started this project, I'm just trying to test out some basics including the deployment. Kind regards, Tony -- You rece

Re: static files in production

2017-11-08 Thread Tony King
Ok, I've found a solution here which allows the serving of static files from within the project file folder structure as gathered by collectstatic. I now see that the FastCGI Handler required for

Re: How do I pass the CSRF token when using a jQuery post

2017-11-09 Thread Tony King
Thanks Gourav, I have it working now and I can even understand it, which is even better. For anyone interested my revised working solution is below. I'm sure it would be better practice putting the token into the headers as described in the documentation and elsewhere but I could not get it t

Re: Tutorial part 4 - get_queryset

2017-10-17 Thread Tony King
Thanks James, that is a big help and I'm sure the link will provide some worthwhile extra reading, although I've clearly got a lot to learn anyway. Regards, Tony -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

display readonly or not

2015-08-10 Thread Tony Peña
hi i have this on my model.admin class MyDomainAdmin(admin.ModelAdmin): list_display = ('domain', 'enabled', 'avscan', 'spamassassin', 'max_accounts') list_filter = ('enabled',) exclude = ('uid', 'gid', 'maildir') # this part is my pseudo-code logic I want but i can't solved. if

Re: display readonly or not

2015-08-11 Thread Tony Peña
return self.readonly_fields else: return self.model._meta.get_all_field_names() get_readonly_fields = ro_fields 2015-08-11 7:23 GMT+02:00 Mike Dewhirst : > On 11/08/2015 7:25 AM, Tony Peña wrote: > >> hi >> >> i have this on my model.admin &g

Re: display readonly or not

2015-08-11 Thread Tony Peña
because i don't know how... that's why i ask :) 2015-08-11 11:17 GMT+02:00 Daniel Roseman : > On Tuesday, 11 August 2015 06:24:32 UTC+1, Mike Dewhirst wrote: > > >> There is a get_read_only() method in the admin.ModelAdmin class. It >> normally returns self.readonly_fields but you can give it a c

limit insert rows into model database

2015-08-12 Thread Tony Peña
Hi exist some settings to only insert X number of rows in a model? django.db. (i guess, restrict 5 rows) as simple way ? or setting directly into MySQL ? because, i override the save method to check if: # models.py class domain(model.Model): ... max_accounts = models.IntegerField(de

filter in queryset

2015-09-12 Thread Tony Peña
Hi need a help with this queryset problem i got into my models. models.py - class Classi(models.Model): classi = models.CharField('Class Name', max_length='20', unique=True) internet = models.BooleanField(default=None) using Calssi can do: create: A, B. C class Prof(models.Mod

Re: filter in queryset

2015-09-13 Thread Tony Peña
thanxs so much... that works perfect.! 2015-09-13 11:19 GMT+02:00 James Schneider : > Not sure if I'm following you 100%, but i think you can filter like this: >> >> return qs.filter(classi__prof=request.user) >> >> This would match the MAC to a class, and the class to a professor, and >> the pro

Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Tony Flury
I have a small background task (executed by using threading.Timer) which I want to start up when the server starts, but doesn't need to start when a management command runs. The background task performs operations on the database, so relies on importing the models etc. I have tried using the A

Re: Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Tony Flury
Andreas, Thanks for your answer. Certainly it looks like running celery might alleviate the issue with threading stopping the management commands, but the problem with your suggestion lies with that flag. If My code was able to identify that the server is running to the point of being able to s

Re: why cannot delete attribute id of model?

2016-01-11 Thread Tony Flury
Why do you want to delete the id field. The idea of a primary key field is central to relational databases. If you to suppress the automatically generated primary key then you need to assign another field as the unique primary key: as far as I know that will prevent the id field being created.

Re: why cannot delete attribute id of model?

2016-01-11 Thread Tony Flury
Stating the value of either the id or pk field to None is the recommended way to rest the primary key when you take a copy of a record, but Xudong wanted to delete the field entirely: which I don't understand. -- You received this message because you are subscribed to the Google Groups "Djang

Re: Showing BooleanField checkbox on left

2016-01-15 Thread Tony Flury
On Thursday, 14 January 2016 17:55:41 UTC, Sayse wrote: > > Yea I've heard of it. Have they managed to achieve this? I'd be interested > to see how they've done it if so... > > I was hoping to find a way to do this with native django if possible > One way that might work is to subclass the Ch

Re: Model or Form class

2016-03-12 Thread Tony Flury
You can use forms.Form when you want to build a custom form which isn't directly connected to a model on the database. For instance one use for a forms.Form is where you are collecting data which will be stored into attributes on different models. The documentation I think uses forms.ModelForn

widget form

2016-03-19 Thread Tony Peña
hi, if i got a form for example with 2 charfield, and bottom a check box how can i do if that checkbox is true appears the next other 2 charfields ?(maybe hide) this exist with some function on django-admin ? thanxs -- perl -le 's ffSfs.s fSf\x54\x6F\x6E\x79 \x50\x65\x6e\x61f.prin

Re: Stuck with Django on a Synology Diskstation

2021-07-14 Thread Tony Chang
anks Best Regards, Tony MH 在 2020年3月3日 星期二下午9:01:31 [UTC+8] 的信中寫道: > Dear nitish > > Thanks for your reply. I guess it is kind of a linux that Synology uses, > but it is different from other distros. So many advice on the internet > builds upon the ability to install packages via

<    1   2