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 examples in the very good official tutorial.
 o I generally just go to the latest and then twiddle the version
   in the URL to compare:
 o CURRENT - with new path():
   https://docs.djangoproject.com/en/2.0/topics/http/urls/
 o 1.11 - with older url():
   https://docs.djangoproject.com/en/1.11/topics/http/urls/ (note I
   just changed "2.0" to "1.11"...)
 * https://www.google.com/search?q=django+2+cheat+sheet
 * Better yet, make the cheattsheet of your dreams, put it on the web,
   and maybe someday you'll be a famous Django guru!!!



On 04/30/2018 10:53 PM, Kayode Oladipo wrote:


Hi there again! Beginner here using Django 2.0.
I'm following a tutorial (coupled with the official doc for 
compatibility) and I discovered that <2.0 versions use RegEx with the 
url but 2.0> uses the simplified path() function.
My question is how do I find the right corresponding path() function 
to a url (),

A cheat sheet would be wonderful.

Cheers!

--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BARzD8HO26aTwpdYe1km9_%3DykDgBF_y%3DRfkNhrpFvHmSsea6w%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20e07218-120b-0875-f739-c2d45b2634d3%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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


From their website:


“dl” is a simple file sharing service for quick/one-off file 
transfers. Upload a file to get a link you can share. Or create a 
sharing link to receive files from others. The uploaded files are 
automatically removed when left unused, requiring zero 
additional maintenance.


“dl” is/built for your users/: easy to use with any browser, 
integrates smoothly withThunderbird 
for 
large attachments, works onAndroid 
,Windows,OSX 
or straight 
from thecommand line 
for 
maximum convenience.








On 01/08/2018 04:16 AM, guettli wrote:
Just for the records: Since I found no matching solution I wrote a 
generic http upload tool: https://pypi.python.org/pypi/tbzuploader/


For ftp there are thousands of clients, for automated upload via http 
I found none. That's why I wrote above tool.


Regards,
  Thomas

Am Mittwoch, 25. Oktober 2017 16:57:31 UTC+2 schrieb guettli:

I need a simple file uploading app.

Every user should be able to upload files to his own area.

This is the basic feature. You could think of additional goodies,
but the first step is
above feature.

I tried to find an application which implements this, but failed.

I tried this and other searches:

https://djangopackages.org/search/?q=upload



Before I start coding, I wanted to ask here, because I prefer
re-using to re-inventing :-)

Do you know an app which gives me this feature?

Regards,
  Thomas Güttler


--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/016f37e6-3d91-40bc-bef5-8da625125117%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/95b3ba1c-568e-476c-15c0-c52afbde0ca9%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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, but it's easy enough if you're PC savvy.


Fully integrated w/ Django via  plugin; can run the dev server directly, 
etc.



Good luck...



On 01/02/2018 01:29 PM, Avraham Serour wrote:

In my opinion ubuntu
no, but I wouldn't say good either
yes
pycharm
good luck

On Tue, Jan 2, 2018 at 11:23 PM, Julián Melero Hidalgo 
> wrote:


Hi all.
I don't have experience with django, so I have so much questions.
The questions are:
Wich OS is better to develop with django?
Windows is a bad option?
Can I use Win for develop and GNU/Linux as a server?
What IDE (atom, VS Code, vim,etc..)you use?
Thank you!!!
-- 
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 this group, send email to django-users@googlegroups.com
.
Visit this group at https://groups.google.com/group/django-users
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/2be2cccf-461a-40f7-a7d6-0ba65c1c5acd%40email.android.com

.
For more options, visit https://groups.google.com/d/optout
.


--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tLdWo6iRgXO0kcgwtkNtV0tF03DY-ZJMm2pbuaM%3Dwabug%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f698f78-7367-62fa-9e54-4aeac4f4d40a%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 
 (found 
also on telecoms.com 
, 
by means of a "feature article" from a not-so-trustworthy consultancy 
group).
I do agree that the topic and the approach to the issue are not 
adequate for the group, but your (Larry's) attempt to "gain the high 
ground" fell _very_ short.


All the best,
Michele

On Monday, December 11, 2017 at 3:52:51 PM UTC+1, larry@gmail.com 
wrote:


On Mon, Dec 11, 2017 at 9:24 AM, Matthew Pava  wrote:
>>> Please keep your political rhetoric and irresponsible
scaremongering off this list.
>
>>> All the net neutrality repeal will do is restore some of the
permissionless innovation that allowed the internet to blossom in
the first place.
>
> Dear Larry,
> Please read what you just wrote.  On the one hand, you asked
Etienne not to share political rhetoric, and then you called
Etienne's act one of irresponsible scaremongering.  And then you
had to have the last word in this discussion by sharing your own
political rhetoric about the topic.  That's not right, and I'm not
going to sit by and let that happen.
>
> The better way to handle it would have been a personal message
to Etienne asking that user not to post political rhetoric (in a
nicer way than you just did) and not make that message public.
>
> So here's an article about Net Neutrality:
>
https://www.savetheinternet.com/net-neutrality-what-you-need-know-now



That article is from freepress.net , a very
far left, statist group,
that feels the government should regulate, control and tax every
aspect of your lives. We do not need more government regulation, we
need less. A free market is always better. Net Neutrality is
censorship, and it's crony capitalism.

--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80893af4-a5a6-494a-9829-5975ed48d7c9%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/30585bca-5d1e-d1fa-68a9-d0a752fc2ad5%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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. 
(Obviously it could be hacked to store the value un-hashed... but don't 
do that :-)


The user should know the password if they just created it. And if 
they've forgotten, then just send them a Reset link.


A system admin should never have access to the passwords of any of the 
system's users... in fact, that's the (US) law (Sarbanes-Oxley) in many 
types of applications, e.g. financial transaction site of any publicly 
traded company.





On 11/30/2017 02:45 PM, Richard Maceček wrote:

Hello,
after successful registration of the user, how to send personal 
information (password) to the user in emails? I personally use 
send_mass_mail. But I have a problem that the password is not in text, 
but it's in the "encrypted" form.
 I do not know how to send user's data but now they need it, and I 
have not found documentation on how easily I can get the password to 
display the text format.


I use this shape:

|

message ='Hi, registration date:'+'Your name:'+user.username +'Your 
password:'+user.password


email.send ()
|

Thanks for any advice!
--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3bc6d503-20ef-4002-b291-753d83786dfd%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4a2f9bf-d294-2646-a599-99926fafcc4f%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d3a7d6b-d259-9524-a63a-bfd8db007701%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 relatively new to Django and have use it in past few months.

Recently I stumbled upon a SQL deadlock. After digging deeper it was 
caused by SQL gap lock when inserting.


Then I found that Django upsert is actually putting update/insert 
inside one transaction. I might be missing what's the point of doing 
this but why don't we put it in different transaction?


I am really new to DBA stuffs and a bit lost where to start. Really 
glad for any kind of help! Thanks in advance :D


Regards,
Fendy
--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9d77d3b-c538-4912-ad7b-b4ce2ea06b55%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21e272fc-531c-21ca-5101-f19605285a96%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 pasted it in |`python manage.py shell|`. It works.

But I ran `|python manage.py shell < tshi3.py|`. Got |`NameError: name 
'csv' is not defined|.`


Why?


Enviroment:

|
在此輸入代碼...
|LinuxMint18.1Python3.4.1(default,Sep32014,08:45:22)Django==1.11.4|
|

--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7466c326-0f03-4299-9239-1126daf24aaf%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1944651-6a10-cfcc-f555-9ba7e5460797%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce2a92c4-270a-46c9-9b49-06a2d72cf72b%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3c8d7c5-5efb-98ca-51e9-674325e4b88e%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 Stored Procedure accepted permission info, it would not even need 
to know who the user was, just their permissions. (So no need for DB 
user switching, etc) ACLs would be enforced 100% in the DB, while rights 
management stayed in the app.


You'd just have to figure out a flexible enough set or parameters to 
pass into the stored procedure to allow all the permission permutations 
you need... ever... ;-)



