Their API/role is very similar to the `forms` in standard Django. I agree with you that they handle too much stuff and that saving to the database has nothing to do in a serializer, just like it has nothing to do in a form. But I also think it's a very good choice to follow common Django practices, so that codebases stay somewhat consistent, and new users are able to understand the concepts very quickly.
Migrations are about data, not schema. You don't need migrations with a "schemaless" database at the beginning, but as soon as you have data you care about, you're gonna need to ensure some sort of consistency.
I think you should learn the relational model (not SQL). Understand the problems it was trying to solve and how the relational model solves them. Then figure out how that applies to your app. Database in Depth was helpful for me http://www.amazon.com/Database-Depth-Relational-Theory-Pract... .
Yes, you should move back to Postgres. The reason is you can do many more operations on structured data than on structure-less data. You found that out already with the many-to-many thing. There are plenty of other intangibles that will bite you in the ass later.
Did you take a look at the way gittip does this ? You basically donate to a twitter handle and its owner can 'claim' the account whenever they want. No money is actually transferred until the account is claimed. I don't know if it can be applied to artists/bands though.
I was also wondering: is there no transfer fees with paypal ? Don't they make small amounts transfer useless ?
And one last thing: is it not weird for bands/artists to suddenly receive money from people without being informed about the site and all that ?
'the way gittip does this': I naively assumed Gittip was sitting on the money until it was claimed, but charging the moment its claimed is probably better. I'll have to look into it!
'transfer fees with paypal': Yes and yes. I'm currently spending about 8-10 dollars a week divided over 5 artists. So the slice Paypal gets is significant but bearable. This of course isn't ideal and I've been thinking about other ways of doing this. Bitcoin maybe?
'receive money (...) without being informed': I've got this covered! When an artist receives money they also receive an email explaining why they receive it and how many times the listener played their songs.
I worked in the bitcoin space for a while (cofounded an exchange), and this was a proposal that often came up. so awesome to see someone actually building it. Could I convince you to send me an email: Jordanbirn at gmail.com ?
It would probably be possible to make the extension use the system's installation of python if available instead of the one embedded with Sublime, but that would require some coding.
I'm not convinced it's useful to pass the class name into the functional API, but I would see value in having an easy API to create enumerated strings. It's easier to see what's going on in other environments (e.g. in a datastore, or in JavaScript) if you pass around string identifiers instead of ints.
Here's the class I've been using to do that:
class Constants(object):
def __init__(self, names, enum = False):
self._names = frozenset(names)
if enum:
for (i, name) in enumerate(self._names):
setattr(self, name.upper(), i)
else:
for name in self._names:
setattr(self, name.upper(), name.lower())
self.frozen = True
def keys(self):
return [name.upper() for name in self._names]
def values(self):
return [getattr(self, name.upper()) for name in self._names]
def __setattr__(self, key, value):
if getattr(self, 'frozen', False):
raise Exception("Constants cannot be modified after instantiation")
else:
object.__setattr__(self, key, value)
There is a technical reason why the class name is passed into the API, and it's the same for other functions which create types (collections.namedtuple(), and type(), for example). You want to be able to print out the class name when you print an enum, but there is no other reliable way to figure out the class name. In Python, a class is just another value, like functions and integers and its name is nothing special. When you define a class normally, the name and dictionary get passed to the type() function.
I understand that, but I'm not sure it matter. Is it worth the ugliness in the API to print out the class name when you run print? Is 'api' that much worse than "ImportMethod.API"?
That's not all it's there for. Python programmers expect to be able to do things like print(obj.__class__.__name__). You're definitely free to write your own alternative Enum, however, since it's just a library function.
Nice! I just have one or two remarks about the UI: it is really annoying that when you click the text of an answer it closes it back, and the font is two small.
I've been using my Nexus 4 for one week now and I obviously love it. I think the feature that impressed me the most is the 'gesture typing', which compensates for my apparent inability to type correctly on a virtual keyboard. And it works surprisingly well in French too.
Love the gesture typing as well, it's really impressive how well it works. I've only been using it in english so far, and feel crippled as soon as I have to write a message in other languages.
Is there any way to quickly toggle between different languages?
If you have multiple languages enabled (as opposed to the default, system-language only), you can just point-hold the space-bar and a language selector will be opened.
You can also enable a language-cycling button which will appear left of the space-bar if you so please.
Not just Europe– I had a test unit from way back for when they were entering the US, though they never got really big (I do see them occasionally). In Japan I see them everywhere.
Well, it's rather like karma: "As a member of the Fon community, you agree to share a little bit of your WiFi at home, and get free roaming at Fon Spots worldwide in return."
Not exactly because you don't have the ratio idea where you have to share XXX MB with someone before having YYY MB for yourself.
In France Free is a well-known ISP offering this kind of feature with its ADSL box. You open your WI-FI to others and then you have access to every other WIFI shared by users from this ISP.