graphite delete data not in whisper

2016-05-19 Thread Dawei Zhang
I am using a graphite weewx, an extension to upload data from weather 
stations; and I need to delete some of it. However, the folders are not in 
the /opt/graphite/storage/whisper/

Where else can I search to delete data/folder from graphite server?

-- 
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/19c0940e-1ba5-40b1-a1b3-e0ec8e7269e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


is there any django app for opendata

2016-05-19 Thread Luis Zárate
Hi,

I interested in opendata and open government so I am looking for tools to
build a platform for a local government.

I really like django, I like to build system with it so I want to implement
something useful that help to create and transparent and eficient for free

Do you have some recommendation ?

Thanks


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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/CAG%2B5VyPWH5ap%2BhVRb3C%3Dhtvh406it7ngCROCdzpV87yh0fioMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


get all columns as a list

2016-05-19 Thread Larry Martell
This is probably very simple, but I just can't figure out how to do it.

I want to get all the columns in some rows as a list. I know I could
use values_list and flat=True and list all the columns, but is that
the only way?

I want to do something like this:

rows = FOO.objects.filter(bar='baz')

and get a list of lists instead a list of FOO objects.

-- 
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/CACwCsY7EZtbmLqLgggZnnBspKbvOucPDki1i28zD3jtjGp%3DWFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Double free or Corruption error when using GeoDjango

2016-05-19 Thread Erik Cederstrand

> Den 19. maj 2016 kl. 22.17 skrev Tapan Pandita :
> 
> I am running django 1.9.4 on gunicorn19.4.5 with the gevent worker 
> (gevent==1.0.2, greenlet==0.4.9). My app is deployed on heroku. For some 
> requests, I have noticed this error: "*** Error in 
> `/app/.heroku/python/bin/python': double free or corruption (out): 
> 0x0403bc90 ***". I can't reproduce it deterministically, but it 
> happen in about 5% of all requests. I was able to get the stack trace for it 
> and everytime it's the same:
> 
> May 19 13:50:35  app/web.2:File 
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py",
>  line 125, in __del__.
> May 19 13:50:35  app/web.2:  capi.destroy_geom(self._ptr).
> May 19 13:50:35  app/web.2:File 
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py",
>  line 157, in __call__.
> May 19 13:50:35  app/web.2:  return self.func(*args, **kwargs).
> May 19 13:50:35  app/web.2:File 
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py",
>  line 52, in __call__.
> May 19 13:50:35  app/web.2:  if not self.thread_context.handle:.
> May 19 13:50:35  app/web.2:File 
> "/app/.heroku/python/lib/python2.7/site-packages/gevent/local.py", line 173, 
> in __getattribute__.
> May 19 13:50:35  app/web.2:  d = object.__getattribute__(self, 
> '_local__dicts').get(getcurrent()).
> May 19 13:50:35  app/web.2:  *** Error in 
> `/app/.heroku/python/bin/python': double free or corruption (out): 
> 0x03dd6470 ***

This is bad. The python binary itself is crashing with a memory violation in 
C/C++ code in either Python or an external module (e.g. gevent). Unfortunately, 
your stack trace leaves no further hints about the source of the problem.

Normally, you would compile Python and any external C modules with debugging 
symbols and attach a debugger. I don't know Heroku very well, but your options 
are probably limited. Your best bet is probably to find a reproducible test 
case and contact their support team.

Erik

-- 
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/92EC4AAF-B11F-4215-80E3-0221875A654F%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Double free or Corruption error when using GeoDjango

2016-05-19 Thread Tapan Pandita
I am running django 1.9.4 on gunicorn19.4.5 with the gevent worker 
(gevent==1.0.2, greenlet==0.4.9). My app is deployed on heroku. For some 
requests, I have noticed this error: "*** Error in 
`/app/.heroku/python/bin/python': double free or corruption (out): 
0x0403bc90 ***". I can't reproduce it deterministically, but it 
happen in about 5% of all requests. I was able to get the stack trace for 
it and everytime it's the same:

May 19 13:50:35  app/web.2:File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py",
 
line 125, in __del__.
May 19 13:50:35  app/web.2:  capi.destroy_geom(self._ptr).
May 19 13:50:35  app/web.2:File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py",
 
line 157, in __call__.
May 19 13:50:35  app/web.2:  return self.func(*args, 
**kwargs).
May 19 13:50:35  app/web.2:File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py",
 
line 52, in __call__.
May 19 13:50:35  app/web.2:  if not 
self.thread_context.handle:.
May 19 13:50:35  app/web.2:File 
"/app/.heroku/python/lib/python2.7/site-packages/gevent/local.py", line 
173, in __getattribute__.
May 19 13:50:35  app/web.2:  d = 
object.__getattribute__(self, '_local__dicts').get(getcurrent()).
May 19 13:50:35  app/web.2:  *** Error in 
`/app/.heroku/python/bin/python': double free or corruption (out): 
0x03dd6470 ***

