Re: url () to path()

2018-05-01 Thread Mike Morris
I'm not sure I understand the question, but here's my input: * You can use either url() or path() and achieve the same thing o However, I assume that the older url() is being deprecated, so you should use the newer path() if your version supports it * My cheat sheet is often the

Re: Simple file uploading app

2018-01-08 Thread Mike Morris
Though it is not a Drupal app, there is an excellent drop box type app in PHP called "Download Ticket Service"... simple, no frills, entirely cross-platform and open: http://www.thregr.org/~wavexx/software/dl/ I have no idea if it could be readily incorporated into your app, but just FYI

Re: Wich OS for develop?

2018-01-02 Thread Mike Morris
I've been linux only for many years - the last Windows I used was 2000 Professional so you can guess my recommendation on OS :-) As for IDE, I found "Eric 6" (https://eric-ide.python-projects.org/), which is pretty great, and free. Installation was bumpy since it has some pre-requisites,

Re: [OT] Is Trump planning to break the Internet?

2017-12-12 Thread Mike Morris
May I suggest: http://www.politicalforum.com/index.php Would *insist* help??? On 12/12/2017 05:14 AM, mccc wrote: I agree with Matthew's sentiment; also, I'd like to point out that the words you (Larry) posted are not your own but are literally coming off of foxnews.com

Re: Send email - user data for complete registration

2017-11-30 Thread Mike Morris
Earlier comment is correct that you shouldn't email a password. It's actually not necessary, or even possible. The stored version is a "one way hash" -- which is not reversible; there's no way to get the password from the hash -- and you (should) only have access to the hashed value.

Re: DJANGO app loose path from batch file

2017-11-06 Thread Mike Morris
On 11/06/2017 10:12 AM, Xristos Xristoou wrote: i am windows user My condolences. -- 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

Re: Django Upsert Transaction

2017-08-25 Thread Mike Morris
what's the point of doing this I assume it is "atomicity" -- making sure the update/insert pair is indivisible and that it is impossible to do one without the other. Depending on application, that could be catastrophic... On 08/25/2017 04:39 AM, Fendy Purnomo wrote: Hi, I'm

Re: Cannot access imported functions in django shell by pipeline command

2017-08-25 Thread Mike Morris
Wild guess: Different default directory. Try setting PYTHONPATH, or add "os.chdir('some/dir')" to top of script... On 08/24/2017 10:33 PM, Cheng-Hung Hsueh wrote: It is a python script `|tshi3.py|` : | 在此輸入代碼... |importcsv defli2ho2():print(csv)li2ho2()| | I copied this code and

Re: include template in a page

2017-08-25 Thread Mike Morris
I may be alone in this, but perhaps it will help piceofkayk2718 to know that I completely ignore his (?) posts because there is never any context On 08/23/2017 12:01 PM, pieceofkayk2...@gmail.com wrote: Do you have an action on your register form? Like -- You received this message

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-07 Thread Mike Morris
I have no expertise in the field, but I've chosen not to let that stop me from making a suggestion :-) How about splitting the difference: 1. Assign & track permissions on the application side, then 2. Pass the permission level/parameters into a Stored Procedure in the database If the

Re: Math filter

2017-07-19 Thread Mike Morris
On 07/19/2017 06:20 PM, Vijay Khemlani wrote: I'm guessing he's using the mathfilters package https://github.com/dbrgn/django-mathfilters Arggghhh... my ignorance is showing! I hope I included an "I'm new here" disclaimer in the original post!!! Anyway, never heard of it, I'll take a look!

Re: Math filter

2017-07-19 Thread Mike Morris
Of course, if they're integers you could implement the "mul" as a loop of "add"s... clumsy, but would work. On 07/19/2017 03:39 PM, Mike Morris wrote: I am a newbie, but I think the answer is that you can't do that in the template - instead, calculate the number

Re: Math filter

2017-07-19 Thread Mike Morris
I am a newbie, but I think the answer is that you can't do that in the template - instead, calculate the number in the view and pass it to the template in the context dictionary. I think it's a design philosophy of Django Template Language to not support this as it muddies the border between

