magpiebrain

Sam Newman's site, a Consultant at ThoughtWorks

Posts from the ‘Django’ category

Just a quick note after a long absence (no doubt a flood of posts will now follow, preceding another too long gap). Anyway, “London 2.0rc2(London 2.0rc1 on Upcoming.org)”:http://upcoming.org/event/47958/ is on for this Tuesday. Once again it’ll be combining the Python meetup, and will be open to all Ruby, Django, Rails, Python, RSS, Catalyst, web.py, TurboGears, Java, RDF and Struts enthusiasts, and interested observers. After missing the last two (which is bad form as an organiser) I’ll be making a concerted effort to put in a prolonged apperance.

If you’re coming, you could either signup on “Upcoming.org”:http://upcoming.org/event/47958/, or leave a comment here. As normal, it’s from 6pm til late at the “Old Bank of England(Upcoming’s entry for the Old Bank of England)”:http://upcoming.org/venue/16413.

*We need a snappier name…

As the calendar gets a little crowded in December, myself, Simon and Jez have decided to combine the Java, Django/Rails and Python nights together in one big bash at the Old Bank Of England, on the 12th of December, from 7pm onwards. As normal there is no particular agenda, although people wanting to do demos are more than welcome (just let me know first so we can publicise it).

Oh, and as Jez has had to stick a deposit down for the reserved space, please leave a comment to let us know you’re coming!

Update: I’ve caught what I think is a cross between avian flu and sars, with a bit of ebola thrown in. Needless to say I’ll be unable to attend this evening – so Simon B is in charge. Needless to say I’m a little annoyed.

OK, arrangements have been made and we have a new venue for the monthly Django/Rails/Python/Ruby meeting. This time around we’ll have our own space at the Old Bank Of England, which should be much more quiet than Smiths. Like last month, we’ll hopefully be joined by the London Python group, and Django/Rails/Python/Ruby newbies are more than welcome.

Given that we’ll have a better venue for it, I’d also be as keen on people showing demos – hopefully I’ll try and get my colleagues to repeat the demo created for our recent GreenPeace bid. Make sure you leave a comment if you’ll be attending, as I’d like to let the barman know if we’ll drink him out of house and home…

Much fun was had at the Django/Rails meetup in London last Monday. Colleagues Duncan Cragg and Ben Butler-Cole managed to demo a Django-based project being developed for a bid (more to follow if we win), and Michael Sparks from the BBC demoed Kamelia, and we also had lots of people from the monthly Python meeting there too,

Both Simon and Natalie had got jobs since the last meeting – Simon as you may know is now working for Yahoo on Flickr, whereas Natalie is now working for Torchbox, who she met at the last meeting. I also managed to have good chats with Matt (sans demo, although hopefully he’ll have one next time), Tom, ribbed Edward about his collections of machines running Debian, and as always drank too much with Simon. I also talked to lots of other people, but I have a terrible memory! Hopefully I at least remembered everyone who brought me a drink at least.

General consensus was that everyone had fun, although the venue was too loud. I’ll be scouting a couple of potential new venues this week (hopefully somewhere that serves food other than Hula Hoops) – expect the next meeting to be closer to the City proper. I’ll announce a date for the next meeting once I’ve confirmed a venue (and made sure we don’t clash with Jez’s Java meetups), but expect it to be on either the 7th of 14th of November.

At the last meetup, the majority of the people there were ‘thinking’ about using either Rails or Django on a real world project. So by way of some blatant agenda setting for the meetup on the 10th (don’t forget to go and leave a comment if you’re coming) what is stopping you from using either?

Is it concerns about maturity? Scalability? Deployment options? Does the lack of (development) tools put you off? The lack of a workforce, or simply the fact it is in a new language? Is there some killer feature that either one needs to make you use it? Perhaps if enthusiasts of both communities start addressing these concerns and start engaging in some (balanced) advocacy and honest discourse, the adoption of both can be sped up.

Well last night’s inaugural Django and Rails meetup went very well indeed (photos to follow) – apart from the slow start due to most people not knowing each other, and being unsure if the raised eyebrow from someone else in the bar was as a result of them seeing if they were there for the meetup or as a result of wandering into the wrong sort of bar. Photos soon. It was good to meet Simon and Natalie (who came down from Gloster for the event and had to go back by bus), Matt, Tom (who had to get back to paddington for 10) and everyone else. The unfortunate side of the turnout being so good was that I didn’t have enough time to speak to anyone – and with that in mind felt we should make it a monthly thing.

Unless there are any complaints, the venue and time will be the same, Smiths of Smithfield at 7pm. To avoid clashing with other events (well, my monthly pub crawl which happens on the first Tuesday of every month to be exact) I’m suggesting the second Monday of the month – which this time around is the 10th of October. Simon Brunning is going to arrange the London Python meetup for the same time so there’ll be some fresh blood 🙂 As before, leave your comment if you fancy coming along…

There seems to be two different ways to format your dates using Django. The first takes advantage of Python’s built-in strftime, so to format a date according to ISO8601:


mymodel.some_date_field.strftime("%Y%m%dT%H%m")

Giving you a date like 20050819T2031.
<!-more->
Another approach is to format in the templates instead – then you can take advantage of Django’s filters. This formatting is based on the PHP date function circa 4.1 (none of the formatting added in PHP 5.0 seems to be supported) – I assume using Simon Willison’s earlier work. I like the filters, but dislike the fact that I have one type of formatting in my models (and which other Python people will know) and another inside templates. It also doesn’t seem to be as flexible – for example to format a date in the same way as above (with a ‘T’ seperating date and time) I need two filters:



	

{{ mymodel.some_date_field|date:"Ymd" }}T{{ mymodel.some_date_field|date:"Gi" }}

I suppose if it bothers me that much I can always write my own filter…