Redmine: Any advantage to Categories over Custom Fields? - redmine

I am evaluating Redmine, and I wonder if there is any advantage to Categories over Custom Fields?
Indeed, Categories can't be shared between projects so far and it's a strong drawback for me.
I have the feelings categories are only useful if one needs different categories between projects.
In other words, it's a project property instead of a tracker property like custom fields.
I am missing something here?
Thanks you!

In Redmine, Category is a standard field used by trackers and has different values defined for each project in the project 'configuration' tab.
Category values cannot be shared nor inherited in Redmine projects.
This is some serious drawback which is discussed by the community. A patch is available to customize Redmine, but it targets an old version of the application.
An alternate solution is to create a custom field, say Cat, which would be used as a category. That Cat field can be used by any project with any tracker.
It also means that the Cat values are shared for all projects which can be pointless if you have a 'cooking' and a 'mechanics' projects...
There are two solutions to deal with it :
Create a Cat custom field for each project, but the name of the custom field has to be unique
Use the Custom Values Per Project plugin to limit available Cat values for each project, which can be a pain i you have lots of projects
You can even possibly use a combination of those two !
That is the only solution I have found so far.

Related

Is there a way to create multiple product pages in Opencart?

My client's t-shirt website has 2 types of products. One is just normal t-shirts. The other one is dynamic t-shirt design creation. The normal t-shirts can use the default product templates but dynamic products need a different type of functionality in it. Will creating different templates make it possible to resolve this issue or do I need to do more than that?
Create a separate category or add a new field for selecting product type for dynamic t-shirts.
Depending on either of the options mentioned above use 2 product templates or add condition based html code in the existing product template.
Have a nice day :) !
I would suggest using tabs (depending on your theme) then loading the custom template via an additional method and ajax.
Look at how the checkout controllers and templates/javascript work in the checkout process and model that for your custom tshirt builder.

EMF: Restricting choices to predefined values

I am using EMF to allow users to create instances of a particular type of model.
An instance of a model can have 0-* Things but I'd like to be able to predefine the available Things that the user can add to the instance so that they can't just create their own.
How would I go about creating the Things using the ecore model?
If a Thing was just a String then it would be fine - I could use Enums. But a Thing is a type of it's own and consists of other stuff (like a name, version etc.) and I don't know how to give a predefined set of these to the user to choose.
Any ideas?
You have the possibility to use constraints or *EOperation*s.
For a better usability you should use a own dialog implementation. An example of a own implementation with given choices you can find here:
How can I control which instances are available as choices when editing a property in the properties view?
You should also implement a own property source to support the properties editor:
Recipe: Create your own property editor in a generated application

SharePoint Field Definition

I inherited a SharePoint 2007 site collection that has a myriad of subwebs.
To simplify things, though, imagine the following hierarchy:
SiteCollection SC
SiteCollection Site
SubWeb1
SubWeb2
SubWebs 1 and 2 were created from the same site template years ago. They each have a List called ProjTasks that contain the same fields as each other, and even have the same InternalName and Guid. These subWebs do not talk to each other, but they can share the same parent information from the SiteCollection.
What's the best way to update the field definitions across all of the subwebs for a given list?
For the kicker, my specific example is modifying a Choice type's list of choices. While you can usually manually edit a choice by setting one on each line, the only options I have for editing this specific field is changing the Column name and the description (I do not see options for changing the data type or choice options. Any thoughts?
Thank you in advance.
Go to SC > Site Settings > Site Columns.
Is your field listed there? You should be able to edit it and have the choices cascade down to the lists in your sub sites.
for the benefit of everyone who might experience this problem, i found this solution and it worked perfectly. :)

Django: django-transmeta - sorting comments