Re: Django beginner

2017-07-13 Thread Mike Morris
Start with the Tutorial on the djangoproject.com website. Finish it. Then, some other sources I like: * https://tutorial.djangogirls.org/en/ * http://www.tangowithdjango.com/ Google "django tutorials", there are lots On 07/13/2017 04:48 PM, Amir Pirmoradian wrote: Hey Guys, i'm a

Re: Django Teachers-Subject-Classroom Question

2017-07-10 Thread Mike Morris
This is more a DB Q than a Django Q, but googling ""schema" course teacher student classroom" yields a useful first hit: https://dba.stackexchange.com/questions/22064/database-schema-design-for-school-system On 07/10/2017 06:05 PM, Cristian Torzsa wrote: Hello, I what is the best database

Re: The best database for django

2017-07-10 Thread Mike Morris
PostgreSQL or Oracle is the most "robust" of supported DB. (Certainly an opinion, but I doubt its a very controversial one.) If you had Oracle, you'd probably be required to use it so I'm assuming you can choose... which means you want PostgreSQL (free and very, very nearly as good - better

Re: How to create a fixed-length binary field with a unique constraint?

2017-07-10 Thread Mike Morris
From your description (save a SHA-256 checksum), you do not need a binary field. Binaries are always of indeterminant length; they can hold photos, executables, sound files, etc. By definition, a SHA -256 is 256 bytes of ASCII. You probably want a CharField(length=256). On 07/10/2017

New to Django, need help starting

2012-06-20 Thread Morris Zeitouni
I just downloaded and installed Django. I am trying to run the command of startproject, but when I type in "django-admin.py startproject iFriends," Terminal is telling me-" -bash: django-admin.py: command not found." Why is it not understanding the django- admin function? I am using Mac OS X

django custom primary key problem.

2012-03-12 Thread Morris
Hi all, I have a custom primary key, but I can NOT get data from db. === **models.py** class BuildRecord(models.Model): sku_name = models.CharField(max_length=600, primary_key=True, db_column='SKU_name') download_link = models.CharField(max_length=1500,

Re: How to show the template reserved keyword on html.

2012-02-20 Thread Morris
> >     /j > > On 20 helmi, 09:35, Morris <morrislin1...@gmail.com> wrote: > > > > > > > > > Hi Karen, > > > Thanks a lot, I tried the method. > > > {% openvariable %} sample {% closevariable %} > > > But , I got error

Re: How to show the template reserved keyword on html.

2012-02-19 Thread Morris
Hi Karen, Thanks a lot, I tried the method. {% openvariable %} sample {% closevariable %} But , I got error message as below: Invalid block tag: 'openvariable' Request Method: GET Request URL:http://10.7.40.190/document/doc/ Django Version: 1.3.1 Exception Type: TemplateSyntaxError

How to show the template reserved keyword on html.

2012-02-19 Thread Morris
Hi all, I would like to write some django note via template. I tried to show ""{{ sample }}"" on my website, but it's empty. I think django think it's a variable name. So, how to show {{ sample }} ? On the other hand, how to show template reserved word? Thanks a lot. -- You received

Having a instance of a model object instantiate another

2008-04-24 Thread John Morris
rtently trying to make it do something without understanding more fundamentally how it is working at low-level and I haven't got there yet. Thanks much! -- John Morris [EMAIL PROTECTED] "Do nothing which is of no use." -- Miyamoto Musashi --~--~-~--~~~-

Re: newforms.CharField now returns unicode, but how to specify encoding?

2007-07-27 Thread Sam Morris
, or you can serve the pages containing the FORM as utf-8 and hope that the browser behaves sensibly and follows suite. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 --~--~-~--~~~---~--~~ You recei

Re: Django - technology or magic?

2007-07-24 Thread Sam Morris
little bits (and know where to find the documentation!), code like this will start to look a bit less magical and a bit more like, well, regular code. :) -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 --~--~-~--~~--

Re: Feisty-updates now contains Python-2.5.1final

2007-05-27 Thread Sam Morris
' are available with: $ apt-cache policy python python: Installed: 2.5.1-0ubuntu3 Candidate: 2.5.1-0ubuntu3 Version table: *** 2.5.1-0ubuntu3 0 500 http://gb.archive.ubuntu.com feisty-updates/main Packages 100 /var/lib/dpkg/status 2.5.1~rc1-0ubuntu3 0

Re: Django, Postgres and Core Dumps

2007-05-26 Thread Sam Morris
apt-cache policy python python: Installed: 2.5.1-0ubuntu3 Candidate: 2.5.1-0ubuntu3 Version table: *** 2.5.1-0ubuntu3 0 500 http://gb.archive.ubuntu.com feisty-updates/main Packages 100 /var/lib/dpkg/status 2.5.1~rc1-0ubuntu3 0 500 http://gb.archive.ubu

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Sam Morris
local installation of python2.5 by using an option like: --with-python=/usr/local/bin/python. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 --~--~-~--~~~---~--~~ You received this message beca

Re: TIME_ZONE Error? Anyone ever get this?

2007-04-29 Thread Sam Morris
t = error in your postgresql.conf and then all statements that generate an error will be logged; hopefully you'll be able to see the statement that caused the transaction to be aborted in the first place. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B

Re: IEPngFix Hack for Django ?

2007-04-27 Thread Sam Morris
entire temporary internet files directory), because MSIE seems to remember the fact that the iepngfix.htc resource was once served with the incorrect media type, and ignores it from then onwards. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA

Re: Must be a bug??? "ordering" error splits field

2007-04-05 Thread Sam Morris
t; ('code',) defines a tuple containing a single element, that is a string. Finally, ['code'] defines a list containign a single element. IMO it's much easier to type, and easier/less confusing for humans unfamiliar with Python to parse and understand. :) -- Sam Morris http://robots.org.uk/ PGP ke

djschemadiff - show differences between Django database schemas

2007-03-20 Thread Sam Morris
it works with PostgreSQL 8.1, but shouldn't be too hard to extend to work with other database systems. djschemadiff can be downloaded from <http://robots.org.uk/src/djschemadiff/>. Feel free to send me any comments, flames or patches! -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5E

Re: ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread Sam Morris
this would fit. Any help much > appreciated. It turns out that you can just set the field's choices after the manipulator has been created: m = Post.AddManipulator () m['images'].choices = [(i.id, i) for i in Image.objects.filter (author = request.user)] -- Sam Morris http://robots.org.uk/

ManyToManyField, limit_choices_to and properties of the request object

2007-03-19 Thread Sam Morris
Is it possible to use a ManyToManyField's limit_choices_to attribute to limit a user to picking only from related objects that have author = request.user? Given that request has no place in the model definition, would it be necessary to write a custom manipulator? -- Sam Morris http

Re: how to use .htc file in django

2007-03-12 Thread Sam Morris
k /etc/mime.types on Unix, so editing that file is sufficient. On Windows, you have to do a bit more work (as usual): edit python's mimetypes.py so that it searches for the mime.types file in a known location, then create a mime.types file at that location with the correct contents. -- Sam Morris ht

Re: Radio and Checkbox rendering

2007-02-13 Thread Sion Morris
I do have a widget attribute set on the field in the model but it is rendered in the template as a . In which part of the model-view-template do I specify how the radio (or checkbox) fields are rendered? My model looks like this: class ParticipantAttrForm(forms.Form): # Dynamically creates a

Radio and Checkbox rendering

2007-02-12 Thread s . morris
I have a form that is generated dynamically and contains either radio, checkbox, text field or drop down menu. The following is used to render the form: {% for attribute in attributes %} {{ attribute.label }} {{attribute }} {% endfor %} This work well except when attribute is a radio or a

Implementing entity relationships that use compound keys in a Django application

2006-10-03 Thread Sam Morris
option is probably the best one, but I thought I would post anyway to see if any more experienced users could confirm/deny, and to see if there are any other approaches that I have missed. -- Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA