Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-04-01 Thread Zach Borboa
-1 on less strict validation. Saying we need less strict validation because 
emails are usually confirmed by sending an email to it, is akin to saying 
urls are only valid if the url can be fetched. "Looks vaguely like a url" 
would not be enough for validation purposes. I believe we should strive to 
keep a reasonably strict and correct email validator.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0e26ba75-4554-4d28-9865-9a1d9a176c9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Support `manage.py shell -c 'run_code_as_django()'`?

2016-01-12 Thread Zach Borboa


Nice to see that this was implemented.


$ cat myscript.py
import django
print(django.__version__)

$ python manage.py shell --command="import myscript"
1.10.dev2016011210



The --command option lets you pass a command as a string to execute it as 
Django, like so:

django-admin shell --command="import django; print(django.__version__)"


https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-option---command

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e585499f-90b7-4a55-ba61-3c59130310b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Support `manage.py shell -c 'run_code_as_django()'`?

2015-11-09 Thread Zach Borboa
I've used

cat script.py | python manage.py shell

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ce1f31f6-1f66-4d81-9231-a3d975a6aeb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: automated import sorting and better pull request checks

2015-01-29 Thread Zach Borboa
Hi Tim,

I've always found pylint  a pleasure to work with. 
It may be worth looking into if we want additional automated testing.

Pylint has great set of code checks (unused variable, unused import, 
trailing whitespace, bad indentation, etc.) and can integrate with Jenkins.

https://bitbucket.org/logilab/pylint/src/default/checkers/variables.py#cl-191
https://bitbucket.org/logilab/pylint/src/default/checkers/format.py#cl-65

Thanks,
Zach

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/242c05dc-8140-436d-a8bd-c6449680c72e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Explicit relative imports

2014-11-12 Thread Zach Borboa
Aymeric, is this the example?

from .config import AppConfig # NOQAfrom .registry import apps # NOQA

from https://github.com/django/django/blob/master/django/apps/__init__.py

On Tuesday, November 11, 2014 1:51:19 PM UTC-8, Aymeric Augustin wrote:
>
> Hello, 
>
> We’ve started using explicit relative imports in newer parts of the Django 
> source tree. They’re short and readable. That’s good. 
>
> I would like to add guidelines about imports in the coding style guide in 
> order to improve consistency. 
>
> My inclination would be to recommend relative imports within “components” 
> but avoid them between “components”, where a component is: 
>
> - a well-defined sub-framework (django.core.cache, django.db, 
> django.forms, django.template, etc.) 
> - a contrib app 
> - an app in the tests/ directory 
> - etc. 
>
> I would discourage going back into parent modules with relative imports 
> because statements such as `from ...spam import eggs` are hard to parse. 
>
> You can see an example of this style in django.apps which has only three 
> files. 
>
> What do you think? 
>
> -- 
> Aymeric. 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/70789fea-6417-4374-89ce-e53e67f910d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: proposing max line length of 119 + enforcing it with flake8

2014-09-04 Thread Zach Borboa


Screenshot for comparison.



-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0f96a448-1b4a-4df4-bc4d-33d619545241%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: proposing max line length of 119 + enforcing it with flake8

2014-09-04 Thread Zach Borboa
Looks like the line length limit on Github varies[1]. Can we use 120 as 
it's a nice round number?

[1] 
http://stackoverflow.com/questions/22207920/what-is-githubs-character-limit-or-line-length-for-viewing-files-on-github

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/810f9a4b-7b10-46de-b4c3-c8fa9597e066%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [GSOC] Introduction and task proposal

2014-03-18 Thread Zach Borboa


2) Security implications. Unfortunately, more than one site has been 
> launched with debug=True accidentally left on; all you need to do then is 
> stimulate a server error, and you have REPL shell access to the server. 
> This strikes me as a remarkably effective foot-gun :-) Before you get too 
> involved in the implementation, I'd want to know the security issues have 
> been locked down.
>

Curious, how do you get REPL shell access to the server with DEBUG=True 
with a vanilla Django deployment?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/363c7b06-5a62-453d-9253-68bcb24b4398%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: allow list_display in admin to traverse onetoonfields and foreign key relations

2014-02-25 Thread Zach Borboa
I agree that the current behaviour is confusing and needs change in order 
to be DRY[1] and consistent[2].

[1] 
https://docs.djangoproject.com/en/dev/misc/design-philosophies/#don-t-repeat-yourself-dry
[2] https://docs.djangoproject.com/en/dev/misc/design-philosophies/#consistency



This is how I currently work around this issue.

models.py
class Question(models.Model):
text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

admin.py
class ChoiceAdmin(admin.ModelAdmin):
def question__text(self, obj):
return obj.question.text

list_display = ('pk', 'question__text', 'choice_text', 'votes')

admin.site.register(Choice, ChoiceAdmin)






On Tuesday, February 25, 2014 3:48:40 PM UTC-8, Wim Feijen wrote:
>
> Hello,
>
> Right now I have a School model containing a OneToOne-relation to User.
>
> In the admin, in search_fields, I can use double underscores to search in 
> related fields, for example:
> search_fields = ('place__name', 'school__name')
>
> But in list_display, I can't. For example,
> list_display = ['school', 'school__user', 'place', ]
> gives an error.
>
> I find this totally confusing. More people do.
>
> A ticket has been made six years ago and was eventually closed as won't 
> fix. Currently, the proposed solution is to write a custom method or 
> callable. I'd like to raise a discussion to reopen that ticket.
>
> For reference, see:
> https://code.djangoproject.com/ticket/5863
> https://groups.google.com/forum/#!topic/django-developers/eQSEv74bQh8
>
> My arguments to allow such a syntax are:
>
> 1. allowing 'school__user' in list_display is consistent with the 
> behaviour of search_fields, list_filter in the admin, and get() and 
> filter() query syntax in general.
> 2. it saves many people duplicating two to four lines of custom code, and 
> in my opinion, allows for a more concise yet extremely easy to understand 
> notation.
> 3. ideally, a solution would use select_related in order to save database 
> queries and thus be longer than two to four lines of code.
> 4. the need is common, and in onetoonefields specifically. Many people 
> have expressed their interest in this feature, and a core developer 
> initially accepted it.
> 5. a long time has passed since then and our policy of accepting tickets 
> has changed.
>
> Thanks for reading! I'd love to hear your response.
>
> Regards, Wim
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/764cf67d-2107-4bdd-88bd-004a043a162f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: The unsettings project

2014-02-10 Thread Zach Borboa
Diff https://github.com/SlashRoot/django/compare/django:master...master

On Monday, February 10, 2014 6:59:41 PM UTC-8, Russell Keith-Magee wrote:
>
>
> On Tue, Feb 11, 2014 at 10:27 AM, James Farrington 
> 
> > wrote:
>
>> Hello everyone,
>>
>> Here are some thoughts on the unsettings issue. If you haven't heard 
>> about unsettings, it is an attempt to move away from using the settings 
>> global. There was a discussion at djangocon (which I wasn't there for, but 
>> I was told about it) which led to some of my colleagues and I working on it.
>>
>> Our github repository:
>> https://github.com/SlashRoot/django
>>
>> Hi James,
>
> You might get a better response to your message if you give a 1000 ft 
> description of the approach you're taking. You won't get much disagreement 
> that the global settings object is bad, but that doesn't mean that any 
> arbitrary solution is better. 
>  
> I'm sure I could probably work out your approach if I worked through a 
> diff of your repository against master, but a high level explanation of 
> what I'm likely to find when I get there would be very helpful (and would 
> help me work out if it's worth the time to actually *do* a full analysis of 
> the repository against master).
>
> Yours,
> Russ Magee %-)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c96e5e68-9ff1-4c78-b20e-bacf6915b3c2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: When to use single quotes and double quotes

2013-10-28 Thread Zach Borboa


> Here's an example from the django source where we are using double quotes 
> in python instead of single quotes. The following code prints out html 
> using single quotes instead of the double quotes regularly seen in html.
>
> return format_html(" value='{0}' />", csrf_token)
>
> instead of:
>
> return format_html(' value="{0}" />', csrf_token)
>


This message inadvertently got deleted. If it was supposed to be removed. 
My apologies; feel free to again remove it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ca45bbf4-5167-4f6b-ad3b-517957e10ced%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: When to use single quotes and double quotes

2013-10-28 Thread Zach Borboa
Here's an example from the django source where we are using double quotes 
in python instead of single quotes. The following code prints out html 
using single quotes instead of the double quotes regularly seen in html.