I have created an article site, where articles are published in several languages. I am using transmeta (http://code.google.com/p/django-transmeta/) to support multiple languages in one model.
Also I am using generic comments framework, to make articles commentable. I wonder what will happen if the same article will be commented in one language and then in another. Looks like all comments will be displayed on both variants....
The question actually is:
Is there a possibility to display only comments submitted with current language of the article?
I tried the approach of transmeta for translation of dynamic texts and I had the following experience:
You want another language, you need to change the database model which is generally undesirable
You need every item in both languages, which is not flexible
You have problems linking with other objects (as you point out in your question)
If you take the way of transmeta you will need two solutions:
The transmeta solution for translating fields in a model
For objects connected to a model using transmeta you will need an additional field to determine the language, say CharField with "en", "de", "ru" etc.
These were major drawbacks that made me rethink the approach and switch to another solution: django.contrib.sites. Every model that needs internationalization inherits from a SiteModel:
class SiteModel(models.Model):
site = models.ForeignKey(Site)
Every object that would need transmeta translation is connected to a site. Every connected object can determine its language from the parent object's site attribute.
I basically ran the wikipedia approach and had a Site object for every language on a subdomain (en., de., ru.). For every site I started a server instance that had a custom settings file which would set the SITE_ID and the language of the site. I used django.contrib.sites.managers.CurrentSiteManagerto display only the items in the language of the current site. I also had a manager that would give you objects of every language. I constructed a model that connects objects of the same model from different languages denoting that they are semantically the same (think languages left column on wikipedia). The sites all use the same database and share the same untranslated User model, so users can switch between languages without any problem.
Advantages:
Your database schema doesn't need to change for additional languages
You are flexible: add languages easily, have objects in one language only etc.
Works with (generic) foreign keys, they connect to an object and know what language it is. You can display the comments of an object and they will be in one language. This solves your problem.
Disadvantages:
It's a greater deal to setup: you need a django server instance for every site and some more glue code
If you need e.g an article in different languages, you need another model to connect them
You may not need the django Site model and could implement something that does the same without the need of multiple django server instances.
I don't know what you are trying to build and what I described might not fit to your case, but it worked out perfectly for my project (internationalized community platform built upon pinax: http://www.bpmn-community.org/ ). So if you disclose some more about your project, I might be able to advise an approach.
To finally answer your question: No, the generic comments will not work out of the box with transmeta. As you realised you will have to display comments in both languages for the article that is displayed in one language. Or you will have to hack into the comments and change the model and do other dirty stuff (not recommended). The approach I described works with comments and any other pluggable app.
To answer your questions:
Two Django instances can share one database, no problem there.
If you don't want two Django instances, but one, you will have to do the following: A middleware checks the incoming request, extracts desired language from URL (en.example.com or example.com/en/ etc.) and saves the language preference in the request object. The view will have to take the request object with the language and take care of the filtering of objects accordingly. Since there is no dedicated server for the language (like in the sites approach where the language is stored in the settings.py file), you can only get the language from the request and you will have to pass attributes from the request object to Model managers to filter objects.
You could try to fake a global language state in the django application with an approach like threadlocals middleware, however I don't know if this plays out nicely with django I18N engine (which is also does some thread magic).
If you want to go big with your site in multiple languages, I recommend going for the sites-approach.

Creating an order in Django

Hi everyone I have a few questions about the django admin.
First the relevant details. I currently have Client, Printer, Cartridge, and Order models.
The Printer model has a ManyToManyField to the Cartridge model, which would allow you to select all the cartridges that can be used with that printer.
The Cliente has a ManyToManyField to the printers which they own.
1) I want to create an Order through the Django admin which lets your specify the Client, a dicount, and multiple cartridges through a ManyToManyField. This is getting kinda tricky because I have to do it through another table that specifies whether it's a new Cartridge or a refill.
2) I want the admin to filters the Cartridges to only show the ones that belong to the printers that they own.
3) Also I would like to have a field that holds the total price of their order, but it should calculate it based on how many cartridges they have added to the order. I don't know if this should be done by adding more of the same cartridge to the order or by having another field in the related table that specifies the quantity.
Can this be done in the admin or do I need to use a form? And if so how would I go about adding this to the admin? It seems difficult and probably something I will have to do in multiple parts since in order to filter the list of cartridges I have to know the client beforehand.
As far as I can see, no, it's not really possible. The development version has some methods for limiting foreign keys, but it doesn't seem to me that limiting based on the customer is possible, since it depends on separate foreign keys.
The best suggestion, if you're really bent on doing it in the admin form, would be to use Javascript to do it. You would still have to make AJAX calls to get lists of what printers customers had and what cartridges to show based on that, but it could be done. You would just specify the JS files to load with the Media class.
But I think that's more work than it's worth. The easiest way I would see to do it would be with Form Wizards. That way, you'd have a step to select the customer so on the next step you know what cartridges to show.
Hope that helps!
I've worked similar problems, and have come to the conclusion that in many cases like this, it's really better to write your own administration interface using forms than it is to try and shoehorn functionality into the admin which is not intended to be there.
As far as 3) goes, it depends on what your product base looks like. If you're likely to have customers ordering 50 identical widgets, you probably do want a quantity field. If customers are more likely to be ordering 2 widgets, one in red, one in blue, add each item separately to the manytomany field and group them in your order interface.