Re: Authenticate users with both username and email

2015-01-15 Thread Matt Cooper
Your if block in views.py is not well-formed. I haven't tested this but I'd write it more like this: # try username user = auth.authenticate(username=username, password=password) if user is not None: auth.login(request, user) return HttpResponseRedirect('/') # fall

Re: Desired: Field behavior like AutoField + unique_with

2015-01-14 Thread Matt Cooper
s automagically, so your call would look like > something like: > > Tenant.sequence.get_value(tenant, sequence) > > > On Tue, 13 Jan 2015 06:37:21 -0800 (PST) > Matt Cooper > wrote: > > > Thanks Jani, good to hear someone has gone down this road before. > >

Re: Desired: Field behavior like AutoField + unique_with

2015-01-13 Thread Matt Cooper
ence_value=tenant.sequence_value) > widget.save() > > That should do the trick. Another option could be using table triggers to > automate > that within a database table trigger(s). > > On Mon, 12 Jan 2015 21:26:54 -0800 (PST) > Matt Cooper > wrote: > >

Desired: Field behavior like AutoField + unique_with

2015-01-13 Thread Matt Cooper
I'm building a multi-tenant application with a data model that simplifies to: class Tenant(models.Model): name = models.CharField(max_length=50) class Widget(models.Model): owner = models.ForeignKey(Tenant) sequence_id = I want Widget.sequence_id to work like an AutoField (that is

Xeround DB engine compatability

2012-07-18 Thread Matt Cooper
Hi all I'm looking at using Xeround as a DB backend. I've already come up against that as it detects a version > 5.0.3 it tries to use savepoints which are not supported. http://stackoverflow.com/questions/10193449/how-to-use-django-1-4-with-xeround Happy to carry on and try all the features b