On 08/07/2017 12:42 AM, Andréas Kühne wrote:

Hi,

I understand your concern, however I would like to learn more about 
how you intend to solve the problem. The only way I could see a 
solution would be to change the database user depending on which 
application user is logged in. That would mean updating users and 
permissions in the database every time it changes on the application 
level. I think this would add a lot of complexity that you really 
don't want.


You could of course have one role for each group you intend to have in 
the application and then apply the permissions accordingly. That would 
however mean that your user permissions solution is very rigid. One of 
the things that I like about django is the ability to add and delete 
permissions easily and swiftly. I'm wondering if you instead couldn't 
create mixins to make sure that the permissions are correct for each 
object. That way the code will be easily testable and also less error 
prone. However it won't create great SQL queries though.


Also - I find that working in Python is a lot easier than working in 
raw SQL :-) but you will of course need to adapt the queries to make 
them faster (which can be done by prefetching for example).


That's just my 2 cents.

Regards,

Andréas

2017-08-07 8:43 GMT+02:00 guettli >:


Hello this post is now four days old. I would like to hear from
other people.

Something like:

 "I have no clue what you are talking about" or
 "I understand your concerns, but I have no clue, too" or
 "Thank you about talking about this, this raised my awareness"

would make me happy.

Thank you.

Am Donnerstag, 3. August 2017 10:07:53 UTC+2 schrieb guettli:

First I asked a similar question on the postgresql-general list. The 
discussion[1] has settled there.

Now I would love the hear what you think.


I am thinking about rewriting an existing application which uses 
PostgreSQL via Django.

Up to now the permission checks are done at the application level.

Up to now queries like: "Show all items which the current user is allowed to 
modify" result in complicated SQL and
this leads to slow queries.

Up to now there is one db-user and the application does the filtering 
of rows to prevent application users to see
items which they are not allowed to see.

I guess most web applications work like this.

I would like to reduce the "ifing and elsing" in my python code (less 
conditions, less bugs, more SQL, more performance)

One important intention for me: I would like to avoid the redundancy. 
As soon as I want to query for
"Show all items which the current user is allowed to modify" I need the 
permission checking in a SQL WHERE condition.

If I implement this. Then my code which might look like this is 
redundant:

{{{

def has_perm(obj, user):
 if user.is_superuser:
 return True
 ...

}}}


Yes, I feel farewell pain. I love Python, but I guess I will use perm
checking via SQL WHERE for new projects in the future. What do
you think?   Regards,
Thomas Güttler


[1]:https://www.postgresql.org/message-id/e662fd8a-6001-514c-71e8-01718444f338%40thomas-guettler.de



-- 
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 this group, send email to django-users@googlegroups.com
.
Visit this group at https://groups.google.com/group/django-users
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/b2f0f560-9e83-4a90-9277-23c19f992c0b%40googlegroups.com


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!

Thank You Vijay!


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bd06d501-0603-e62e-a34d-01ae014c912d%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 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 data and presentation. 
They've obviously made some exceptions for the really common/easy use 
cases - like "|add"


There are other template languages that do support that of course; if 
its important enough you could look at changing the template engine...





On 07/18/2017 07:21 PM, sum abiut wrote:

Hi,
needed direction maths filters on django templates. for example how 
to you perform this on a template.


a*b +b*c

i did  a|mul:b|add:b|mul:cbut got a wrong answer. Please 
point me to right direction.


cheers,
--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y648sfPwKJWLmRtcx6tfC_PZP6RP6PjUvCmzRKVfOH%3DSg%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAPCf-y648sfPwKJWLmRtcx6tfC_PZP6RP6PjUvCmzRKVfOH%3DSg%40mail.gmail.com?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ff382b8-ecfa-e1ab-43f4-f47bcde5b274%40musicplace.com 
<https://groups.google.com/d/msgid/django-users/0ff382b8-ecfa-e1ab-43f4-f47bcde5b274%40musicplace.com?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/735d3169-5d8f-dfb7-84cf-ba87a490573d%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 data and presentation. 
They've obviously made some exceptions for the really common/easy use 
cases - like "|add"