Can someone tell me what's going on? How can I fix this?

Thanks for any and all help,
Tapan

-- 
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/e27475c0-4ee5-454c-a519-2f0961a2b240%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


selectively remove forms from formset in view function

2016-05-19 Thread Richard Brockie
Hi,

I'm working with pagination of a large formset in my view function. For 
forms outside the range to be viewed, I'm currently doing this:

for form in results_formset:
place_to_test = int(form['placing'].value())

if place_to_test not in visible_range:
form.fields['race_number'].widget = HiddenInput()


visible_range is a list of places that should be viewed according to the 
pagination.

However, most of the formset is hidden. Simply using a HiddenInput() 
results in a large number of non-visible forms still being sent from the 
server. I have a scheme where I will condense the hidden information from 
the non-visible forms to save bandwidth. To do this within the current code 
structure requires me to be able to remove a non-visible form from the 
formset.

My code should become something like:

for form in results_formset:

place_to_test = int(form['placing'].value())
race_number = form['race_number'].value()

if place_to_test not in visible_range:

# need method to remove form from results_formset
pass

# condensing the information to save bandwidth
if place_to_test < range_min:
hidden_before.append("%s:%s" % (place_to_test, race_number))
elif place_to_test > range_max:
hidden_after.append("%s:%s" % (place_to_test, race_number))


I can't find how to remove the non-visible form from the formset - can 
anyone provide a pointer?

Best wishes,
Richard Brockie

-- 
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/a420ec56-079f-46c0-a5f0-843e33d56b3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sub accounts in django

2016-05-19 Thread Ben Lopatin
This is the scenario I wrote django-organizations to handle 
(http://django-organizations.readthedocs.io/en/latest/).

On Wednesday, May 18, 2016 at 12:04:02 PM UTC-4, Mehdy M. Haghy wrote:
>
> Creating sub accounts is a pretty common scenario.
> you have clients like (copmany1, company2, ..., company N) 
> and they have their own users, roles and permissions. 
> any recommendation on how to implement this or any package recommendation?
>

-- 
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/99bb0e40-808e-487a-9482-c9b0477a5cca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sub accounts in django

2016-05-19 Thread Christian Ledermann
http://www.two-legs.com/2011/08/creating-a-dynamic-multisite-using-django/

On 19 May 2016 at 14:20, Christian Ledermann
 wrote:
> https://docs.djangoproject.com/en/1.9/ref/contrib/sites/
>
> On 19 May 2016 at 14:02, M Hashmi  wrote:
>> Can you explain one of those approaches or provide a web reference with
>> complete A to Z implementaiton?
>>
>> On Thursday, May 19, 2016 at 2:19:04 AM UTC-7, Javier Guerra wrote:
>>>
>>> On 18 May 2016 at 17:02, Mehdy M. Haghy  wrote:
>>> > Creating sub accounts is a pretty common scenario.
>>> > you have clients like (copmany1, company2, ..., company N)
>>> > and they have their own users, roles and permissions.
>>> > any recommendation on how to implement this or any package
>>> > recommendation?
>>>
>>> that's commonly known as "multitenant" applications.  there are
>>> several approaches to do it, and quite a few packages to help with
>>> either.
>>>
>>>
>>>
>>> --
>>> Javier
>>
>> --
>> 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/6be76ebf-0d6b-4d53-97d3-3bf8a0c3cdb4%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Best Regards,
>
> Christian Ledermann
>
> Newark-on-Trent - UK
> Mobile : +44 7474997517
>
> https://uk.linkedin.com/in/christianledermann
> https://github.com/cleder/
>
>
> <*)))>{
>
> If you save the living environment, the biodiversity that we have left,
> you will also automatically save the physical environment, too. But If
> you only save the physical environment, you will ultimately lose both.
>
> 1) Don’t drive species to extinction
>
> 2) Don’t destroy a habitat that species rely on.
>
> 3) Don’t change the climate in ways that will result in the above.
>
> }<(((*>



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWorRn%2Bc7SnjErPdc%2BX9XDtSXYZ%3DZOo87Oz%2B8h7bFxofsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: sub accounts in django

2016-05-19 Thread Christian Ledermann
https://docs.djangoproject.com/en/1.9/ref/contrib/sites/

On 19 May 2016 at 14:02, M Hashmi  wrote:
> Can you explain one of those approaches or provide a web reference with
> complete A to Z implementaiton?
>
> On Thursday, May 19, 2016 at 2:19:04 AM UTC-7, Javier Guerra wrote:
>>
>> On 18 May 2016 at 17:02, Mehdy M. Haghy  wrote:
>> > Creating sub accounts is a pretty common scenario.
>> > you have clients like (copmany1, company2, ..., company N)
>> > and they have their own users, roles and permissions.
>> > any recommendation on how to implement this or any package
>> > recommendation?
>>
>> that's commonly known as "multitenant" applications.  there are
>> several approaches to do it, and quite a few packages to help with
>> either.
>>
>>
>>
>> --
>> Javier
>
> --
> 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/6be76ebf-0d6b-4d53-97d3-3bf8a0c3cdb4%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWpMcAi%3DEeSHP%3DB%3DGK8NpeHvMVsZeAsVOUtsG2Osc_kOmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: sub accounts in django

2016-05-19 Thread M Hashmi
Can you explain one of those approaches or provide a web reference with 
complete A to Z implementaiton?

On Thursday, May 19, 2016 at 2:19:04 AM UTC-7, Javier Guerra wrote:
>
> On 18 May 2016 at 17:02, Mehdy M. Haghy  
> wrote: 
> > Creating sub accounts is a pretty common scenario. 
> > you have clients like (copmany1, company2, ..., company N) 
> > and they have their own users, roles and permissions. 
> > any recommendation on how to implement this or any package 
> recommendation? 
>
> that's commonly known as "multitenant" applications.  there are 
> several approaches to do it, and quite a few packages to help with 
> either. 
>
>
>
> -- 
> Javier 
>

-- 
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/6be76ebf-0d6b-4d53-97d3-3bf8a0c3cdb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sub accounts in django

2016-05-19 Thread Javier Guerra Giraldez
On 18 May 2016 at 17:02, Mehdy M. Haghy  wrote:
> Creating sub accounts is a pretty common scenario.
> you have clients like (copmany1, company2, ..., company N)
> and they have their own users, roles and permissions.
> any recommendation on how to implement this or any package recommendation?

that's commonly known as "multitenant" applications.  there are
several approaches to do it, and quite a few packages to help with
either.



-- 
Javier

-- 
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/CAFkDaoR16k5PuPzT6bf178%2BKRnjsvsDinDUk7vnRRzrMPvaU5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


elasticsearch for django with haystack

2016-05-19 Thread M Hashmi
My code is similar to like this if not exactly like in the link provided. 
But I am not able to search products added via products models.

The link is 
http://stackoverflow.com/questions/37314696/djanog-elasticsearch-implementation-issue?noredirect=1#comment62151898_37314696.

In this link user has explained every aspect of detail and I guess we both 
are following the same set of examples.

Please advise.

Regards,
Mudassar

-- 
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/928b7c39-015e-4fbd-a360-50c74d469f71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Password Validation

2016-05-19 Thread James Schneider
>

> Thanks for the Suggestion.
> James, in the option that you provided makes the User change the Password
of the Logged in user which might turn out to be a costly operation.

Not entirely sure what you mean?

If you make the username available to the ModelForm class (either as a
field value or a raw value passed in during the ModelForm initialization),
then you simply run authenticate() as part of your validation process.

Validating within the view ensures that request.user is already available
for testing (assuming default middleware).

The only time that an extra query would be incurred is if you needed to
pull the user object based on the ID in order to grab the username. I
wouldn't consider 1 indexed query as 'costly', especially for an operation
that would executed relatively infrequently compared to the load generated
by the rest of the site (obviously the frequency is dependent on your site
traffic levels).

I'd implement the easiest way for now and evaluate the whole process if you
determine it is a source of stress for your DB, which is unlikely in the
short and medium term.

-James

-- 
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%2Be%2BciXwit1fK8yJdFagBnd6JJ6nohoVnnw2KDKbbk3DjY-H_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regular Expression with Variables.

2016-05-19 Thread Arun S

Yes, This works exactly how i intended to. 

The Validator Raises error when it does'nt match now.
And i did eliminate the .*$ which dint make much of a difference.

Thanks for the help.

Cheers
Arun.

On Thursday, May 19, 2016 at 12:35:42 PM UTC+5:30, Stephen Butler wrote:
>
> You can't provide multiple regex's to the RegexField. What you were doing 
> before is exactly equivalent to this:
>
> r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=]).*$'
>
> So for my suggestion, just do this:
>
>
> regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=]).*$'
>
> But the "^.*" and the ".*$" are not needed since RegexField uses 
> RegexValidator, which uses re.search().
>
> On Thu, May 19, 2016 at 1:53 AM, Arun S  
> wrote:
>
>> I Did try this, i think i am not doing it right:
>> Could you tell what is that i am doing is wrong.
>> I am now not able to provide multiple Regex in the forms.RegexField using 
>> the above method.
>>
>>
>>  
>> regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>>  old_password = forms.RegexField(
>>   label='Old Password',
>>   widget=ShowPasswordWidget(),
>>   
>> *regex = regex_f.format(MIN=settings.PASSWORD_MIN_LEN, 
>> MAX=settings.PASSWORD_MAX_LEN)   r'.*$',*
>>   error_messages={'invalid' : 'Password must contain at least 8 
>> characters'
>>   ' with one upper case letter, one lower case letter,'
>>   ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})
>>  
>> Previously i was using this as:
>> -
>>old_password = forms.RegexField(
>> label='Old Password',
>> widget=ShowPasswordWidget(),
>>  
>>
>> *   
>> regex=r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>>r'.*$', *error_messages={'invalid' : 'Password 
>> must contain at least 8 characters'
>>  ' with one upper case letter, one lower case letter,'
>>  ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})
>>
>> On Thursday, May 19, 2016 at 11:26:58 AM UTC+5:30, Stephen Butler wrote:
>>>
>>> I think I'd just use format() on the regex, being careful to escape '{' 
>>> and '}':
>>>
>>> regex_f=r'^.*(?=.*{{{MIN},{MAX}}}*)(?=.*\d)(?
>>> =.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>>> regex=regex_f.format(MIN=settings.MY_RE_MIN, MAX=settings.MY_RE_MAX)
>>>
>>>
>>> On Thu, May 19, 2016 at 12:37 AM, Arun S  wrote:
>>>
 Hi,

 I have a Regular Expression something like this:
 regex=r'^.*(?=.*{8,}*
 )(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
r'.*$',

 In this, i would like to read the values from the Django Setting file 
 on the Max and Min Length and provide them as my input instead of Hard 
 Coding.

 How can a Variable be provided/escaped in a regex.
 Can some one throw some light on this ?

 Cheers
 Arun


 -- 
 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...@googlegroups.com.
 To post to this group, send email to django...@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/90556052-063e-4307-b095-c37a9920399b%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...@googlegroups.com .
>> To post to this group, send email to django...@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/2f010f88-0824-4f92-91c6-ccf9333d7dab%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 

Re: Regular Expression with Variables.

2016-05-19 Thread Stephen J. Butler
You can't provide multiple regex's to the RegexField. What you were doing
before is exactly equivalent to this:

r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=]).*$'

So for my suggestion, just do this:

regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=]).*$'

But the "^.*" and the ".*$" are not needed since RegexField uses
RegexValidator, which uses re.search().

On Thu, May 19, 2016 at 1:53 AM, Arun S  wrote:

> I Did try this, i think i am not doing it right:
> Could you tell what is that i am doing is wrong.
> I am now not able to provide multiple Regex in the forms.RegexField using
> the above method.
>
>
>
> regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>  old_password = forms.RegexField(
>   label='Old Password',
>   widget=ShowPasswordWidget(),
>
> *regex = regex_f.format(MIN=settings.PASSWORD_MIN_LEN,
> MAX=settings.PASSWORD_MAX_LEN)   r'.*$',*
>   error_messages={'invalid' : 'Password must contain at least 8
> characters'
>   ' with one upper case letter, one lower case letter,'
>   ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})
>
> Previously i was using this as:
> -
>old_password = forms.RegexField(
> label='Old Password',
> widget=ShowPasswordWidget(),
>
>
> *
> regex=r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>r'.*$', *error_messages={'invalid' : 'Password
> must contain at least 8 characters'
>  ' with one upper case letter, one lower case letter,'
>  ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})
>
> On Thursday, May 19, 2016 at 11:26:58 AM UTC+5:30, Stephen Butler wrote:
>>
>> I think I'd just use format() on the regex, being careful to escape '{'
>> and '}':
>>
>> regex_f=r'^.*(?=.*{{{MIN},{MAX}}}*)(?=.*\d)(?
>> =.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>> regex=regex_f.format(MIN=settings.MY_RE_MIN, MAX=settings.MY_RE_MAX)
>>
>>
>> On Thu, May 19, 2016 at 12:37 AM, Arun S  wrote:
>>
>>> Hi,
>>>
>>> I have a Regular Expression something like this:
>>> regex=r'^.*(?=.*{8,}*
>>> )(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>>>r'.*$',
>>>
>>> In this, i would like to read the values from the Django Setting file on
>>> the Max and Min Length and provide them as my input instead of Hard Coding.
>>>
>>> How can a Variable be provided/escaped in a regex.
>>> Can some one throw some light on this ?
>>>
>>> Cheers
>>> Arun
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/90556052-063e-4307-b095-c37a9920399b%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/2f010f88-0824-4f92-91c6-ccf9333d7dab%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/CAD4ANxUBwYu-fKVyDJARLaAqvy4PiXwV6x20owO2VQATfOxrSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Create account that can either be a person or a group

2016-05-19 Thread Karl Arunachal
I want to create user accounts for my website. The account can be either a
person or a group. So for *person* account I want to get different
information from them (such as First name, Last Name, ...), and for *group*
account get different information (such as Group name, ...). Basically
different form for *person* account and *group* account. The account itself
will have a unique primary key ( such as username/account id).

How should I do it? Should I make one to one relationship with account and
person, and the same with account and group? Or create just on Account
model and place a choice field to choose between Person and Group? Or how
do you prefer I should do it?


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/CAPXAsR1nYd8-hF88HSRgS8Zm8iDktxxcZ84u8wXfyrw7mU3tQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regular Expression with Variables.

2016-05-19 Thread Arun S
I Did try this, i think i am not doing it right:
Could you tell what is that i am doing is wrong.
I am now not able to provide multiple Regex in the forms.RegexField using 
the above method.


 
regex_f=r'^.*(?=.{{{MIN},{MAX}}})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
 old_password = forms.RegexField(
  label='Old Password',
  widget=ShowPasswordWidget(),
  
*regex = regex_f.format(MIN=settings.PASSWORD_MIN_LEN, 
MAX=settings.PASSWORD_MAX_LEN)   r'.*$',*
  error_messages={'invalid' : 'Password must contain at least 8 
characters'
  ' with one upper case letter, one lower case letter,'
  ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})
 
Previously i was using this as:
-
   old_password = forms.RegexField(
label='Old Password',
widget=ShowPasswordWidget(),
 

*   
regex=r'^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
   r'.*$', *error_messages={'invalid' : 'Password must 
contain at least 8 characters'
 ' with one upper case letter, one lower case letter,'
 ' one number (0-9) and one special character (!$%^&*?@#-_+=)'})

On Thursday, May 19, 2016 at 11:26:58 AM UTC+5:30, Stephen Butler wrote:
>
> I think I'd just use format() on the regex, being careful to escape '{' 
> and '}':
>
> regex_f=r'^.*(?=.*{{{MIN},{MAX}}}*)(?=.*\d)(?
> =.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
> regex=regex_f.format(MIN=settings.MY_RE_MIN, MAX=settings.MY_RE_MAX)
>
>
> On Thu, May 19, 2016 at 12:37 AM, Arun S  
> wrote:
>
>> Hi,
>>
>> I have a Regular Expression something like this:
>> regex=r'^.*(?=.*{8,}*
>> )(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!$%^&*?@#-_+=])'
>>r'.*$',
>>
>> In this, i would like to read the values from the Django Setting file on 
>> the Max and Min Length and provide them as my input instead of Hard Coding.
>>
>> How can a Variable be provided/escaped in a regex.
>> Can some one throw some light on this ?
>>
>> Cheers
>> Arun
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/90556052-063e-4307-b095-c37a9920399b%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/2f010f88-0824-4f92-91c6-ccf9333d7dab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.