return format_html("", csrf_token)

instead of:

return format_html('', csrf_token)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1d134caf-4488-449a-a8db-e650412bf7ff%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: When to use single quotes and double quotes

2013-10-27 Thread Zach Borboa
I believe we should prefer one over the other. That being said, legibility, 
consistency, and context should be taken into account.


Should our documentation examples prefer one rather over the other? 
>
> Daniele 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/81927ea2-a745-420f-8ef4-42f0b82e807b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


When to use single quotes and double quotes

2013-10-27 Thread Zach Borboa
I'm seeing a mix of both singly- and doubly-quoted strings in django source.
Other than docstrings wrapped in triple-double-quotes, when is it 
appropriate
to use double quotes instead single quotes?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20b5a876-f720-46d0-bf6f-127671eeb7df%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Proposal: Django URL Admin (django-urls)

2012-12-16 Thread Zach Borboa
> 1) Being able to create redirects (which seems to already be on the
> todo-list)

Creating temporary 302 redirects are currently possibly right now. The
TODO is for being able to specify both 301 and 302 redirects through
the admin.


> 2) Being able to specify extra kwargs to pass to a view so that it would be
> possible to change the functionality of a view without adding a new model to
> store the different options (or have to change the urlconfig and push new
> code every time).

You can still specify additional urls in urls.py as the framework
allows you to do normally; django-urls simply appends to that list of
urls. There is also a TODO for adding the ability to edit views
through the Django admin using the same editor GitHub uses. These
should cover the use cases you describe.


On Sat, Dec 15, 2012 at 11:52 PM, Sam Solomon  wrote:
> Yeah, I agree, as it is, I can't see any reason why I would use it, but I
> could see it being useful with some modifications such as:
>
> 1) Being able to create redirects (which seems to already be on the
> todo-list)
> 2) Being able to specify extra kwargs to pass to a view so that it would be
> possible to change the functionality of a view without adding a new model to
> store the different options (or have to change the urlconfig and push new
> code every time).
>
> Until those things are implemented (which allow for things that could
> probably be implemented in more straightforward/non-dev-user friendly ways),
> it seems like a bad idea to store infrastructure in the database (I can only
> see it causing problems when you have developers working from a different
> urlconf than the production server is using).
>
>
> On Friday, December 14, 2012 11:31:34 PM UTC-6, Amirouche B. wrote:
>>
>>
>>
>> On Friday, December 7, 2012 9:07:32 PM UTC+1, Zach Borboa wrote:
>>>
>>> Does something like this exist already? If not, it should.
>>
>>
>> How this can be useful ? You still need to write the view in Python then
>> why not write the urls in Python too, like it's currently the way to go.
>>
>> If something in this spirit might be useful is something where the view
>> could be generated which would be something like databrowser or admin.
>>
>> Could you elaborate ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Proposal: Django URL Admin (django-urls)

2012-12-13 Thread Zach Borboa
For those of you following, development of django-urls has moved to github. 
Thanks
https://github.com/django-urls/django-urls

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/PgzuqD1OMzcJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Proposal: Django URL Admin (django-urls)

2012-12-07 Thread Zach Borboa
Hi Florian,

Thank you for the response. This was just an idea and I'm glad you
welcome it. I will work on a patch and my convincing techniques.

Would something like this be better as an application (e.g.
django-urls) or part of the core?

Regards,
Zach

On Fri, Dec 7, 2012 at 1:45 PM, Florian Apolloner  wrote:
> Hi Zach,
>
>
> On Friday, December 7, 2012 9:07:32 PM UTC+1, Zach Borboa wrote:
>>
>> Does something like this exist already? If not, it should.
>
>
> I am wondering what you are trying to achieve with this post. If you only
> want to know if something like this exists you should ask in django-users,
> this mailing list is to discuss the development of Django itself.
>
> If you are suggesting that we should implement it if it doesn't exist
> already, I would ask you to reread your email again and think about how it
> might sound to others or how it's perceived by others. Don't get me wrong,
> ideas are always good but there are differences in the ways of how ideas are
> presented -- especially if you want this feature you'd need to convince us
> why we would need something like this and your initial posting does a pretty
> bad job in achieving this goal. Also, if it "should" exist according to your
> opinion feel free to provide patches :)
>
> Best regards,
> Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.