There are other template languages that do support that of course; if 
its important enough you could look at changing the template engine...





On 07/18/2017 07:21 PM, sum abiut wrote:

Hi,
needed direction maths filters on django templates. for example how to 
you perform this on a template.


a*b +b*c

i did  a|mul:b|add:b|mul:cbut got a wrong answer. Please point 
me to right direction.


cheers,
--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y648sfPwKJWLmRtcx6tfC_PZP6RP6PjUvCmzRKVfOH%3DSg%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ff382b8-ecfa-e1ab-43f4-f47bcde5b274%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 absolute beginner  at Django. I started to learn 
django from https://www.djangoproject.com but it's too confusing.

I know python completely.
My question is:Should i know anything else except python to learn 
Django?because i don't understand Django at all.Or i should try harder?

--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1d33e1c7-42fb-414d-b8d7-b6441a6d0cfc%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41a2f397-6250-29c3-cae8-00ef47e508d3%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 design for a Teacher-Subject-Classroom case?
For example, a teacher could teach multiple sujbects at multiple 
classes. How can I keep track of every teacher teaching which subjects 
at which classroom?
Because a teacher can teach 2 different subjects at the same class for 
example? I'm asking for a class model.


Thank you!
--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e404ffb-7355-4bab-b7eb-93792f956379%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3c9ef39-dc00-0b79-29a4-acfc1ba8cc34%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 for some things - than Oracle). It requires 
installation, setup & some administration, unlike some of the other 
options, but if you want scalability, reliability, flexibile (and the 
"fancy" stuff like replication, "atomicity", "integrity", hot/cold 
failover, etc) then you have no other viable choice unless there's a  
huge budget involved (for Oracle).



On 07/10/2017 09:05 AM, DEIBER ANDRES RINCON ROJAS wrote:
Hi to everybody, I'm developing an web application using Python and 
Django and it requires storage of excel data, data volume high and 
still I don't have a clear idea about what database manager implement, 
Could anyone help me with some suggestions please?. Thanks for your time

--
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 this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8ce9f080-8a74-4960-887b-e8c42d4f9de7%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2bae4ca6-40a5-0822-491d-cbcba9c33cae%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.


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 08:56 AM, Guido Winkelmann - Hornetsecurity wrote:

Hi,

How can I create a table with a fixed-length binary field with a unique
constraint?

I need to save a SHA-256 checksum as a part of my objects, and I need to make
sure I never have two or more objects with the same checksum in the database.
Also, I need to be able to look up objects by that checksum.

I have tried defining the model like this:

class Certificate(models.Model):
 ...
 fingerprint_sha256 = models.BinaryField(max_length=32)
 class Meta:
 db_table="certificates"
 ...

Problems with this:

- BinaryField does not seem to support a length parameter, just max_length.

- When I make a migration with that model and apply it to a MySQL database,
the resulting field will be of type "longblob" instead of the "binary(32)" I
was going for.

- MySQL cannot create a unique constraint on a binary field without a length
constraint (or a length constraint over 255). If I add a unique=True parameter
to that field, migrating that change to a MySQL database will fail.

I can just manually connect to the MySQL server on the command line and change
the field to what I want, and in fact the Django app will work fine like that,
however I have a feeling that this undermines Django's database migration
concept and may lead to unforeseen problems in the future. (Also, I don't want
to unnecessarily complicate the install process for the app beyond what is
normal for a Django app.)

I could save the checksum as an ASCII representation in a CharField instead,
however this would more than double storage requirements for the field
(possibly even quadruple when using UTF-8 charset). This table is going to be
very large and very busy in production, and I'm afraid that any increase in
row size is going to be detrimental to performance.

Does anyone have a good idea how to solve this problem?

Regards,

 Guido



--
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86678ca5-ad36-c3d7-3ba6-54a73e34bdf4%40musicplace.com.
For more options, visit https://groups.google.com/d/optout.